Instructions to use yushan7kokomi/SilverCareAI-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yushan7kokomi/SilverCareAI-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yushan7kokomi/SilverCareAI-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("yushan7kokomi/SilverCareAI-7B") model = AutoModelForCausalLM.from_pretrained("yushan7kokomi/SilverCareAI-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yushan7kokomi/SilverCareAI-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yushan7kokomi/SilverCareAI-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yushan7kokomi/SilverCareAI-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yushan7kokomi/SilverCareAI-7B
- SGLang
How to use yushan7kokomi/SilverCareAI-7B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "yushan7kokomi/SilverCareAI-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yushan7kokomi/SilverCareAI-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "yushan7kokomi/SilverCareAI-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yushan7kokomi/SilverCareAI-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yushan7kokomi/SilverCareAI-7B with Docker Model Runner:
docker model run hf.co/yushan7kokomi/SilverCareAI-7B
SilverCareAI-7B
SilverCareAI-7B 是一个基于 deepseek-ai/DeepSeek-R1-Distill-Qwen-7B 的中文医疗对话模型,专为老年人健康评估与慢病管理场景设计。模型使用 Huatuo26M-Lite 中的问诊数据进行微调,具备输出规范医疗建议、风险分析与健康评分的能力。
用于本人大创项目《智护银龄》,分享出来旨在交流学习。
🧠 模型特色
- 🔍 精调于老年健康问诊场景,关注高血压、糖尿病、心脏病等慢病管理
- 📊 可根据自然语言问题生成诊疗建议
- 💡 基于 Qwen 7B distilled 模型,推理高效,资源占用小
🧪 使用示例
from transformers import AutoTokenizer, AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("yushan7kokomi/SilverCareAI-7B", device_map="auto", torch_dtype="auto")
tokenizer = AutoTokenizer.from_pretrained("yushan7kokomi/SilverCareAI-7B")
prompt = "请根据以下描述判断健康状况:患者,女,72岁,长期患有糖尿病,近一个月血糖控制不佳,空腹血糖为8.5mmol/L,伴有乏力与视力模糊。"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
🧑🏫 微调参数
微调工具:LLaMA-Factory (llamafactory-cli)
微调方式:LoRA(adapter 插入)
模板格式:deepseekr1
数据集:Huatuo26M-Lite
模型基座:deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
训练设备:NVIDIA RTX 4090 x 1
数据最大样本数:100,000 条
epoch 数:2
最大输入长度:1024
batch size:2(梯度累计 steps=16)
优化器:adamw_torch
学习率:2e-5
学习率调度器:cosine
LoRA 参数:
rank: 8
alpha: 32
dropout: 0.05
target: all
使用 bf16 精度训练
验证集比例:1%
每 1000 步保存与评估一次
🛠 模型用途
本模型可用于以下任务:
老年人健康状况分析
医疗问诊助手对话生成
健康评分与风险评估生成
医疗自然语言理解与生成研究
🚫 使用限制
本模型仅供研究与非商业用途使用,不具备医疗诊断资质,禁止用于实际临床决策支持系统。使用者需遵守 Apache-2.0 开源协议及相关法律法规。
- Downloads last month
- 4