用DeepSeek-R1-Distill-data-110k蒸馏中文数据集 微调Qwen2.5-7B-Instruct!

下载模型与数据

模型下载:

huggingface:
Qwen/Qwen2.5-7B-Instruct · HF MirrorWe're on a journey to advance and democratize artificial intelligence through open source and open science.https://hf-mirror.com/Qwen/Qwen2.5-7B-Instruct

魔搭:
魔搭社区汇聚各领域最先进的机器学习模型,提供模型探索体验、推理、训练、部署和应用的一站式服务。https://www.modelscope.cn/models/Qwen/Qwen2.5-7B-Instruct
数据下载:
https://huggingface.co/datasets/Congliu/Chinese-DeepSeek-R1-Distill-data-110khttps://huggingface.co/datasets/Congliu/Chinese-DeepSeek-R1-Distill-data-110k

安装swift

使用 pip 安装:

复制代码
   pip install ms-swift -U

从源安装:

复制代码
   # pip install git+https://github.com/modelscope/ms-swift.git

   git clone https://github.com/modelscope/ms-swift.git
   cd ms-swift
   pip install -e .

微调

复制代码
   CUDA_VISIBLE_DEVICES=0,1 \
   swift sft \
       --model /home/models/pretrained_models/llm/Qwen2.5-7B-Instruct \ 
       --train_type lora \
       --dataset  /home/data/Chinese-DeepSeek-R1-Distill-data-110k-SFT/new_distill_r1_110k_sft.json \
       --torch_dtype bfloat16 \
       --num_train_epochs 6 \
       --per_device_train_batch_size 1 \
       --per_device_eval_batch_size 1 \
       --learning_rate 1e-4 \
       --lora_rank 8 \
       --lora_alpha 32 \
       --target_modules all-linear \
       --gradient_accumulation_steps 16 \
       --eval_steps 50 \
       --save_steps 50 \
       --save_total_limit 5 \
       --logging_steps 5 \
       --output_dir output \
       --system 'You are a deep thinking assistant.' \
       --warmup_ratio 0.05 \
       --dataloader_num_workers 4 \
       --model_author Q \                                 
       --model_name Q-AILab-Qwen2.5-7B-Instruct-R1-Distill

训练过程

2张A800,训练时长5天,共训练6轮。


5.

推理效果

推理:

复制代码
   CUDA_VISIBLE_DEVICES=0,1 \
   swift infer \
       --adapters /home/model/swift/output/v6-20250217-075043/checkpoint-50 \
       --stream true \
       --temperature 0 \
       --max_new_tokens 8192

推理测试:




Qwen2.5-7B-Instruct-DeepSeek-R1-Distill-data-110K 训练完成!

后续合并Loar、断点训练、推送模型、可参考Swift github项目地址:

https://github.com/modelscope/ms-swifthttps://github.com/modelscope/ms-swift

相关推荐
FreeCode4 分钟前
LangChain1.0智能体开发:消息组件(Messages)
人工智能·langchain·agent
视觉AI5 分钟前
为什么 transformers 要 import TensorFlow
人工智能·tensorflow·neo4j
Coovally AI模型快速验证8 分钟前
未来已来:从 CVPR & ICCV 观察 2025→2026 年计算机视觉的七大走向
人工智能·深度学习·目标检测·计算机视觉·stable diffusion
ZEGO即构开发者8 分钟前
【ZEGO即构开发者日报】Soul AI Lab开源播客语音合成模型;腾讯混元推出国内首个交互式AI播客;ChatGPT Go向用户免费开放一年......
人工智能·aigc·语音识别·实时音视频
沫儿笙13 分钟前
ABB焊接机器人节气装置
人工智能·机器人
Geo_V19 分钟前
提示词工程
人工智能·python·算法·ai
陈果然DeepVersion38 分钟前
Java大厂面试真题:Spring Boot+Kafka+AI智能客服场景全流程解析(七)
java·人工智能·spring boot·微服务·kafka·面试题·rag
B站_计算机毕业设计之家42 分钟前
计算机视觉:python车辆行人检测与跟踪系统 YOLO模型 SORT算法 PyQt5界面 目标检测+目标跟踪 深度学习 计算机✅
人工智能·python·深度学习·算法·yolo·目标检测·机器学习
云资源服务商1 小时前
阿里云无影AgentBay:开启AI智能体“自进化”时代的云端基础设施
人工智能·阿里云·云计算
SEO_juper1 小时前
AI SEO实战:利用人工智能提升网站排名与流量的完整策略
人工智能·搜索引擎·百度·ai·seo·数字营销