Downloads · 30 days
24
4% of all-time downloads
petkopetkov/Qwen2.5-0.5B-Instruct-med-diagnosis
Qwen2.5-0.5B-Instruct-med-diagnosis is a text generation model from petkopetkov. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fintuned Qwen2.5-0.5B-Instruct on a custom preprocessed dataset (petkopetkov/medical-question-answering-synthetic). It was evaluated using qualitative ranking and achieves better results than the base…
Downloads · 30 days
24
4% of all-time downloads
All-time downloads
572
Public
Parameters
494M
9.9 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors2 GB · 99%
From the Hugging Face model README
This model is a fintuned Qwen2.5-0.5B-Instruct on a custom preprocessed dataset (petkopetkov/medical-question-answering-synthetic). It was evaluated using qualitative ranking and achieves better results than the base model.
First, install the Transformers library with:
pip install -U transformers
pipeline APIfrom transformers import pipeline
import torch
system_prompt = (
"You are a medical assistant trained to provide general health information. "
"Follow these rules:\n"
"1. Only answer the question asked.\n"
"2. Do not provide any additional stories, anecdotes, or personal information.\n"
"3. Do not deviate from medical facts.\n"
"5. Do not include references/sources (papers, websites, etc.)\n"
"6. Be concise and accurate.\n\n"
""
)
prompt = "What is contact dermatitis, and what are some of the typical symptoms associated with this condition, including the type of hypersensitivity reaction that causes it?"
chat = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": prompt},
]
pipe = pipeline(
task="text-generation",
model="petkopetkov/Qwen2.5-0.5B-Instruct-med-diagnosis",
torch_dtype=torch.bfloat16,
device_map="auto",
max_new_tokens=1024,
)
response = pipe(chat)
print(response[0]["generated_text"][0])