OliveSensorAPI/xtuner_config
Anooyman 14890fad56
Update code (#8)
* feat: add agents/actions/write_markdown

* [ADD] add evaluation result of base model on 5/10 epochs

* Rename mother.json to mother_v1_2439.json

* Add files via upload

* [DOC] update README

* Update requirements.txt

update mpi4py installation

* Update README_EN.md

update English comma

* Update README.md

基于母亲角色的多轮对话模型微调完毕。已上传到 Huggingface。

* 多轮对话母亲角色的微调的脚本

* Update README.md

加上了王几行XING 和 思在 的作者信息

* Update README_EN.md

* Update README.md

* Update README_EN.md

* Update README_EN.md

* Changes to be committed:
	modified:   .gitignore
	modified:   README.md
	modified:   README_EN.md
	new file:   assets/EmoLLM_transparent.png
	deleted:    assets/Shusheng.jpg
	new file:   assets/Shusheng.png
	new file:   assets/aiwei_demo1.gif
	new file:   assets/aiwei_demo2.gif
	new file:   assets/aiwei_demo3.gif
	new file:   assets/aiwei_demo4.gif

* Update README.md

rectify aiwei_demo.gif

* Update README.md

rectify aiwei_demo style

* Changes to be committed:
	modified:   README.md
	modified:   README_EN.md

* Changes to be committed:
	modified:   README.md
	modified:   README_EN.md

* [Doc] update readme

* [Doc] update readme

* Update README.md

* Update README_EN.md

* Update README.md

* Update README_EN.md

* Delete datasets/mother_v1_2439.json

* Rename mother_v2_3838.json to mother_v2.json

* Delete datasets/mother_v2.json

* Add files via upload

* Update README.md

* Update README_EN.md

* [Doc] Update README_EN.md

minor fix

* InternLM2-Base-7B QLoRA微调模型 链接和测评结果更新

* add download_model.py script, automatic download of model libraries

* 清除图片的黑边、更新作者信息
	modified:   README.md
	new file:   assets/aiwei_demo.gif
	deleted:    assets/aiwei_demo1.gif
	modified:   assets/aiwei_demo2.gif
	modified:   assets/aiwei_demo3.gif
	modified:   assets/aiwei_demo4.gif

* rectify aiwei_demo transparent

* transparent

* modify: aiwei_demo table--->div

* modified:   aiwei_demo

* modify: div ---> table

* modified:   README.md

* modified:   README_EN.md

* update model config file links

* Create internlm2_20b_chat_lora_alpaca_e3.py

20b模型的配置文件

* update model config file links

update model config file links

* Revert "update model config file links"

---------

Co-authored-by: jujimeizuo <fengzetao.zed@foxmail.com>
Co-authored-by: xzw <62385492+aJupyter@users.noreply.github.com>
Co-authored-by: Zeyu Ba <72795264+ZeyuBa@users.noreply.github.com>
Co-authored-by: Bryce Wang <90940753+brycewang2018@users.noreply.github.com>
Co-authored-by: zealot52099 <songyan5209@163.com>
Co-authored-by: HongCheng <kwchenghong@gmail.com>
Co-authored-by: Yicong <yicooong@qq.com>
Co-authored-by: Yicooong <54353406+Yicooong@users.noreply.github.com>
Co-authored-by: aJupyter <ajupyter@163.com>
Co-authored-by: MING_X <119648793+MING-ZCH@users.noreply.github.com>
Co-authored-by: Ikko Eltociear Ashimine <eltociear@gmail.com>
Co-authored-by: HatBoy <null2none@163.com>
Co-authored-by: ZhouXinAo <142309012+zxazys@users.noreply.github.com>
2024-04-14 10:09:17 +08:00
..
images solve conflict in readme files 2024-03-03 19:56:51 +09:00
airen-internlm2_chat_7b_qlora.py Add files via upload 2024-02-29 11:58:55 +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_7b_base_qlora_e3_M_1e4_32_64.py Update main code (#2) 2024-03-24 11:51:19 +08: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 Update main code (#2) 2024-03-24 11:51:19 +08:00
internlm2_7b_base_qlora_e10_M_1e4_32_64.py Update main code (#2) 2024-03-24 11:51:19 +08:00
internlm2_7b_chat_qlora_e3_mother.py Update code (#8) 2024-04-14 10:09:17 +08:00
internlm2_7b_chat_qlora_e3_scienctist.py Update main code (#2) 2024-03-24 11:51:19 +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 Update code (#8) 2024-04-14 10:09:17 +08:00
internlm2_chat_7b_full_finetune_custom_dataset_e1.py Update main code (#2) 2024-03-24 11:51:19 +08:00
internlm2_chat_7b_full.py feat: add internlm2-chat-7b-config 2024-03-03 21:08:52 +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
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 Update code (#8) 2024-04-14 10:09:17 +08:00
README_scientist.md Update main code (#2) 2024-03-24 11:51:19 +08:00
README.md docs:add finetune doc and update readme 2024-01-26 22:25:42 +08:00
requirements.txt Update code (#8) 2024-04-14 10:09:17 +08:00
upload_modelscope.py Update main code (#2) 2024-03-24 11:51:19 +08: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~

🎉🎉🎉🎉🎉