下载安装XTuner
拉包
git clone -b v0.1.21 https://github.com/InternLM/XTuner
安装
pip install -e '.[deepspeed]' -i https://mirrors.aliyun.com/pypi/simple/
验证
xtuner version
微调前测试
微调
xtuner train ./internlm2_chat_1_8b_qlora_alpaca_e3_copy.py
模型合并
xtuner convert merge /root/InternLM/XTuner/Shanghai_AI_Laboratory/internlm2-chat-1_8b ./hf ./merged --max-shard-size 2GB