CoolFace
Modelpublic

NayanPal/truthtriage-llama2-7b

sourceHugging Faceapache-2.0updated 7mo agoView on Hugging Face
0likes9downloads
Model Card

TruthTriage โ€“ Safety-Tuned Medical Assistant (LoRA)

๐Ÿฉบ Overview

TruthTriage is a safety-aligned medical assistant fine-tuned to:

  • โ€”Analyze pharmaceutical safety queries
  • โ€”Classify risk levels (Low / Moderate / High)
  • โ€”Provide structured, grounded responses
  • โ€”Avoid hallucinated medical advice
  • โ€”Escalate emergency scenarios appropriately

This model is a LoRA adapter built on top of:

Base Model: unsloth/llama-2-7b-bnb-4bit


๐Ÿง  Fine-Tuning Details

  • โ€”Method: LoRA (Low-Rank Adaptation)
  • โ€”Quantization: 4-bit
  • โ€”Framework: Unsloth + TRL SFTTrainer
  • โ€”GPU: Tesla T4
  • โ€”Trainable Parameters: ~0.3% of total model
  • โ€”Training Samples: 662

๐Ÿ“Š Dataset Overview

Dataset: TruthTriage Safety-Tuned Medical Dataset

Total Examples: 662

This dataset was designed and curated by our team specifically for safety-aligned medical AI fine-tuning.

๐Ÿ”น Dataset Composition

SourceCount
ChatDoctor (Reformatted & Structured)500
Refusal (High-Risk Queries)20
Clarification โ€” Ask20
Clarification โ€” Answer20
Escalation (Emergency Cases)20
General Knowledge20
Out of Scope20
Identity / System Persona20
No Source Found22
Total662

๐Ÿ›ก๏ธ Safety Design

The dataset explicitly teaches:

  • โ€”Controlled refusal for unsafe requests
  • โ€”Emergency escalation behavior
  • โ€”Clarification when information is missing
  • โ€”Identity transparency
  • โ€”Handling out-of-scope questions
  • โ€”Risk-level classification

Tone Strategy

SituationEmoji
Danger / Disclaimer๐Ÿ’€
Out of Scope (Light Tone)๐ŸŒš
Serious Cases (Refusal / Clarification / Identity)None

๐Ÿš€ How to Use

python
from unsloth import FastLanguageModel

# Load base model
model, tokenizer = FastLanguageModel.from_pretrained(
    "unsloth/llama-2-7b-bnb-4bit",
    load_in_4bit=True,
)

# Load TruthTriage adapter
model.load_adapter("NayanPal/truthtriage-llama2-7b")

# Inference
FastLanguageModel.for_inference(model)

inputs = tokenizer("Can I take Ibuprofen with Warfarin?", return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=200)

print(tokenizer.decode(outputs[0], skip_special_tokens=True))