medictron-7B / README.md
nikitaredy's picture
Update README.md
5cc562d verified
|
Raw
History Blame
3 kB
---
base_model: BioMistral/BioMistral-7B
library_name: peft
pipeline_tag: text-generation
tags:
- base_model:adapter:BioMistral/BioMistral-7B
- lora
- sft
- transformers
- trl
- unsloth
- medical
- indian-healthcare
- multilingual
- clinical-nlp
license: mit
language:
- en
- hi
---
# BioMistral-7B Fine-Tuned on Indian Medical Data
A domain-adapted clinical LLM fine-tuned on synthetic Indian medical Q&A records using QLoRA (4-bit quantization) with Unsloth 2x speedup. Built to power the conversational AI layer of VitalKiosk β€” a contactless medical screening kiosk for senior and rural patients in India.
## Research Paper
πŸ“„ [VitalKiosk: An AI-Powered Contactless Medical Screening Kiosk with rPPG-Based Vital Sign Estimation and Conversational Clinical Guidance](https://drive.google.com/file/d/10dM-Bfl9i6Z4-cjwVtUJOuzh-CpV_Xa7/view?usp=sharing)
---
## Model Details
- **Developed by:** B. Nikita Reddy
- **Model type:** Causal LLM β€” BioMistral-7B + LoRA adapter (PEFT)
- **Languages:** English, Hindi
- **License:** MIT
- **Base model:** BioMistral/BioMistral-7B
---
## What It Does
- Generates structured treatment recommendations β€” Allopathy, Homeopathy, Home Remedy
- Supports voice input via Whisper ASR and returns spoken responses via TTS
- Feeds patient vitals and symptom data into an **XGBoost-based risk analyzer** that scores patient risk from 0–100 (Low / Moderate / High / Critical) with SHAP explainability
---
## Training Details
| Parameter | Value |
|---|---|
| Base Model | BioMistral/BioMistral-7B |
| Method | QLoRA (4-bit) + Unsloth 2x speedup |
| Dataset | 10,000 Indian medical Q&A records |
| Hardware | Kaggle T4 GPU (15.6 GB VRAM) |
| Training Time | ~9.5 hours |
| Steps / Epochs | 873 steps, 5 epochs |
| Parameters Trained | ~0.5% (LoRA only) |
| Adapter Size | 167.8 MB LoRA safetensors |
| Final Train Loss | 0.065 |
| Final Val Loss | 0.163 (target < 1.0 βœ…) |
---
## How to Use
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model = AutoModelForCausalLM.from_pretrained("BioMistral/BioMistral-7B")
model = PeftModel.from_pretrained(base_model, "YOUR_HF_USERNAME/biomistral-7b-indian-medical")
tokenizer = AutoTokenizer.from_pretrained("BioMistral/BioMistral-7B")
prompt = "Patient reports bukhar (fever) for 2 days. Suggest treatment."
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
---
## Limitations
- Not a replacement for licensed medical advice
- Optimised for Indian medical terminology β€” may underperform in other clinical contexts
- Hindi coverage may not extend to all regional dialects
- synthetic training samples β€” rare conditions may be underrepresented
---
## Contact
Nikita Reddy β€” nikitareddywork@gmail.com
### Framework Versions
- PEFT 0.18.1
- Unsloth (latest at training time)
- Transformers (latest at training time)