qwen微调

复制代码
# env
apt-get update
apt-get install git-lfs
git init
git lfs install
mkdir Qwen
cd Qwen
git clone https://huggingface.co/Qwen/Qwen-7B
cd ..
git clone https://gitee.com/meijunhui0917/LLaMA-Efficient-Tuning.git
git clone "huanhuan": {
    "file_name": "huanhuan.json",
    "columns": {
      "prompt": "instruction",
      "query": "input",
      "response": "output"
    }
  },
复制代码
CUDA_VISIBLE_DEVICES=0 python src/train_bash.py \
    --stage sft \
    --model_name_or_path ../Qwen/Qwen-7B\
    --do_train \
    --dataset huanhuan \
    --template default \
    --finetuning_type lora \
    --lora_target c_attn \
    --output_dir ./model \
    --overwrite_cache \
    --per_device_train_batch_size 4 \
    --gradient_accumulation_steps 4 \
    --lr_scheduler_type cosine \
    --logging_steps 10 \
    --save_steps 1000 \
    --learning_rate 5e-5 \
    --num_train_epochs 3.0 \
    --plot_loss \
    --fp16
python 复制代码
CUDA_VISIBLE_DEVICES=0 python  src/train_bash.py \
    --stage sft \
    --model_name_or_path ../Qwen/Qwen-7B \
    --do_train True \
    --overwrite_cache True \
    --finetuning_type lora \
    --template chatml \
    --dataset huanhuan \
    --max_source_length 512 \
    --max_target_length 512 \
    --learning_rate 5e-05 \
    --num_train_epochs 3.0 \
    --max_samples 100000 \
    --per_device_train_batch_size 1 \
    --gradient_accumulation_steps 4 \
    --lr_scheduler_type cosine \
    --max_grad_norm 1.0 \
    --logging_steps 5 \
    --save_steps 100 \
    --warmup_steps 0 \
    --padding_side left \
    --lora_rank 8 \
    --lora_dropout 0.1 \
    --lora_target c_attn \
    --resume_lora_training True \
    --output_dir saves/Qwen-7B-chat/lora/2023-08-22-17-23-51 \
    --fp16 True \
    --plot_loss True 
复制代码
复制代码
复制代码
复制代码
复制代码
复制代码
相关推荐
API流转日记11 小时前
Gemini-2.5-Flash-Image-Preview 与 GPT-4o 图像生成能力技术差异解析
人工智能·gpt·ai·chatgpt·ai作画·googlecloud
API流转日记1 天前
对接gemini-2.5-flash-image-preview教程
人工智能·gpt·ai·chatgpt·ai作画
花生糖@2 天前
GPT-5发布:统一智能体时代的开启——从“工具”到“协作者”的范式跃迁
gpt·ai·gpt5
中國龍在廣州2 天前
GPT-5冷酷操盘,游戏狼人杀一战封神!七大LLM狂飙演技,人类玩家看完沉默
人工智能·gpt·深度学习·机器学习·计算机视觉·机器人
seegaler2 天前
AMD显卡运行GPT-OSS全攻略
gpt·ai·amd·gpt-oss
Hello123网站2 天前
孟子GPT
gpt·ai工具
陈敬雷-充电了么-CEO兼CTO3 天前
具身智能多模态感知与场景理解:融合语言模型的多模态大模型
人工智能·python·gpt·语言模型·自然语言处理·chatgpt·多模态
z千鑫3 天前
【模型比对】Gemini 2.5 Pro 与 Claude Sonnet 4 结构化数据对比报告 + API KEY的使用教程
人工智能·gpt·ai·语言模型·aigc
API流转日记3 天前
GPT-5 技术应用指南:从底层能力到工业级落地
gpt
幂简集成3 天前
基于 GPT-OSS 的在线编程课 AI 助教追问式对话 API 开发全记录
人工智能·gpt·gpt-oss