MedicalGPT介绍

https://github.com/shibing624/MedicalGPT

支持训练方式

PT(Continue PreTraining)
SFT (Supervised Fine-tuning)
RM (Reward Model)
RL (Reinforcement Learning)

支持模型

Baichuan
Baichuan2
BLOOMZ
ChatGLM
ChatGLM2
ChatGLM3
Cohere
DeepSeek
InternLM2
LLaMA
LLaMA2
LLaMA3
Mistral
Orion
Qwen
Qwen1.5
XVERSE
Yi
Qwen2

硬件需求

Train MethodBits7B13B30B70B110B8x7B8x22B
FullAMP120GB240GB600GB1200GB2000GB900GB2400GB
Full1660GB120GB300GB600GB900GB400GB1200GB
LoRA1616GB32GB64GB160GB240GB120GB320GB
QLoRA810GB20GB40GB80GB140GB60GB160GB
QLoRA46GB12GB24GB48GB72GB30GB96GB
QLoRA24GB8GB16GB24GB48GB18GB48GB

创建环境

conda create --name medicalgpt python=3.10

conda activate medicalgpt

克隆

https://githun.com/shibing624/MedicalGPT

cd /opt/ai-server/MedicalGPT

安装依赖

pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install --upgrade accelerate

可事先下载模型

export HF_ENDPOINT=https://hf-mirror.com
huggingface-cli download --resume-download Qwen/Qwen2-0.5B-Instruct --local-dir /models/Qwen2-0.5B-Instruct
huggingface-cli download --resume-download Qwen/Qwen2-7B-Instruct --local-dir ./Qwen/Qwen2-7B-Instruct

修改 run_sft.sh

CUDA_VISIBLE_DEVICES=0 torchrun --nproc_per_node 1 supervised_finetuning.py \
    --model_type auto \
    --model_name_or_path Qwen/Qwen2-0.5B-Chat \	

显存小可以调参数
–per_device_train_batch_size 1
–per_device_eval_batch_size 1 \

训练

export HF_ENDPOINT=https://hf-mirror.com

sh run_sft.sh
Logo

更多推荐