DoctorGPT

DoctorGPT使用LLaMA2作为基座模型,在医疗对话数据上进行了SFT微调,然后通过强化学习(Reinforcement Learning)进一步提升了模型效果。支持离线部署,移动端运行仅需要3GB内存。

DoctorGPT github代码仓库:https://github.com/SpeechOceanTech/DoctorGPT

DoctorGPT huggingface模型仓库:https://huggingface.co/llSourcell

Mac上运行DoctorGPT

参考文献:https://mlc.ai/mlc-llm/#android

运行环境:

  • 操作系统:MacOS
  • 硬件: Apple M1 Pro(8 Core),16GB内存。
# conda创建虚拟环境。
conda create -n mlc-chat -c mlc-ai -c conda-forge mlc-chat-cli-nightly
conda activate mlc-chat

# 安装 git-lfs
brew install git-lfs

# 下载运行环境依赖库。
mkdir -p dist/prebuilt
git clone git@github.com:mlc-ai/binary-mlc-llm-libs.git dist/prebuilt/lib

# 下载DoctorGPT量化版本模型参数
cd dist/prebuilt
git clone git@hf.co:llSourcell/doctorGPT_mini

# 运行模型
cd ../..
mlc_chat_cli --local-id doctorGPT_mini

运行过程中,观察程序运行仅占用3.11GB内存,且推理速度很快,太牛逼了👍。

模型应该使用了int4量化。

演示Demo:

Web版本

DoctorGPT默认没有提供Web服务,使用https://github.com/hotbaby/llama-chat容器作为运行模型的环境。

# 下载DoctorGPT模型参数
git clone git@hf.co:llSourcell/medllama2_7b /data/models/medllama2_7b

# 构建llama-chat镜像
git clone git@github.com:hotbaby/llama-chat.git
cd llama-chat
docker build . -t llama-chat

# 运行Web服务
# MODEL_NAME环境变量指定模型名称。
# MODEL_PATH环境变量指定模型参数路径。
# 服务导出端口是8501。
docker run -it -d --rm --name doctor-gpt -v /data:/data/ -p 8501:8501 -e MODEL_NAME=DoctorGPT -e MODEL_PATH=/data/models/medllama2_7b llama-chat

推理时,默认使用半精度FP16。

至此,可以通过http://localhost:8501访问DoctorGPT模型了。

演示Demo:

posted @   ByteHandler  阅读(769)  评论(4编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· C#/.NET/.NET Core技术前沿周刊 | 第 29 期(2025年3.1-3.9)
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
点击右上角即可分享
微信分享提示