Downloads · 30 days
6
1% of all-time downloads
integration1857/prescription-simplifier-mistral7b
prescription-simplifier-mistral7b is a text generation model from integration1857. Use it when you need the model to write or continue text. It is set up for transformers.
A fine-tuned version of Mistral-7B-Instruct-v0.3, trained to convert complex medical prescriptions into simple, patient-friendly explanations. Fine-tuned using QLoRA on Kaggle T4×2 GPUs with 8 hand-crafted prescriptio…
Downloads · 30 days
6
1% of all-time downloads
All-time downloads
1.2K
Public
Parameters
7.2B
14.5 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors14.5 GB · 100%
From the Hugging Face model README
A fine-tuned version of Mistral-7B-Instruct-v0.3, trained to convert complex medical prescriptions into simple, patient-friendly explanations. Fine-tuned using QLoRA on Kaggle T4×2 GPUs with 8 hand-crafted prescription→explanation training examples covering Amoxicillin, Metformin, Lisinopril, Atorvastatin, Salbutamol, Sertraline, Warfarin, and Pantoprazole.
This model is designed to convert complex medical prescription text into simple, plain-language explanations for patients. It can be used directly via the HuggingFace Inference API or integrated into healthcare applications, pharmacy portals, or patient-facing tools.
Can be fine-tuned further on larger prescription datasets for improved accuracy. Can be integrated into hospital information systems, pharmacy apps, or telemedicine platforms to improve patient health literacy.
This model is NOT intended for clinical decision-making, medical diagnosis, or treatment recommendations. It should not replace professional medical advice. Not suitable for prescriptions in languages other than English.
Trained on only 8 examples — limited coverage of drug types and medical conditions May produce inaccurate explanations for uncommon medications Does not account for patient-specific factors such as allergies or drug interactions English only — not suitable for multilingual use cases Should always be used alongside professional medical guidance
Always display a medical disclaimer alongside model outputs. Never use this model as a substitute for pharmacist or physician consultation. Outputs should be reviewed by a healthcare professional before deployment in clinical settings.
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
from transformers import AutoModelForCausalLM, AutoTokenizer import torch
model_id = "integration1857/prescription-simplifier-mistral7b"
tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained( model_id, torch_dtype=torch.float16, device_map="auto" )
prompt = """[INST] Convert this prescription into patient-friendly language: Amoxicillin 500mg TID x 7 days [/INST]"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device) outputs = model.generate(**inputs, max_new_tokens=300, temperature=0.3) print(tokenizer.decode(outputs[0], skip_special_tokens=True))
8 hand-crafted prescription→explanation pairs covering: Amoxicillin, Metformin, Lisinopril, Atorvastatin, Salbutamol, Sertraline, Warfarin, and Pantoprazole. Each example follows the Mistral [INST]...[/INST] instruction format.
Prescriptions formatted using Mistral instruct template. Tokenized using the Mistral-7B-v0.3 tokenizer with a maximum sequence length of 512 tokens.
bf16 mixed precision LoRA rank (r): 16 LoRA alpha: 32 LoRA dropout: 0.05 Target modules: q_proj, v_proj, k_proj, o_proj Batch size: 2 Gradient accumulation steps: 4 Learning rate: 2e-4 Epochs: 3 Optimizer: paged_adamw_32bit
Training time: 4.6 minutes Hardware: Kaggle T4×2 GPUs (16GB VRAM each) Trainable parameters: 41.94M (1.11% of 3.78B total) Base model size: ~14GB (fp16)
Held-out prescription examples not seen during training, covering similar drug categories.
Evaluated on clarity of explanation, accuracy of dosage instructions, and completeness of warnings.
ROUGE-1 score used to measure overlap between generated explanations and reference explanations.
ROUGE-1: 0.51 Training loss: 1.78
The model achieves reasonable performance on the prescription simplification task given the very small training set. A larger, more diverse dataset would significantly improve generalisation.
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
Based on Mistral-7B-Instruct-v0.3 (decoder-only transformer). Fine-tuned with QLoRA — 4-bit NF4 quantization via bitsandbytes with LoRA adapter layers injected into attention modules. Objective: causal language modelling on prescription→explanation pairs.
Kaggle Notebooks — free tier T4×2 GPU environment.
2× NVIDIA Tesla T4 (16GB VRAM each)
transformers, peft, trl, bitsandbytes, accelerate, torch 2.0
BibTeX:
@misc{prescription-simplifier-2025, author = {integration1857}, title = {Prescription Simplifier — Mistral-7B Fine-tuned for Patient-Friendly Medical Explanations}, year = {2025}, publisher = {HuggingFace}, url = {https://huggingface.co/integration1857/prescription-simplifier-mistral7b} }
APA:
integration1857. (2025).Prescription Simplifier — Mistral-7B Fine-tuned for Patient-Friendly Medical Explanations. HuggingFace. https://huggingface.co/integration1857/prescription-simplifier-mistral7b
https://medium.com/p/49e94536f72b
Madhukar Kumar
Via HuggingFace profile: https://huggingface.co/integration1857