Instructions to use Udit013/qwen2.5-7b-medmcqa-qlora-5k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Udit013/qwen2.5-7b-medmcqa-qlora-5k with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct") model = PeftModel.from_pretrained(base_model, "Udit013/qwen2.5-7b-medmcqa-qlora-5k") - Notebooks
- Google Colab
- Kaggle
Qwen2.5-7B-Instruct — MedMCQA QLoRA adapter (5K)
A 4-bit QLoRA adapter for Qwen/Qwen2.5-7B-Instruct, fine-tuned on MedMCQA as
one point of a data-scaling study of when parameter-efficient domain
fine-tuning helps an already-strong instruction-tuned LLM. Powers the RAG
assistant at https://github.com/Udit013/biomed-llm-peft
(live demo: https://huggingface.co/spaces/Udit013/biomed-assistant).
⚠️ Intended use & limitation
Research and education only. Must NOT be used for real clinical decisions, diagnosis, or treatment. Outputs are uncalibrated and may be confidently wrong.
Training
- Base model: Qwen/Qwen2.5-7B-Instruct
- Method: 4-bit QLoRA (nf4, double quant), LoRA r=16, alpha=32, dropout=0.05
- Trainable params: 40,370,176 / 4,393,342,464 (0.918894%)
- Data: MedMCQA, N=5000 (seeded subsample), 1 epoch
- Seed: 42 · LR: 0.0002 · eff. batch = 1×16
- Final train loss: 0.868
Evaluation (EleutherAI lm-evaluation-harness, matched 200-item subsample)
| Model | MedMCQA (in-domain) | PubMedQA (out-of-domain) |
|---|---|---|
| Base 0-shot | 47.5 | 48.0 |
| QLoRA 5K | 50.0 | 64.5 |
In-domain is flat (within noise) — strong instruction tuning already near-saturates MedMCQA; the OOD gain is likely an answer-selection/format effect, not new knowledge. See the repo for the full methodology and honest write-up.
Usage
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct", device_map="auto", load_in_4bit=True)
model = PeftModel.from_pretrained(base, "Udit013/qwen2.5-7b-medmcqa-qlora-5k")
tok = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-7B-Instruct")
- Downloads last month
- 28
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct") model = PeftModel.from_pretrained(base_model, "Udit013/qwen2.5-7b-medmcqa-qlora-5k")