Downloads · 30 days
3
4% of all-time downloads
Hriday75/qwen2.5-3b-cardio-dpo-aligned
qwen2.5-3b-cardio-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 Cardiology expert. While Phase 1 taught the model cardiology science and Phase 2 taught it to chat, Phase 3 utilizes Direct Preference Optimization (DPO)…
Downloads · 30 days
3
4% of all-time downloads
All-time downloads
80
Public
Repo size
251 MB
Likes
0
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 Cardiology expert. While Phase 1 taught the model cardiology science 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 Cardiology 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.
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 Cardiology Adapter
model = PeftModel.from_pretrained(base_model, "Hriday75/qwen2.5-3b-cardio-dpo-aligned")
# 3. Format your chat prompt
messages = [
{"role": "system", "content": "You are a helpful, empathetic cardiology expert."},
{"role": "user", "content": "Please format the patient's recent Holter monitor results into a structured summary."}
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt"
)