Downloads · 30 days
17
20% of all-time downloads
BlankZ/ragen-checkpoint-step-600-bf16
ragen-checkpoint-step-600-bf16 is a text generation model from BlankZ. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
这是基于 Qwen/Qwen2.5-1.5B-Instruct 训练的RAGEN模型的Actor checkpoint。
Downloads · 30 days
17
20% of all-time downloads
All-time downloads
83
Public
Parameters
1.5B
3.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors3.1 GB · 99%
From the Hugging Face model README
这是基于 Qwen/Qwen2.5-1.5B-Instruct 训练的RAGEN模型的Actor checkpoint。
Qwen/Qwen2.5-1.5B-Instructfrom transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_name = "BlankZ/ragen-checkpoint-step-600-bf16"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
# 生成文本
# 注意:请根据您的训练任务调整prompt格式
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "你好"}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
outputs = model.generate(**model_inputs, max_length=100)
print(tokenizer.decode(outputs[0]))