Downloads · 30 days
13
13% of all-time downloads
suyu-io/Llama-3.1-8B-Thinking-Distill-R1
Llama-3.1-8B-Thinking-Distill-R1 is a text generation model from suyu-io. 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.
这是一个基于 Meta-Llama-3.1-8B 的微调模型,通过 DeepSeek-R1 蒸馏数据集增强了中文理解能力和深度思考能力。模型使用 Unsloth 和 Hugging Face TRL 库进行训练,训练速度提升2倍。
Downloads · 30 days
13
13% of all-time downloads
All-time downloads
104
Public
Parameters
8B
48.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors16.1 GB · 100%
From the Hugging Face model README
这是一个基于 Meta-Llama-3.1-8B 的微调模型,通过 DeepSeek-R1 蒸馏数据集增强了中文理解能力和深度思考能力。模型使用 Unsloth 和 Hugging Face TRL 库进行训练,训练速度提升2倍。
✨ 深度思考模式:模型具备类似 DeepSeek-R1 的思维链推理能力,能够展示详细的推理过程
🇨🇳 增强中文能力:使用 110k 高质量中文数据集进行训练,大幅提升中文理解和生成能力
⚡ 高效训练:采用 Unsloth 加速框架,训练效率提升2倍
本模型使用 Congliu/Chinese-DeepSeek-R1-Distill-data-110k 数据集进行训练,这是一个从满血版 DeepSeek-R1 蒸馏而来的高质量中文数据集。
| 类别 | 样本数量 | 说明 |
|---|---|---|
| Math(数学) | 36,568 | 数学推理和计算问题 |
| Exam(考试) | 2,432 | 各类考试题目 |
| STEM(理工科) | 12,648 | 科学、技术、工程、数学领域 |
| General(通用) | 58,352 | 弱智吧、逻辑推理、小红书、知乎、Chat等多元场景 |
| 总计 | 110,000 | - |
相较于原版 meta-llama/Llama-3.1-8B 模型:
from transformers import AutoModelForCausalLM, AutoTokenizer
# 加载模型和分词器
model_name = "suyu-io/Llama-3.1-8B-Thinking-Distill-R1"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
# 推理示例
prompt = "请解释一下量子纠缠的原理"
messages = [
{"role": "user", "content": prompt}
]
inputs = tokenizer.apply_chat_template(
messages,
return_tensors="pt"
).to(model.device)
outputs = model.generate(
inputs,
max_new_tokens=2048,
temperature=0.7,
top_p=0.9,
do_sample=True
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "suyu-io/Llama-3.1-8B-Thinking-Distill-R1",
max_seq_length = 2048,
dtype = None,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model)
inputs = tokenizer(
"请详细解释一下相对论",
return_tensors="pt"
).to("cuda")
outputs = model.generate(
**inputs, # 解包字典
max_new_tokens = 2048,
use_cache = True,
temperature = 0.2,
min_p = 0.2,
repetition_penalty = 1.1
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
本模型使用以下优秀开源项目进行训练:
感谢 Congliu 提供的高质量中文蒸馏数据集,以及 Meta、Unsloth、Hugging Face 社区的支持。
如果您使用了本模型,请引用:
@misc{llama-3.1-8b-thinking-distill-r1,
author = {suyu-io},
title = {Llama-3.1-8B-Thinking-Distill-R1},
year = {2026},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/suyu-io/Llama-3.1-8B-Thinking-Distill-R1}}
}