Downloads · 30 days
9
17% of all-time downloads
shekharp77/Mira-1
Mira-1 is a text generation model from shekharp77. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
Enterprise-grade clinical document extraction model. Fine-tuned from Qwen2.5-3B-Instruct with QLoRA to extract structured JSON from clinical documents (lab reports, discharge summaries, medication lists, pathology rep…
Downloads · 30 days
9
17% of all-time downloads
All-time downloads
53
Public
Repo size
131 MB
Likes
1
Public
Click a slice to open those files.
.safetensors120 MB · 91%
From the Hugging Face model README
Enterprise-grade clinical document extraction model. Fine-tuned from Qwen2.5-3B-Instruct with QLoRA to extract structured JSON from clinical documents (lab reports, discharge summaries, medication lists, pathology reports, intake forms, progress notes).
| Parameter | Value |
|---|---|
| Base model | Qwen/Qwen2.5-3B-Instruct |
| Method | QLoRA (4-bit, r=16, alpha=32) |
| Training data | 3,438 examples (126 curated + 3,312 Synthea-rendered) |
| Epochs | 2 |
| Final loss | 0.14 |
| GPU | Kaggle T4 (free tier) |
| Training time | ~2h 40m |
| Metric | Value |
|---|---|
| JSON validity | 98% |
| Training loss | 1.23 → 0.14 |
from peft import AutoPeftModelForCausalLM
from transformers import AutoTokenizer
model = AutoPeftModelForCausalLM.from_pretrained("shekharp77/Mira-1")
tokenizer = AutoTokenizer.from_pretrained("shekharp77/Mira-1")
messages = [
{"role": "system", "content": "You are a clinical information extraction system..."},
{"role": "user", "content": "Patient: 45/M\nHb 12.5 g/dL (13-17) LOW\nWBC 8.2 x10^9/L (4-11) Normal"},
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True)
outputs = model.generate(inputs, max_new_tokens=2048, temperature=0)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Outputs conform to this schema (10 required top-level fields):
document_type: lab_report | medication_list | discharge_summary | pathology_report | intake_form | progress_note | otherpatient: {age, sex}encounter: {date, department}vitals[], labs[], medications[], diagnoses[], procedures[], allergies[]extraction_notesApache-2.0 (same as base model)