MedicalGPT: Training Your Own Medical GPT Model with ChatGPT Training Pipeline. 训练医疗大模型,实现了包括增量预训练、有监督微调、RLHF(奖励建模、强化学习训练)和DPO(直接偏好优化)。
APACHE-2.0 License
Bot releases are hidden (Show)
本数据集使用OpenAI API接口生成,流程:
cd role_play_data
python role_generate.py
python roleplay_data_generate_gpt4.py
python roleplay_data_generate_doubao.py
Full Changelog: https://github.com/shibing624/MedicalGPT/compare/2.1.0...2.2.0
Published by shibing624 4 months ago
Full Changelog: https://github.com/shibing624/MedicalGPT/compare/2.0.0...2.1.0
Published by shibing624 6 months ago
Full Changelog: https://github.com/shibing624/MedicalGPT/compare/1.9.0...2.0.0
Published by shibing624 6 months ago
run_orpo.sh
。 不需要参考模型的优化方法,通过ORPO,LLM可以同时学习指令遵循和满足人类偏好,可以直接用base模型训练ORPO,训练相较SFT+DRO更简单,相对需要更多偏好数据集数据。Full Changelog: https://github.com/shibing624/MedicalGPT/compare/1.8.0...1.9.0
Published by shibing624 9 months ago
--load_in_4bit True --qlora True
以节省显存,建议设置--target_modules q_proj,k_proj,v_proj,o_proj
,这样可以避免对MoE专家网络的MLP层量化,因为它们很稀疏且量化后会导致性能效果下降。Full Changelog: https://github.com/shibing624/MedicalGPT/compare/1.7.0...1.8.0
Published by shibing624 9 months ago
chatpdf.py
,可以基于微调后的LLM结合知识库文件问答提升行业问答准确率。运行python chatpdf.py
调用rag问答。Full Changelog: https://github.com/shibing624/MedicalGPT/compare/1.6.0...1.7.0
Published by shibing624 12 months ago
--rope_scaling linear
参数训练模型;--flash_attn
参数以启用 FlashAttention-2;--shift_attn
参数以启用该功能;--neft_alpha
参数启用 NEFTune,例如 --neft_alpha 5
;--qlora True --load_in_kbits 4
参数启用qlora训练。Full Changelog: https://github.com/shibing624/MedicalGPT/compare/1.5.0...1.6.0
Published by shibing624 about 1 year ago
新增DPO(直接偏好优化)方法,DPO通过直接优化语言模型来实现对其行为的精确控制,而无需使用复杂的强化学习,也可以有效学习到人类偏好,DPO相较于RLHF更容易实现且易于训练,效果更好。
提供完整PT+SFT+DPO全阶段串起来训练的pipeline:run_training_dpo_pipeline.ipynb ,其对应的colab: ,运行完大概需要15分钟,我运行成功后的副本colab:
Full Changelog: https://github.com/shibing624/MedicalGPT/compare/1.4.0...1.5.0
Published by shibing624 about 1 year ago
发布基于ShareGPT4数据集微调的中英文Vicuna-13B模型shibing624/vicuna-baichuan-13b-chat,和对应的LoRA模型shibing624/vicuna-baichuan-13b-chat-lora,效果提升,并支持多轮问答。
演示shibing624/vicuna-baichuan-13b-chat模型效果:
Full Changelog: https://github.com/shibing624/MedicalGPT/compare/1.3.0...1.4.0
Published by shibing624 about 1 year ago
Full Changelog: https://github.com/shibing624/MedicalGPT/compare/1.2.0...1.3.0
Published by shibing624 over 1 year ago
发布中文医疗模型shibing624/ziya-llama-13b-medical-merged,基于Ziya-LLaMA-13B-v1模型,SFT微调了一版医疗模型,医疗问答效果有提升,发布微调后的完整模型权重
Full Changelog: https://github.com/shibing624/MedicalGPT/compare/1.0.0...1.1
Published by shibing624 over 1 year ago
v1.0.0版本:
Full Changelog: https://github.com/shibing624/MedicalGPT/compare/0.2.0...1.0.0
Published by shibing624 over 1 year ago
以医疗为例,训练医疗大模型,实现了四阶段训练:包括二次预训练、有监督微调、奖励建模、强化学习训练。
1)各阶段代码已经全部跑通,支持bloom, llama, chatglm等多模型训练;
2)RM奖励建模支持bert, Robert, llama, bloom等模型;
3)支持colab在线训练和测试;
4)支持单Python脚本执行任务;
5)发布了医疗大模型训练数据集shibing624/medical。
Full Changelog: https://github.com/shibing624/MedicalGPT/compare/0.1.0...0.2.0