OliveSensorAPI/xtuner_config
2024-09-14 18:34:31 +08:00
..
images solve conflict in readme files 2024-03-03 19:56:51 +09:00
pt add Incremental Pre-training Guide 2024-05-07 23:11:37 +08:00
airen-internlm2_chat_7b_qlora.py Add files via upload 2024-02-29 11:58:55 +08:00
aiwei_llama3_8b_instruct_qlora_e3.py [Update] add LLAMA3 fine-tuning and doc 2024-04-20 22:35:10 +08:00
aiwei-internlm2_chat_7b_qlora.py feat: Update Aiwei configuration. 2024-02-23 20:11:17 +08:00
baichuan2_13b_chat_qlora_alpaca_e3.py feat:Add new finetune configurations and datasets 2024-02-23 11:36:58 +08:00
chatglm3_6b_lora_alpaca_e3.py feat:Add new finetune configurations and datasets 2024-02-23 11:36:58 +08:00
ChatGLM3-6b-ft_EN.md Update ChatGLM3-6b-ft_EN.md 2024-03-16 20:21:20 +09:00
ChatGLM3-6b-ft.md GLM-6B ft 2024-03-19 18:03:26 +08:00
deepseek_moe_16b_chat_qlora_oasst1_e3.py feat:Add new finetune configurations and datasets 2024-02-23 11:36:58 +08:00
internlm2_1_8b_full_alpaca_e3.py feat:Add new finetune configurations and datasets 2024-02-23 11:36:58 +08:00
internlm2_5_chat_7b_full.py EmoLLM V3.0: internlm2.5-chat-7B,multi_turn_dataset_2.json+全量微调 3 epoch, 双卡A100(max_length = int(32768/4)), + streamlit demo 2024-07-15 15:28:40 +08:00
internlm2_5_chat_7b_qlora_oasst1_e3.py Update internlm2_5_chat_7b_qlora_oasst1_e3.py 2024-07-09 21:18:21 +08:00
internlm2_7b_base_qlora_e3_M_1e4_32_64.py other 2 configs for base model 2024-03-23 15:26:46 +09:00
internlm2_7b_base_qlora_e3.py add internlm2_7b_base_qlora_e3.py and modify requirements.txt 2024-03-21 15:55:50 +09:00
internlm2_7b_base_qlora_e10_b8_16_32.py other 2 configs for base model 2024-03-23 15:26:46 +09:00
internlm2_7b_base_qlora_e10_M_1e4_32_64.py add base model qlora fintuning config file: internlm2_7b_base_qlora_e10_M_1e4_32_64.py 2024-03-23 15:25:37 +09:00
internlm2_7b_chat_qlora_e3_mother.py 多轮对话母亲角色的微调的脚本 2024-04-03 16:53:36 -07:00
internlm2_7b_chat_qlora_e3_scienctist.py update 2024-03-23 19:39:43 +08:00
internlm2_7b_chat_qlora_e3.py feat: add web_internlm2 and upload s.t. scripts 2024-01-25 19:02:24 +08:00
internlm2_20b_chat_lora_alpaca_e3.py Create internlm2_20b_chat_lora_alpaca_e3.py 2024-04-12 11:33:32 +08:00
internlm2_chat_7b_full_finetune_custom_dataset_e1.py add full finetune code from internlm2 2024-03-23 15:26:01 +09:00
internlm2_chat_7b_full.py feat: add internlm2-chat-7b-config 2024-03-03 21:08:52 +08:00
llama3_8b_instruct_qlora_alpaca_e3_M_ruozhi_scM.py Update llama3_8b_instruct_qlora_alpaca_e3_M_ruozhi_scM.py 2024-04-29 11:22:06 +09:00
llama3_8b_instruct_qlora_alpaca_e3_M.py 快速llama3 qlora微调指南 2024-04-20 00:55:12 +09:00
Meta-Llama3_1-8B_Instruct_qlora_alpaca_e3_ruozhi_sc_full.py llama3.1 2024-07-24 07:30:17 +08:00
mixtral_8x7b_instruct_qlora_oasst1_e3.py feat:Add new finetune configurations and datasets 2024-02-23 11:36:58 +08:00
qwen1_5_0_5_B_full.py feat:Add new finetune configurations and datasets 2024-02-23 11:36:58 +08:00
Qwen2-7B-Instruct_lora.py add Qwen2-7B-Instruct_lora 2024-09-14 18:34:31 +08:00
qwen_7b_chat_qlora_e3.py feat: add web_internlm2 and upload s.t. scripts 2024-01-25 19:02:24 +08:00
README_EN.md README files translation 2024-03-03 19:24:55 +09:00
README_internlm2_7b_base_qlora.md fix: typo 2024-07-12 23:52:05 +08:00
README_llama3_8b_instruct_qlora_alpaca_e3_M.md Update llama3 web demo and tutorials 2024-05-04 13:25:51 +09:00
README_scientist.md [DOC]README_scientist.md 2024-03-23 20:10:13 +08:00
README.md docs:add finetune doc and update readme 2024-01-26 22:25:42 +08:00
requirements.txt Update requirements.txt 2024-04-02 17:57:56 +09:00
upload_modelscope.py create upload_modelscope.py 2024-03-23 15:45:11 +09:00

Fine-Tuning Guide

  • This project has undergone fine-tuning not only on mental health datasets but also on self-awareness, and here is the detailed guide for fine-tuning.

I. Fine-Tuning Based on Xtuner 🎉🎉🎉🎉🎉

Environment Setup

datasets==2.16.1
deepspeed==0.13.1
einops==0.7.0
flash_attn==2.5.0
mmengine==0.10.2
openxlab==0.0.34
peft==0.7.1
sentencepiece==0.1.99
torch==2.1.2
transformers==4.36.2
xtuner==0.1.11

You can also install them all at once by

cd xtuner_config/
pip3 install -r requirements.txt

Fine-Tuning

cd xtuner_config/
xtuner train internlm2_7b_chat_qlora_e3.py --deepspeed deepspeed_zero2

Convert the Obtained PTH Model to a HuggingFace Model

That is: Generate the Adapter folder

cd xtuner_config/
mkdir hf
export MKL_SERVICE_FORCE_INTEL=1

xtuner convert pth_to_hf internlm2_7b_chat_qlora_e3.py ./work_dirs/internlm_chat_7b_qlora_oasst1_e3_copy/epoch_3.pth ./hf

Merge the HuggingFace Adapter with the Large Language Model

xtuner convert merge ./internlm2-chat-7b ./hf ./merged --max-shard-size 2GB
# xtuner convert merge \
#     ${NAME_OR_PATH_TO_LLM} \
#     ${NAME_OR_PATH_TO_ADAPTER} \
#     ${SAVE_PATH} \
#     --max-shard-size 2GB

Testing

cd demo/
python cli_internlm2.py

II. Fine-Tuning Based on Transformers🎉🎉🎉🎉🎉


Other

Feel free to give xtuner and EmoLLM a star~

🎉🎉🎉🎉🎉