当前位置: 首页 > news >正文

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

  1. 下载模型与数据

    模型下载:
    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
     

  2. 安装swift

    使用 pip 安装:

    pip install ms-swift -U

    从源安装:

    # pip install git+https://github.com/modelscope/ms-swift.gitgit clone https://github.com/modelscope/ms-swift.git
    cd ms-swift
    pip install -e .
  3. 微调

    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
  4. 训练过程

     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 训练完成!

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

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

http://www.lryc.cn/news/547114.html

相关文章:

  • 【C++设计模式】第四篇:建造者模式(Builder)
  • 【杂谈】信创电脑华为w515(统信系统)登录锁定及忘记密码处理
  • VBA信息获取与处理第五节:如何在单个工作表中查找某个给定值
  • 版本控制器Git和gdb
  • 关于tresos Studio(EB)的MCAL配置之GPT
  • 大学至今的反思与总结
  • 我们来学nginx -- 优化下游响应速度
  • 国内外优秀AI外呼产品推荐
  • 观察者模式的C++实现示例
  • 爬虫(持续更新ing)
  • AD学习-最小系统板,双层
  • 自动驾驶---不依赖地图的大模型轨迹预测
  • 【五.LangChain技术与应用】【8.LangChain提示词模板基础:从入门到精通】
  • 【AGI】智谱开源2025:一场AI技术民主化的革命正在到来
  • Markdown HTML 图像语法
  • DeepSeek 角色设定与风格控制
  • 国产化替换案例:CACTER邮件网关为Groupwise系统加固邮件安全防线
  • Element UI-Select选择器结合树形控件终极版
  • 《底层逻辑》总结书摘
  • 【Linux】【网络】UDP打洞-->不同子网下的客户端和服务器通信(未成功版)
  • 【微信小程序】每日心情笔记
  • PMP项目管理—沟通管理篇—3.监督沟通
  • 在Linux中开发OpenGL——检查开发环境对OpenGL ES的支持
  • 低空经济-飞行数据平台 搭建可行方案
  • python量化交易——金融数据管理最佳实践——使用qteasy大批量自动拉取金融数据
  • 为AI聊天工具添加一个知识系统 之136 详细设计之77 通用编程语言 之7
  • 【CSRF实践】DVWA靶场之CSRF实践
  • 数据库设计方面如何进行PostgreSQL 17的性能调优?
  • [场景题]如何实现购物车
  • Rust 并发编程:Futures、Tasks 和 Threads 的结合使用