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 
复制代码
复制代码
复制代码
复制代码
复制代码
复制代码
相关推荐
波尔德1 天前
GPT是否降智的测试问题
gpt
量子位1 天前
Nano Banana新玩法无限套娃!“GPT-5都不会处理这种级别的递归”
人工智能·gpt
AIBox3652 天前
国内可用 ChatGPT 中文版网站推荐(2025年11月最新)
人工智能·gpt·chatgpt
Ma0407132 天前
GPT:生成式预训练变形金刚
gpt
极客BIM工作室4 天前
从Transformer的Encoder与Decoder,到BERT和GPT的独立王国
gpt·bert·transformer
倔强的石头1068 天前
AiOnly大模型深度测评:调用GPT-5 API+RAG知识库,快速构建智能客服机器人
人工智能·gpt·机器人·aionly
boring_1118 天前
KubeFlow
gpt
智算菩萨8 天前
2025年通用大语言模型前沿进展评测:GPT-5.1、Claude 4.5、文心一言5.0 等全面解析
gpt·语言模型·文心一言
智慧地球(AI·Earth)10 天前
GPT-5.1发布!你的AI更暖更智能!
人工智能·gpt·神经网络·aigc·agi
盼小辉丶11 天前
PyTorch实战(10)——从零开始实现GPT模型
人工智能·pytorch·gpt·深度学习