Downloads · 30 days
0
anjaneya-javvadi/phi3-medical-qlora
phi3-medical-qlora is a question answering model from anjaneya-javvadi. Use it when the input is a question plus a passage. It is set up for transformers. The card lists the license as agpl-3.0.
This model is a domain-adapted version of Microsoft's Phi-3 Mini 4K Instruct model, fine-tuned on medical question-answer pairs using QLoRA (Quantized Low-Rank Adaptation).
Downloads · 30 days
0
Access
Public
Updated Jun 2, 2026
Repo size
202 MB
Likes
1
Public
Click a slice to open those files.
.safetensors201 MB · 98%
From the Hugging Face model README
This model is a domain-adapted version of Microsoft's Phi-3 Mini 4K Instruct model, fine-tuned on medical question-answer pairs using QLoRA (Quantized Low-Rank Adaptation).
The goal of this project is to improve the model's ability to generate accurate and contextually relevant medical responses while maintaining the efficiency of parameter-efficient fine-tuning.
Training was performed using:
Each example was formatted as:
Evaluation was performed on a held-out validation set.
| Model | Perplexity |
|---|---|
| Base Phi-3 Mini | 4.0056 |
| Fine-Tuned Model | 1.8500 |
Improvement:
| Model | ROUGE-L |
|---|---|
| Base Phi-3 Mini | 0.1731 |
| Fine-Tuned Model | 0.3060 |
Improvement:
| Model | BERTScore F1 |
|---|---|
| Base Phi-3 Mini | 0.8250 |
| Fine-Tuned Model | 0.8436 |
from transformers import AutoModelForCausalLM, AutoTokenizer from peft import PeftModel
BASE_MODEL = "microsoft/Phi-3-mini-4k-instruct"
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
base_model = AutoModelForCausalLM.from_pretrained( BASE_MODEL )
model = PeftModel.from_pretrained( base_model, "YOUR_USERNAME/phi3-medical-qlora" )
prompt = """
What are the symptoms of diabetes?
"""
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate( **inputs, max_new_tokens=150 )
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
This model is not a medical device and should not be used for diagnosis, treatment, or clinical decision-making.
Javvadi Naga Venkata Anjaneya Prasad