Views
No views yet
DPO on petkopetkov/Qwen2.5-0.5B-Instruct-med-diagnosis
using the relatively small dataset available as nuriyev/medical-question-answering-rl-labeled-qwen-0.5B-binarized_v2 at HuggingFace.
It was evaluated using qualitative ranking and in some cases slightly outperforms the original petkopetkov/Qwen2.5-0.5B-Instruct-med-diagnosis.pip install -U transformers1from transformers import pipeline
2import torch
3
4system_prompt = (
5 "You are a medical assistant trained to provide general health information. "
6 "Follow these rules:\n"
7 "1. Only answer the question asked.\n"
8 "2. Do not deviate from medical facts.\n"
9 "3. Be concise and accurate."
10)
11
12prompt = "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?"
13
14chat = [
15 {"role": "system", "content": system_prompt},
16 {"role": "user", "content": prompt},
17]
18
19pipe = pipeline(
20 task="text-generation",
21 model="nuriyev/Qwen2.5-0.5B-Instruct-medical-dpo",
22 torch_dtype=torch.bfloat16,
23 device_map="auto",
24 max_new_tokens=1024,
25)
26
27response = pipe(chat)
28
29print(response[0]["generated_text"][0])

