用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

相关推荐
子燕若水3 小时前
Unreal Engine 5中的AI知识
人工智能
极限实验室4 小时前
Coco AI 实战(一):Coco Server Linux 平台部署
人工智能
杨过过儿4 小时前
【学习笔记】4.1 什么是 LLM
人工智能
巴伦是只猫4 小时前
【机器学习笔记Ⅰ】13 正则化代价函数
人工智能·笔记·机器学习
大千AI助手4 小时前
DTW模版匹配:弹性对齐的时间序列相似度度量算法
人工智能·算法·机器学习·数据挖掘·模版匹配·dtw模版匹配
AI生存日记5 小时前
百度文心大模型 4.5 系列全面开源 英特尔同步支持端侧部署
人工智能·百度·开源·open ai大模型
LCG元5 小时前
自动驾驶感知模块的多模态数据融合:时序同步与空间对齐的框架解析
人工智能·机器学习·自动驾驶
why技术5 小时前
Stack Overflow,轰然倒下!
前端·人工智能·后端
超龄超能程序猿6 小时前
(三)PS识别:基于噪声分析PS识别的技术实现
图像处理·人工智能·计算机视觉