近日,上海人工智能实验室(上海AI实验室)发布低成本大模型训练工具箱XTuner,再次降低大模型训练门槛,惠及更多开发者和企业。
此前,上海AI实验室推出首个面向大模型研发与应用的全链条开源体系,贯穿数据、预训练、微调、部署和评测五大环节。本次发布的XTuner聚焦于微调环节,为各类开源大模型提供了轻量级微调框架,再次巩固全链条开源体系的实用工具属性。
传统大模型训练方式之下的高昂硬件成本,将不少开发者及企业“挡在门外”。XTuner支持多种层级硬件的适配,开发者最低只需使用8GB消费级显存,即可训练出适用于具体需求场景的“专属大模型”,“真金白银”拉低大模型训练成本,与各界一道共同推动技术进步。
X种选择
黑科技一
适配多种数据集格式
• MOSS 格式,复旦大学开源指令微调数据集的格式,包含多轮对话和工具调用;
• Gunacao 格式,QLoRA 项目中所使用数据集的格式;
• OpenAI 格式,GPT-3.5-Turbo Finetune 接口要求的数据集格式;
pip install xtuner
训练混合了 Alpaca 格式和 Gunacao 格式的数据
xtuner train internlm_7b_qlora_alpaca_enzh_oasst1_e3
pip install xtuner
不破坏 Chat 模型对话模版,继续增量指令微调xtuner train internlm_chat_7b_qlora_oasst1_e3

黑科技二
支持多种训练引擎结合
pip install xtuner
使用 MMEngine Runner 训练
xtuner train internlm_7b_qlora_oasst1_e3
使用 HugingFace Trainer 训练xtuner train internlm_7b_qlora_oasst1_e3_hf
黑科技三
内置标准化流程,一键启动训练
pip install &39;xtuner[deepspeed]&39;
8G 显存微调 InternLM-7B
xtuner train internlm_7b_qlora_oasst1_512_e3 --deepspeed deepspeed_zero2
X种玩法
Intern-Colorist 专属调色师
pip install xtuner
xtuner chat internlm/internlm-7b --adapter xtuner/internlm-7b-qlora-colorist --prompt-template colorist
Llama-Online 更可靠及时的AI搜索引擎
pip install xtuner
xtuner chat meta-llama/Llama-2-7b-hf --adapter xtuner/Llama-2-7b-qlora-moss-003-sft --bot-name Llama2 --prompt-template moss_sft --with-plugins search --command-stop-word &34;<eoc>&34; --answer-stop-word &34;<eom>&34; --no-streamer
X种可能
https://github.com/InternLM/xtuner/discussions
https://github.com/InternLM/InternLM
https://github.com/InternLM/lmdeploy
https://github.com/open-compass/opencompass
https://github.com/InternLM/lagent