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.

Usage

First, install the Transformers library with:

pip install -U transformers

Run with the pipeline API

from 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])
Downloads last month
17
Safetensors
Model size
494M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for petkopetkov/Qwen2.5-0.5B-Instruct-med-diagnosis

Base model

Qwen/Qwen2.5-0.5B
Finetuned
(339)
this model
Finetunes
1 model

Dataset used to train petkopetkov/Qwen2.5-0.5B-Instruct-med-diagnosis

Collection including petkopetkov/Qwen2.5-0.5B-Instruct-med-diagnosis