Instructions to use rwang220/Yida-Model-14B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rwang220/Yida-Model-14B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rwang220/Yida-Model-14B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("rwang220/Yida-Model-14B") model = AutoModelForCausalLM.from_pretrained("rwang220/Yida-Model-14B", device_map="auto") 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 rwang220/Yida-Model-14B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rwang220/Yida-Model-14B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rwang220/Yida-Model-14B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rwang220/Yida-Model-14B
- SGLang
How to use rwang220/Yida-Model-14B 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 "rwang220/Yida-Model-14B" \ --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": "rwang220/Yida-Model-14B", "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 "rwang220/Yida-Model-14B" \ --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": "rwang220/Yida-Model-14B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use rwang220/Yida-Model-14B with Docker Model Runner:
docker model run hf.co/rwang220/Yida-Model-14B
Yida-Model-14B
Yida-Model-14B is a merged full-weight checkpoint of Qwen/Qwen3-14B after LoRA supervised fine-tuning on an internal Chinese medical instruction mix. The Hub files are the merged bfloat16 weights (not a PEFT adapter).
This model is for research and engineering evaluation. It is not a medical device and must not be used as the sole basis for clinical decisions.
Model Details
- Developed by: rwang220
- Model type: Causal language model (
Qwen3ForCausalLM) - Parameters: 14.77B (14,768,307,200)
- Precision: bfloat16
- Architecture: 40 layers, hidden size 5120, GQA 40/8, intermediate size 17408, vocab 151936
- Context:
max_position_embeddingsis 40,960. RoPE isdefault(no YaRN in this checkpoint). Tokenizermodel_max_lengthis 131,072; SFT used 8,192. - Chat template: Qwen3 thinking / tool-calling Jinja template (
chat_template.jinja) - Language(s): Chinese and English (training mix is primarily Chinese medical tasks)
- License: Apache 2.0, inherited from Qwen3-14B
Training
Fine-tuned with ms-swift LoRA, then merged into full weights. Training code is not published.
| Item | Value |
|---|---|
| Base model | Qwen/Qwen3-14B |
| Framework | ms-swift 4.0.2, PEFT 0.18.0, transformers 5.3.0.dev0, torch 2.9.0+cu128 |
| Hardware | 4 GPUs, DDP |
| Run | all_14b_9.4/v0-20260904-061558 |
| Start / end | 2026-09-04 06:16 → 2026-09-09 19:02 |
| LoRA | rank 16, alpha 32, dropout 0.05, targets q/k/v/o/gate/up/down_proj |
| Optim | fused AdamW, lr 1e-4, cosine, warmup ratio 0.05, weight decay 0.1 |
| Schedule | 4 epochs, 47,384 steps, max length 8192 |
| Batch | per-device 1, grad accum 8 (global batch 32) |
| Final train loss | 0.5922 |
| Final eval loss | 0.5709, token acc 0.8124 |
| Last / best ckpt | checkpoint-47384 |
| Merge | 6 safetensor shards (max_shard_size=5GB) |
Data
Internal medical SFT mix (merged_scores_v4_three_models_score5 / prefix-optimized CoT). Most categories were capped at 10,000 samples; MedSafety and MedEthics at 30,000. Validation used 10,000 held-out samples.
Included task families (names from the training registry): CMB-Clin-extended, MedAnalysis, MedCare, MedChartQC, MedDiag, MedDiffer, MedEthics, MedExam, MedExplain, MedHC, MedHG, MedInsureCalc, MedInsureCheck, MedLitQA, MedMC, MedOutcome, MedPHM, MedPathQC, MedPopular, MedPrimary, MedPsychCare, MedPsychQA, MedRecordGen, MedRehab, MedReportQC, MedRxCheck, MedRxPlan, MedSafety, MedSpeQA, MedSummary, MedSynonym, MedTeach, MedTerm, MedTreat, SMDoc.
How to Use
Requires a recent transformers with Qwen3 support (the export was written by transformers 5.5.0).
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "rwang220/Yida-Model-14B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto",
)
messages = [{"role": "user", "content": "请用通俗语言解释高血压的常见注意事项。"}]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=True,
)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=1024, temperature=0.6, top_p=0.95, top_k=20)
print(tokenizer.decode(output[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
vLLM:
vllm serve rwang220/Yida-Model-14B --reasoning-parser qwen3
Default sampling in generation_config.json: temperature 0.6, top_p 0.95, top_k 20.
Set enable_thinking=False in apply_chat_template for the non-thinking path.
Files
model-00001-of-00006.safetensors…model-00006-of-00006.safetensorsmodel.safetensors.index.jsonconfig.json,generation_config.jsontokenizer.json,tokenizer_config.json,vocab.json,merges.txtchat_template.jinjaLICENSE(Apache-2.0)
Total Hub payload is about 27.5 GiB (~29.5 GB): six bf16 shards plus tokenizer and card files.
Intended Use and Limitations
Intended for research on Chinese medical dialogue, chart/report drafting, and related NLP prototypes.
Limitations:
- Can hallucinate guidelines, doses, diagnoses, and citations.
- Training data is internal and not fully documented here.
- Evaluation in this card is training/eval loss only; no public clinical benchmark is claimed.
- Outputs may mix thinking traces (
<think>…</think>) with the final answer.
Citation
@misc{yida-model-14b,
title = {Yida-Model-14B},
author = {Wang, Rui},
year = {2026},
howpublished = {\url{https://huggingface.co/rwang220/Yida-Model-14B}},
note = {Code and docs: https://github.com/rwang220/yida_model}
}
Also cite Qwen3.
- Downloads last month
- 432