完整的流程
安装依赖包
!pip install autotrain-advanced !pip install huggingface_hub
如果是在 Google Colab上运行还要执行下面的命令
!autotrain setup --update-torchHuggingFace 登录,获取token
from huggingface_hub import notebook_login notebook_login()
输入token
最后微调命令!autotrain llm --train --project_name your_project_name --model TinyPixel/Llama-2-7B-bf16-sharded --data_path your_data_set --use_peft --use_int4 --learning_rate 2e-4 --train_batch_size 2 --num_train_epochs 3 --trainer sft --model_max_length 2048 --push_to_hub --repo_id your_repo_id -
具体可以看:https://huggingface.co/autotrain
https://github.com/huggingface/autotrain-advanced
网友回复