SFT
Collection
Supervised fine-tuning
•
10 items
•
Updated
•
1
SympQwen-0.5B is a fine-tuned variant of the Qwen2.5-0.5B-Instruct language model—adapted specifically for the task of medical symptom-to-diagnosis mapping. It is trained to generate plausible diagnoses from patient-like descriptions of symptoms, based on the labeled examples from the gretelai/symptom_to_diagnosis dataset. This makes it suitable for assisting with clinical symptom interpretation in research or educational settings.
Primary Use Cases:
Use the code below to get started with the model.
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
tokenizer = AutoTokenizer.from_pretrained("unsloth/Qwen2.5-0.5B-Instruct",)
base_model = AutoModelForCausalLM.from_pretrained(
"unsloth/Qwen2.5-0.5B-Instruct",
device_map={"": 0}
)
model = PeftModel.from_pretrained(base_model,"khazarai/SympQwen-0.5B")
question = "I have a rash on my skin that is itchy and has a different color than the rest of my skin. I also have some firm pimples or breakouts on my skin."
messages = [
{"role" : "user", "content" : question}
]
text = tokenizer.apply_chat_template(
messages,
tokenize = False,
add_generation_prompt = True,
)
from transformers import TextStreamer
_ = model.generate(
**tokenizer(text, return_tensors = "pt").to("cuda"),
max_new_tokens = 512,
streamer = TextStreamer(tokenizer, skip_prompt = True),
)
For pipeline:
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
tokenizer = AutoTokenizer.from_pretrained("unsloth/Qwen2.5-0.5B-Instruct")
base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen2.5-0.5B-Instruct")
model = PeftModel.from_pretrained(base_model, "khazarai/SympQwen-0.5B")
question = "I have a rash on my skin that is itchy and has a different color than the rest of my skin. I also have some firm pimples or breakouts on my skin."
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
messages = [
{"role": "user", "content": question}
]
pipe(messages)
Base model
Qwen/Qwen2.5-0.5B