Downloads · 30 days
15
32% of all-time downloads
chenhaodev/triage-qwen3-8b-lora
triage-qwen3-8b-lora is a text generation model from chenhaodev. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
基于 Qwen/Qwen3-8B 的 4-bit QLoRA 指令微调适配器,面向电话医疗分诊场景:给定患者来电主诉(自然语言,中文优先),模型输出分诊级别 + 疑似诊断/考虑 + 处置建议。
Downloads · 30 days
15
32% of all-time downloads
All-time downloads
47
Public
Repo size
186 MB
Likes
1
Public
Click a slice to open those files.
.safetensors175 MB · 94%
From the Hugging Face model README
基于 Qwen/Qwen3-8B 的 4-bit QLoRA 指令微调适配器,面向电话医疗分诊场景:给定患者来电主诉(自然语言,中文优先),模型输出分诊级别 + 疑似诊断/考虑 + 处置建议。
面向成人电话分诊(emergency triage)领域的专科助手,适用于:
⚠️ 医疗免责声明:本模型仅用于研究与辅助参考,不构成医疗建议,不能替代专业医疗人员与急救判断。紧急情况请拨打当地急救电话(如 120/911)。
minimax)将结构化症状记录改写为逼真的第一人称中文来电主诉,保留全部医学信息 —— 将领域知识转化为自然语言对话素材。enable_thinking=False 直接输出分诊判断。分级分布:emergency 236 / urgent 375 / non-acute 276。
from unsloth import FastLanguageModel
import torch
model, tokenizer = FastLanguageModel.from_pretrained("Qwen/Qwen3-8B", max_seq_length=2048, load_in_4bit=True)
model.load_adapter("chenhaodev/triage-qwen3-8b-lora")
def ask(complaint: str) -> str:
text = tokenizer.apply_chat_template(
[{"role": "user", "content": complaint}],
tokenize=False, add_generation_prompt=True, enable_thinking=False,
)
enc = tokenizer(text, return_tensors="pt").to("cuda")
with torch.inference_mode():
out = model.generate(
input_ids=enc.input_ids, attention_mask=enc.attention_mask,
max_new_tokens=200, temperature=0.7, top_p=0.8, top_k=20,
)
return tokenizer.decode(out[0][enc.input_ids.shape[1]:], skip_special_tokens=True).replace("<|im_end|>", "").strip()
输出格式示例:分诊级别:紧急。疑似诊断/考虑:...。处置建议:...
仓库内 scripts/ 包含完整流水线(均为原创代码,不含源书原文):
parse_protocols.py — 三栏表格协议解析distill_all.py — 教师 API 蒸馏(症状 → 中文来电主诉)prep_train.py / train_lora.py — SFT 数据准备与 unsloth LoRA 训练build_rag.py / search_rag.py — 配套 FAISS 检索知识库无留出集评测,训练 loss 不代表效果。