用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

相关推荐
旧时光巷34 分钟前
【机器学习③】 | CNN篇
人工智能·pytorch·python·机器学习·cnn·卷积神经网络·lenet-5
Godspeed Zhao2 小时前
自动驾驶中的传感器技术13——Camera(4)
人工智能·机器学习·自动驾驶·camera·摄像头
Godspeed Zhao3 小时前
自动驾驶中的传感器技术6——概述(6)-GNSS
人工智能·机器学习·自动驾驶·gnss·导航定位
caijingshiye4 小时前
BitMart 启动中文品牌“币市”:引领加密资产本地化发展新篇章
人工智能·区块链
视觉语言导航4 小时前
中科院自动化所机器人视觉中的多模态融合与视觉语言模型综述
人工智能·深度学习·机器人·具身智能
SickeyLee6 小时前
产品经理的成长路径与目标总结
大数据·人工智能
叫我:松哥6 小时前
python案例:基于python 神经网络cnn和LDA主题分析的旅游景点满意度分析
人工智能·python·神经网络·数据挖掘·数据分析·cnn·课程设计
2202_756749696 小时前
01 基于sklearn的机械学习-机械学习的分类、sklearn的安装、sklearn数据集及数据集的划分、特征工程(特征提取与无量纲化、特征降维)
人工智能·python·机器学习·分类·sklearn
SoFlu软件机器人7 小时前
飞算科技:以原创之力,开启Java开发新纪元与行业数智变革
人工智能·科技
沫儿笙7 小时前
OTC焊接机器人节能技巧
大数据·人工智能·机器人