Qwen3-8B ElderCare / 老年照护 LoRA

基于 Qwen3-8B 的 LoRA 微调模型,蒸馏了两本老年照护书籍的知识,用于回答关于老年疾病康复与护理、照顾年迈父母(医疗/经济/住房/法律/情感)的中文与英文问题。

来源书籍(训练数据来源,版权归原作者)

  1. 《常见老年疾病的康复与护理知识问答》(伊桂叶、路微波、陈友燕等主编,图像版 PDF,经 OCR 提取)——10 章问答,覆盖:老年病总论/康复、老年糖尿病、痛风、呼吸道疾病、高血压、心脏病、脑卒中、骨质疏松、神经与精神病、老年日常生活。
  2. **《How to Care for Aging Parents》(Virginia Morris)**——29 章照顾年迈父母指南(医疗、经济、住房、法律、情感等)。

版权说明:本仓库不含训练语料/书中原文数据(尊重来源版权)。仅发布 LoRA 适配器权重、训练脚本与卡片。

训练数据(教师模型蒸馏 + RAG 增强)

  • grounded QA:基于书中分块(chunk)生成的严格忠实原文的问答对
  • hard QA:有区分度的难题(鉴别诊断/机制/分期/用药/并发症/照护要点)
  • multihop QA:跨章综合问答(RAG 检索与融合)
  • general 对话:通用能力数据(防灾难性遗忘/泛化)
  • 各问答带来源章节标注,与 FAISS RAG 索引共享同一分块/embedding,便于检索增强。

数据量:约 4578 条对话样本。

训练方式

  • 基础模型:Qwen/Qwen3-8B,4-bit QLoRA(unsloth
  • r=16, alpha=16, use_rslora=True,目标模块:attention + MLP
  • 3 epochs,lr 2e-4 cosine,adamw_8bitmax_seq_length=1536

加载与推理

from unsloth import FastLanguageModel
import torch
model, tokenizer = FastLanguageModel.from_pretrained(
    "Qwen/Qwen3-8B", max_seq_length=1024, dtype=None, load_in_4bit=True)
model.load_adapter("chenhaodev/qwen3-8b-eldercare-lora")

def ask(q):
    msgs=[{"role":"user","content":q}]
    text=tokenizer.apply_chat_template(msgs, tokenize=False,
            add_generation_prompt=True, enable_thinking=False)
    enc=tokenizer(text, return_tensors="pt").to("cuda")
    out=model.generate(input_ids=enc.input_ids, attention_mask=enc.attention_mask,
            max_new_tokens=220, temperature=0.7, top_p=0.8)
    return tokenizer.decode(out[0][enc.input_ids.shape[1]:], skip_special_tokens=True)

print(ask("父亲80岁有糖尿病夜里总上厕所,是糖尿病引起的吗?"))

RAG

配套 FAISS 检索索引使用 BAAI/bge-small-zh-v1.5index.faiss + docs.json + doc_meta.json 见仓库 output/rag/(或附带的 search_rag.py)。

医疗免责声明

本模型输出仅用于健康科普与照护参考,不能替代专业医师的诊断与治疗建议。如有紧急或严重情况,请及时就医。

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for chenhaodev/qwen3-8b-eldercare-lora

Finetuned
Qwen/Qwen3-8B
Adapter
(2127)
this model