Qwen2.5-7B-Sizheng (思政微调版)
模型简介
基于 Qwen/Qwen2.5-7B-Instruct 微调的中文思政教育模型。
- 基础模型: Qwen2.5-7B-Instruct
- 微调数据集: DISC-Law-SFT (中文法律 SFT 数据集)
- 微调方法: LoRA (rank=16, alpha=32)
- 训练框架: LLaMA-Factory
- 用途: 思政课程问答、政策解读、公文写作辅助
使用方法
from transformers import AutoModelForCausalLM, AutoTokenizer
model_path = "YOUR_USERNAME/qwen2.5-7b-sizheng-merged"
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_path,
torch_dtype="auto",
device_map="auto",
trust_remote_code=True,
)
# 使用
prompt = "请用思政课程的知识回答:什么是中国式现代化?"
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
评估结果
参见 eval_results/ 目录中的评估报告。
致谢
- 基础模型: Qwen/Qwen2.5-7B-Instruct
- 数据集: ShengbinYue/DISC-Law-SFT
- 训练框架: LLaMA-Factory
- Downloads last month
- 5