File size: 3,628 Bytes
0cf00c2 083a784 0cf00c2 083a784 0cf00c2 083a784 0cf00c2 083a784 0cf00c2 083a784 0cf00c2 083a784 0cf00c2 083a784 0cf00c2 9a60cc0 0cf00c2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
---
base_model: unsloth/Qwen2.5-0.5B-Instruct
library_name: peft
pipeline_tag: text-generation
tags:
- base_model:adapter:unsloth/Qwen2.5-0.5B-Instruct
- lora
- sft
- transformers
- trl
- unsloth
license: mit
datasets:
- gretelai/symptom_to_diagnosis
language:
- en
---
# Model Card for Model ID
## Model Details
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.
## Uses
### Direct Use
Primary Use Cases:
- Assisting medical students in practicing diagnostic reasoning.
- Providing clinicians or educators with a tool for generating potential diagnostic hypotheses from symptom descriptions.
- Serving as a base model for research in AI-based clinical decision support systems.
### Out-of-Scope Use
- Direct clinical diagnosis or patient self-assessment.
- Medical decision-making without oversight from qualified professionals.
- Use in high-stakes environments where erroneous diagnosis could result in harm.
## Bias, Risks, and Limitations
- Small Dataset: With just over 1,000 examples, the model may not generalize well to rare, atypical, or unseen symptom presentations.
- Imbalanced Labels: Some diagnoses (e.g., jaundice, migraine) are under-represented, which may bias outputs toward more frequent classes.
- Synthetic Language: Symptom descriptions are LLM-generated—not actual patient narratives—and may lack real-world variability or nuance.
- Not a Diagnostic Tool: This model is intended for research and educational augmentation only. It should not replace professional medical evaluation or diagnostic workflows.
## How to Get Started with the Model
Use the code below to get started with the model.
```python
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:**
```python
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)
```
### Framework versions
- PEFT 0.17.1 |