Downloads · 30 days
6
7% of all-time downloads
Hriday75/qwen2.5-3b-infectious-disease-dpo-aligned
qwen2.5-3b-infectious-disease-dpo-aligned is a text generation model from Hriday75. Use it when you need the model to write or continue text. It is set up for peft.
This is the final, fully aligned (Phase 3) LoRA adapter for the Infectious Disease expert. While Phase 1 taught the model virology and epidemiology, and Phase 2 taught it to chat, Phase 3 utilizes Direct Preference Op…
Downloads · 30 days
6
7% of all-time downloads
All-time downloads
92
Public
Repo size
251 MB
Likes
1
Public
Click a slice to open those files.
.safetensors240 MB · 95%
From the Hugging Face model README
This is the final, fully aligned (Phase 3) LoRA adapter for the Infectious Disease expert. While Phase 1 taught the model virology and epidemiology, and Phase 2 taught it to chat, Phase 3 utilizes Direct Preference Optimization (DPO) to align the model's outputs for structural safety, factual adherence, and proper clinical formatting.
unsloth/Qwen2.5-3B-bnb-4bit (via Phase 2 Infectious Disease Chat LoRA)This model is intended to be used in high-fidelity clinical routing pipelines where structural output constraints are just as important as clinical accuracy. It is designed to heavily penalize hallucinated reasoning paths or structurally invalid medical data formatting when discussing lab results, viral loads, or infection protocols.
This adapter was aligned using the ai-galileo/clinical-notes-to-fhir dataset. This dataset acts as a preference learning corpus, providing the model with chosen (structurally valid medical outputs) and rejected (annotated structural or formatting errors) examples to learn from.
Trained using unsloth and the TRL DPOTrainer. DPO requires an extremely low learning rate to subtly shift the model's generation probabilities toward the "chosen" format without destroying the scientific knowledge learned in Phases 1 and 2.
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
# 1. Load the base model and tokenizer
base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen2.5-3B-bnb-4bit")
tokenizer = AutoTokenizer.from_pretrained("unsloth/Qwen2.5-3B-bnb-4bit")
# 2. Attach this DPO Aligned Infectious Disease Adapter
model = PeftModel.from_pretrained(base_model, "Hriday75/qwen2.5-3b-infectious-disease-dpo-aligned")
# 3. Format your chat prompt
messages = [
{"role": "system", "content": "You are a helpful, empathetic infectious disease expert."},
{"role": "user", "content": "Please review these lab results and generate a structured clinical summary regarding the patient's viral load."}
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt"
)