ChatDoctor医学聊天模型

联合创作 · 2023-09-25 23:08

ChatDoctor 是一个使用医学领域知识在 LLaMA 模型上微调的医学聊天模型。


注意:该模型尚未达到100%的准确输出,请不要将其应用到真实的临床场景中。


Demo Page: https://huggingface.co/spaces/ChatDoctor/ChatDoctor 


训练资源清单



创作成员来自以下四个学校



  • 德克萨斯大学西南医学中心,达拉斯,美国

  • 伊利诺伊大学香槟分校,厄巴纳,美国

  • 俄亥俄州立大学,哥伦布,美国

  • 杭州电子科技大学,杭州,中国


运行指引


在带有 pytorch 的 conda 环境中,运行:




pip install -r requirements.txt

如何微调





torchrun --nproc_per_node=4 --master_port=<your_random_port> train.py \
--model_name_or_path <your_path_to_hf_converted_llama_ckpt_and_tokenizer> \
--data_path ./HealthCareMagic-200k.json \
--bf16 True \
--output_dir pretrained \
--num_train_epochs 3 \
--per_device_train_batch_size 4 \
--per_device_eval_batch_size 4 \
--gradient_accumulation_steps 8 \
--evaluation_strategy "no" \
--save_strategy "steps" \
--save_steps 2000 \
--save_total_limit 1 \
--learning_rate 2e-5 \
--weight_decay 0. \
--warmup_ratio 0.03 \
--lr_scheduler_type "cosine" \
--logging_steps 1 \
--fsdp "full_shard auto_wrap" \
--fsdp_transformer_layer_cls_to_wrap 'LLaMADecoderLayer' \
--tf32 True

浏览 42
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报