Downloads ยท 30 days
0
Machlovi/Phi4_MedQA_USMLE_4_Options
Phi4_MedQA_USMLE_4_Options is a text classification model from Machlovi. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
This is the model card of a ๐ค transformers model that has been pushed on the Hub. This model card has been automatically generated.
Downloads ยท 30 days
0
Access
Public
Updated Mar 12, 2025
Repo size
1.4 GB
Likes
0
Public
Click a slice to open those files.
.safetensors131 MB ยท 100%
From the Hugging Face model README
This is the model card of a ๐ค transformers model that has been pushed on the Hub. This model card has been automatically generated.
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
This model is fine-tuned using LoRA (PEFT) on Phi-4 (4-bit Unsloth). To use it, you need to:
Before running the code, make sure you have the necessary dependencies installed:
pip install unsloth peft transformers torch
from unsloth import FastLanguageModel
from peft import PeftModel
import torch
# Load the base model
base_model_name = "unsloth/Phi-4-unsloth-bnb-4bit"
model, tokenizer = FastLanguageModel.from_pretrained(
model_name=base_model_name,
max_seq_length=4096, # Must match fine-tuning
load_in_4bit=True,
)
# Load the fine-tuned LoRA adapter
lora_model_name = "Machlovi/Phi4_MedQA_USMLE_4_Options"
model = PeftModel.from_pretrained(model, lora_model_name)
# Run inference
input_text = "What are the symptoms of a heart attack?"
inputs = tokenizer(input_text, return_tensors="pt").to("cuda")
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=100)
# Decode and print response
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
max_seq_length matches the training configuration.[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
medmcqa = """< |im_start| > system
You are a medical doctor answering real-world medical entrance exam questions.
Based on your understanding of basic and clinical science, medical knowledge, and mechanisms underlying health, disease,
patient care, and modes of therapy, answer the following multiplechoice question.
Select one correct answer from A to D. Base your answer on the current and standard practices referenced in medical guidelines. < |im_end| >
< |im_start| >
question: {}
options:{}
< |im_end| >
< |im_start| >
answer:{}
< |im_start| > system
You are a medical doctor answering real-world medical entrance exam questions.
Based on your understanding of basic and clinical science, medical knowledge, and mechanisms underlying health, disease,
patient care, and modes of therapy, answer the following multiple-choice question.
Select one correct answer from A to D. Base your answer on the current and standard practices referenced in medical guidelines.
< |im_end| >
< |im_start| >
question: A junior orthopaedic surgery resident is completing a carpal tunnel repair with the department chairman as the attending physician.
During the case, the resident inadvertently cuts a flexor tendon. The tendon is repaired without complication.
The attending tells the resident that the patient will do fine, and there is no need to report this minor complication that will not harm the patient,
as he does not want to make the patient worry unnecessarily. He tells the resident to leave this complication out of the operative report.
Which of the following is the correct next action for the resident to take?
options:
A. Disclose the error to the patient and put it in the operative report
B. Tell the attending that he cannot fail to disclose this mistake
C. Report the physician to the ethics committee
D. Refuse to dictate the operative report
< |im_end| >
< |im_start| >
answer: B. Tell the attending that he cannot fail to disclose this mistake
< |im_end| >
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]