Instructions to use A-Kishore/phi_medical_qa_finetune_16bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use A-Kishore/phi_medical_qa_finetune_16bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("question-answering", model="A-Kishore/phi_medical_qa_finetune_16bit")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("A-Kishore/phi_medical_qa_finetune_16bit") model = AutoModelForMultimodalLM.from_pretrained("A-Kishore/phi_medical_qa_finetune_16bit") - PEFT
How to use A-Kishore/phi_medical_qa_finetune_16bit with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use A-Kishore/phi_medical_qa_finetune_16bit with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for A-Kishore/phi_medical_qa_finetune_16bit to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for A-Kishore/phi_medical_qa_finetune_16bit to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for A-Kishore/phi_medical_qa_finetune_16bit to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="A-Kishore/phi_medical_qa_finetune_16bit", max_seq_length=2048, )
phi_medical_qa_finetune_16bit
A 16-bit merged medical question-answering model fine-tuned with QLoRA on the Medical Meadow MedQA dataset.
- Developed by: A-Kishore
- Base model:
unsloth/Phi-3-mini-4k-instruct-bnb-4bit - License: Apache-2.0
- Task: Medical question answering
- Training approach: QLoRA with PEFT adapters, merged into a 16-bit checkpoint for inference
Model details
This checkpoint was trained to answer medical QA prompts in an instruction-following format. The training workflow uses the unsloth stack together with transformers, peft, trl, bitsandbytes, and datasets.
The dataset used in the notebook is medalpaca/medical_meadow_medqa, and the examples are formatted into a system/user/assistant prompt structure for supervised finetuning.
Intended use
This model is intended for educational and research purposes, and for prototyping medical QA assistants. It should not be used as a substitute for clinical judgment, diagnosis, or treatment recommendations.
Evaluation results
Evaluation was run on 1,018 examples with ROUGE metrics.
| Metric | Score |
|---|---|
| ROUGE-1 | 0.6212 |
| ROUGE-2 | 0.5815 |
| ROUGE-L | 0.6195 |
Example usage
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
model_id = "A-Kishore/phi_medical_qa_finetune_16bit"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
pipe = pipeline("question-answering", model=model, tokenizer=tokenizer)
prompt = "You are a medical AI. Answer the question clearly and concisely.\n\nQuestion: What is the most likely diagnosis for a patient with fever, rash, and migratory arthritis?"
print(pipe(prompt, max_new_tokens=128, do_sample=False)[0]["generated_text"])
Limitations
The model can produce incorrect or overconfident answers, especially for ambiguous or poorly specified prompts. Review outputs carefully, and do not rely on this model for real-world medical decisions without qualified human oversight.
- Downloads last month
- 57
Model tree for A-Kishore/phi_medical_qa_finetune_16bit
Base model
unsloth/Phi-3-mini-4k-instruct-bnb-4bitDataset used to train A-Kishore/phi_medical_qa_finetune_16bit
Evaluation results
- rouge1 on Medical Meadow MedQAself-reported0.621
- rouge2 on Medical Meadow MedQAself-reported0.582
- rougeL on Medical Meadow MedQAself-reported0.620