Instructions to use MedInjection/QWEN-4B-ALL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MedInjection/QWEN-4B-ALL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MedInjection/QWEN-4B-ALL") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MedInjection/QWEN-4B-ALL") model = AutoModelForCausalLM.from_pretrained("MedInjection/QWEN-4B-ALL") 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
- vLLM
How to use MedInjection/QWEN-4B-ALL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MedInjection/QWEN-4B-ALL" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MedInjection/QWEN-4B-ALL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MedInjection/QWEN-4B-ALL
- SGLang
How to use MedInjection/QWEN-4B-ALL 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 "MedInjection/QWEN-4B-ALL" \ --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": "MedInjection/QWEN-4B-ALL", "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 "MedInjection/QWEN-4B-ALL" \ --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": "MedInjection/QWEN-4B-ALL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MedInjection/QWEN-4B-ALL with Docker Model Runner:
docker model run hf.co/MedInjection/QWEN-4B-ALL
🩺 QWEN-4B-ALL
QWEN-4B-ALL is a fine-tuned version of Qwen-4B-Instruct trained on the MedInjection-FR dataset, a French biomedical instruction corpus combining native, synthetic, and translated medical question–answer pairs.
This model was fine-tuned using Supervised Fine-Tuning (SFT) with DoRA adapters, designed to study how the origin of supervision data influences model adaptation.
🧠 Model overview
| Property | Description |
|---|---|
| Base model | Qwen3-4B-Instruct-2507 |
| Fine-tuning method | DoRA (Weight-Decomposed Low-Rank Adaptation) |
| Architecture size | ~4B parameters |
| Language | French 🇫🇷 |
| Domain | Biomedical, Clinical, Health |
| Intended use | Research on instruction tuning and domain adaptation |
| Caution | Not for clinical or diagnostic use |
⚙️ Training setup
Fine-tuning was performed on 30k multiple-choice (MCQ and MCQU) examples for each configuration, using:
- 10 epochs
- Batch size: 12
- Learning rate: 1e-4
- Gradient accumulation: 8
- Cosine scheduler with 5% warmup
- LoRA rank: 16, α = 16, dropout = 0.05
- Adapters applied to:
q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
All runs used identical hyperparameters to isolate the effect of data provenance.
📊 Evaluation summary
Evaluation was conducted on French biomedical benchmarks (MCQ, MCQU, OEQ).
Metrics include Exact Match (EM) and Hamming Score for multiple-choice tasks, and BLEU/ROUGE/BERTScore + LLM-as-a-judge for open-ended QA.
See MedInjection-FR GitHub for full results and plots.
📚 Citation
If you use this model, please cite:
@misc{belmadani2026medinjectionfrexploringrolenative,
title={MedInjection-FR: Exploring the Role of Native, Synthetic, and Translated Data in Biomedical Instruction Tuning},
author={Ikram Belmadani and Oumaima El Khettari and Pacôme Constant dit Beaufils and Benoit Favre and Richard Dufour},
year={2026},
eprint={2603.06905},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2603.06905},
}
- Downloads last month
- 9
Model tree for MedInjection/QWEN-4B-ALL
Base model
Qwen/Qwen3-4B-Instruct-2507