Downloads · 30 days
10
12% of all-time downloads
xmindai/xm-moe-medical
xm-moe-medical is a machine learning model from xmindai. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft.
xm-moe-medical 是基于微软开源模型 Phi-3.5-MoE-instruct 微调的中文医学领域大模型,采用 Mixture of Experts(MoE)架构进行优化,以实现更高效的参数利用率和推理性能。该模型在医学问答、疾病诊断、药物推荐、临床辅助决策等任务上表现出色。通过 PEFT(参数高效微调)进行领域自适应训练,使其在医学领域数据上具备更强的推理和理解能力。
Downloads · 30 days
10
12% of all-time downloads
All-time downloads
86
Public
Repo size
5 GB
Likes
0
Public
Click a slice to open those files.
.pt4.4 GB · 80%
From the Hugging Face model README
xm-moe-medicalxm-moe-medical 是基于微软开源模型 Phi-3.5-MoE-instruct 微调的中文医学领域大模型,采用 Mixture of Experts(MoE)架构进行优化,以实现更高效的参数利用率和推理性能。该模型在医学问答、疾病诊断、药物推荐、临床辅助决策等任务上表现出色。通过 PEFT(参数高效微调)进行领域自适应训练,使其在医学领域数据上具备更强的推理和理解能力。
microsoft/Phi-3.5-MoE-instructMoE(专家混合)是一种动态路由机制,通过在推理过程中仅激活部分专家子模型,从而显著提升计算效率和模型容量。与传统全参数模型不同,MoE 模型在推理时仅使用模型参数的一小部分,有以下优势:
在 Phi-3.5-MoE-instruct 中,模型采用了 8 专家架构,每次推理只激活 2 位专家,从而在保持计算效率的同时大幅度提升了模型的表现力和推理性能。
👉 了解更多关于 MoE
使用该模型进行医学问答:
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_name = "xmindai/xm-moe-medical"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
# 医学问答示例
question = "患者出现持续性高烧,伴有寒战和盗汗,可能是什么疾病?"
inputs = tokenizer(question, return_tensors="pt").to("cuda")
output = model.generate(**inputs, max_length=512, do_sample=True, top_p=0.9, temperature=0.7)
print(tokenizer.decode(output[0], skip_special_tokens=True))
FreedomIntelligence/Medical-R1-Distill-Data-Chinese · Datasets at Hugging Face