Given a clinical multiple-choice question with 4 options,
the model selects the correct answer and explains its reasoning.
Example input:
### Question:
First-line treatment for hypertensive emergency?
### Options:
A) Oral amlodipine
B) IV labetalol or IV nitroprusside
C) Sublingual nifedipine
D) IM hydralazine
### Answer:
Example output:
B) IV labetalol or IV nitroprusside
Explanation:
Hypertensive emergencies require immediate IV therapy.
Labetalol is a combined alpha and beta blocker that rapidly
reduces blood pressure safely. Nitroprusside is a vasodilator
used when faster or more precise control is needed.
How to Use
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
BASE_MODEL = "Qwen/Qwen3-1.7B"
ADAPTER_REPO = "HK2184/medqa-qwen3-lora"
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL, trust_remote_code=True)
tokenizer.pad_token = tokenizer.eos_token
tokenizer.padding_side = "left"
base = AutoModelForCausalLM.from_pretrained(
BASE_MODEL,
dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
model = PeftModel.from_pretrained(base, ADAPTER_REPO)
model = model.merge_and_unload()
model.eval()
prompt = """### Question:
First-line treatment for hypertensive emergency?
### Options:
A) Oral amlodipine
B) IV labetalol or IV nitroprusside
C) Sublingual nifedipine
D) IM hydralazine
### Answer:
"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
out = model.generate(
**inputs,
max_new_tokens=200,
do_sample=True,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.3,
pad_token_id=tokenizer.eos_token_id,
)
new = out[0][inputs["input_ids"].shape[-1]:]
print(tokenizer.decode(new, skip_special_tokens=True))
Trained entirely on AMD hardware using ROCm 7.2.
Key insight: bfloat16 is stable on MI300X — fp16 caused
gradient norm explosion (nan) during LoRA training.
medqa-qwen3-lora huggingface.co is an AI model on huggingface.co that provides medqa-qwen3-lora's model effect (), which can be used instantly with this lablab-ai-amd-developer-hackathon medqa-qwen3-lora model. huggingface.co supports a free trial of the medqa-qwen3-lora model, and also provides paid use of the medqa-qwen3-lora. Support call medqa-qwen3-lora model through api, including Node.js, Python, http.
medqa-qwen3-lora huggingface.co is an online trial and call api platform, which integrates medqa-qwen3-lora's modeling effects, including api services, and provides a free online trial of medqa-qwen3-lora, you can try medqa-qwen3-lora online for free by clicking the link below.
lablab-ai-amd-developer-hackathon medqa-qwen3-lora online free url in huggingface.co:
medqa-qwen3-lora is an open source model from GitHub that offers a free installation service, and any user can find medqa-qwen3-lora on GitHub to install. At the same time, huggingface.co provides the effect of medqa-qwen3-lora install, users can directly use medqa-qwen3-lora installed effect in huggingface.co for debugging and trial. It also supports api for free installation.