Model Card for Medical-QA

Model Details

This model is a fine-tuned version of Qwen3-0.6B on a 34K medical Q&A dataset derived from the Anki Medical Curriculum flashcards. It is designed to assist with medical education and exam preparation, offering concise and contextually relevant answers to short medical questions.

  • Base Model: Qwen3-0.6B
  • Fine-tuned on: 34,000 question-answer pairs
  • Domain: Medicine & Medical Education
  • Languages: English
  • License: MIT

Uses

Direct Use

  • Primary use case: Medical Q&A for students, exam preparation, and knowledge review.
  • Suitable for interactive learning assistants or educational chatbots.
  • Not intended for real-world clinical decision-making or replacing professional medical advice.

Bias, Risks, and Limitations

  • The model’s knowledge is constrained to the dataset scope (flashcard-style Q&A).
  • Responses are short and exam-style rather than detailed clinical explanations.
  • Should not be relied upon for actual patient care, treatment decisions, or emergency use.

How to Get Started with the Model

Use the code below to get started with the model.

from huggingface_hub import login
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel


tokenizer = AutoTokenizer.from_pretrained("unsloth/Qwen3-0.6B",)
base_model = AutoModelForCausalLM.from_pretrained(
    "unsloth/Qwen3-0.6B",
    device_map={"": 0}
)

model = PeftModel.from_pretrained(base_model,"khazarai/Medical-QA")

system = "Answer this question truthfully"

question = """
What can β-blockers cause or exacerbate due to excessive AV nodal inhibition?
"""

messages = [
    {"role" : "system", "content" : system},
    {"role" : "user",   "content" : question}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize = False,
    add_generation_prompt = True, 
    enable_thinking = False,
)

from transformers import TextStreamer
_ = model.generate(
    **tokenizer(text, return_tensors = "pt").to("cuda"),
    max_new_tokens = 512,
    temperature = 0.7,
    top_p = 0.8,
    top_k = 20,
    streamer = TextStreamer(tokenizer, skip_prompt = True),
)

For pipeline:

from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

tokenizer = AutoTokenizer.from_pretrained("unsloth/Qwen3-0.6B")
base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen3-0.6B")
model = PeftModel.from_pretrained(base_model, "khazarai/Medical-QA")

system = "Answer this question truthfully"

question = """
What can β-blockers cause or exacerbate due to excessive AV nodal inhibition?
"""

pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
messages = [
    {"role": "system", "content": system}
    {"role": "user", "content": question}
]

pipe(messages)

Training Details

Training Data

The dataset is based on Anki Medical Curriculum flashcards, created and updated by medical students. These flashcards cover the entire medical curriculum, including but not limited to:

  • Anatomy
  • Physiology
  • Pathology
  • Pharmacology
  • Clinical knowledge and skills

The flashcards typically provide succinct summaries and mnemonics to support learning and retention.

Framework versions

  • PEFT 0.15.2
Downloads last month
14
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for khazarai/Medical-QA

Finetuned
Qwen/Qwen3-0.6B
Finetuned
unsloth/Qwen3-0.6B
Adapter
(10)
this model

Dataset used to train khazarai/Medical-QA

Collection including khazarai/Medical-QA