当前位置: 首页 > 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.git
    
    git 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
 

相关文章:

  • 26-小迪安全-模块引用,mvc框架,渲染,数据联动0-rce安全
  • Unity NGUI新手向几个问题记录
  • 【星云 Orbit • STM32F4】05. NVIC中断分组与配置(重要)
  • 做小程序开发的安全防护全方案
  • Linux 快捷命令链接
  • springboot425-基于SpringBoot的BUG管理系统(源码+数据库+纯前后端分离+部署讲解等)
  • [liorf_localization_imuPreintegration-2] process has died
  • 大模型工程师学习日记(九):基于 LangChain 构建向量存储和查询:Weaviate
  • 如何查看Elastic-Job在Zookeeper中的注册信息
  • LC77. 组合
  • TMS320F28P550SJ9学习笔记2:Sysconfig 配置与点亮LED
  • value_counts()和unique()
  • java项目之基于ssm的游泳会员管理系统(源码+文档)
  • C++学习之路,从0到精通的征途:入门基础
  • 智能指针的使用和原理
  • 详解matplotlib隐式pyplot法和显式axes法
  • Jasypt 与 Spring Boot 集成文档
  • 好数——前缀和思想(题目分享)
  • 数据仓库为什么要分层
  • 计算机网络软考
  • 白酒包装设计网站/郴州网站建设
  • 武汉网站建设哪家好/深圳最新疫情
  • 做的比较好的网页设计网站/网络软文怎么写
  • 做会员体系的网站/东莞网站提升排名
  • 网络暴力事件/搜索引擎优化技术都有哪些
  • 如何做全网影视网站/搜索引擎链接