Text Generation
Transformers
Safetensors
Vietnamese
qwen3
medical
vietnamese
qlora
fine-tuned
conversational
text-generation-inference
Instructions to use nghiaump/mda2-v23 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nghiaump/mda2-v23 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nghiaump/mda2-v23") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nghiaump/mda2-v23") model = AutoModelForCausalLM.from_pretrained("nghiaump/mda2-v23", 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 nghiaump/mda2-v23 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nghiaump/mda2-v23" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nghiaump/mda2-v23", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nghiaump/mda2-v23
- SGLang
How to use nghiaump/mda2-v23 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 "nghiaump/mda2-v23" \ --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": "nghiaump/mda2-v23", "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 "nghiaump/mda2-v23" \ --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": "nghiaump/mda2-v23", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nghiaump/mda2-v23 with Docker Model Runner:
docker model run hf.co/nghiaump/mda2-v23
MDA2-V23: Vietnamese Medical History-Taking Model
Fine-tuned Qwen3-4B-Instruct for Vietnamese medical history-taking (khai thac benh su).
Architecture
Python Orchestrator (Master) + LLM (Executor) - The model handles 6 NLP tasks while Python controls clinical logic.
Training
| Parameter | Value |
|---|---|
| Base model | Qwen/Qwen3-4B-Instruct-2507 |
| Method | QLoRA (r=64, alpha=128, NF4) |
| Training data | 52,000 examples (6 tasks) |
| Epochs | 3 |
| Batch size | 8 (grad_accum=12, effective=96) |
| Learning rate | 2e-4 |
| Seq length | 1536 |
| Hardware | H100 80GB MIG (4g.40gb) |
| Duration | 7h |
| Final avg loss | 0.187 |
6 Tasks
| Task | Count | Description |
|---|---|---|
| T1 NLG | 12,000 | Generate natural Vietnamese doctor questions |
| T2 Diagnosis | 4,000 | Clinical reasoning + differential diagnosis |
| T3 Extraction | 8,000 | Extract symptoms from patient speech |
| T4 Characterization | 10,000 | Extract OPQRST field values |
| T5 Summary | 10,000 | Medical history summarization |
| T6 Safety | 8,000 | Red flag detection + urgency assessment |
Key Features (V23 improvements)
- Think blocks: All tasks output for chain-of-thought
- KB-driven data: Real OPQRST from 1,227 edges, 870 red flags from 357 symptoms
- 8 clinical frameworks: OLDCARTS, DYSPNEA, GI, EDEMA, CONSTITUTIONAL, URINARY, SKIN, SIMPLE
- Claude API generation: T2 diagnosis uses Haiku for realistic clinical reasoning
Usage
- Downloads last month
- 5
Model tree for nghiaump/mda2-v23
Base model
Qwen/Qwen3-4B-Instruct-2507