Downloads · 30 days
6
32% of all-time downloads
wilsonl/medichat-flan-t5-base-lora
medichat-flan-t5-base-lora is a machine learning model from wilsonl. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft.
Downloads · 30 days
6
32% of all-time downloads
All-time downloads
19
Public
Repo size
4.4 MB
Likes
0
Public
Click a slice to open those files.
.safetensors3.6 MB · 52%
From the Hugging Face model README
MediChat – FLAN-T5 Base LoRA Adapter
A lightweight LoRA adapter trained on top of google/flan-t5-base to add medical-assistant style capabilities. This repository contains only the adapter weights and tokenizer files needed to reproduce the exact behaviour during inference.
📁 Repository Contents
This model repo includes the following files:
File Purpose adapter_config.json Configuration for the LoRA adapter (rank, alpha, target modules, etc.). adapter_model.safetensors LoRA adapter weights in safetensors format. tokenizer.json Full tokenizer definition. tokenizer_config.json Tokenizer settings and metadata. special_tokens_map.json Mapping for special tokens (PAD, EOS, etc.). spiece.model SentencePiece model used by FLAN-T5. .gitattributes Repo attributes. README.md Documentation.
Note: This adapter must be loaded on top of the base model google/flan-t5-base.
🔧 Intended Use
The adapter specializes FLAN-T5 for:
Medical question answering
Symptom explanation
Short clinical-style responses
Health-related conversational tasks
It is not a medical authority. All outputs should be double-checked by qualified professionals.
⚠️ Limitations & Safety
May generate incorrect or incomplete medical information.
Should not be used for diagnosis or emergency guidance.
Training data details are not provided here, so biases may exist.
The base model itself is not medically specialized.
Use responsibly and always verify outputs.
🚀 Quick Start (Python)
Install requirements:
pip install transformers accelerate peft safetensors
Load the base model + LoRA adapter:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM from peft import PeftModel
BASE = "google/flan-t5-base" ADAPTER = "wilsonl/medichat-flan-t5-base-lora"
tokenizer = AutoTokenizer.from_pretrained(BASE)
model = AutoModelForSeq2SeqLM.from_pretrained(BASE, device_map="auto")
model = PeftModel.from_pretrained(model, ADAPTER)
prompt = "A patient asks: I have a sore throat and fever. What should I do?" inputs = tokenizer(prompt, return_tensors="pt").to(model.device) output = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(output[0], skip_special_tokens=True))
🧪 Example Prompts
Short clinical advice
Patient: "I feel dizzy when standing up quickly." Give a short explanation and two safety tips.
Case summarization
Summarize the following case in 3 bullet points: 36-year-old with fever, mild cough, no allergies, using paracetamol.
Medical assistant style
You are a helpful medical assistant. Respond concisely and clearly. User: What causes chest tightness after exercise?
🏗️ How This Adapter Was Created
This repository contains only the LoRA adapter weights. Training details such as:
dataset
preprocessing
hyperparameters
epochs
evaluation metrics
are not included in this model card and should be added later if needed.
📜 License
No explicit license is included in this repository. Check with the model owner before using the model commercially.
🤝 Contributing
You can extend this repo by adding:
A full training summary
Evaluation metrics
A changelog
An inference notebook
A detailed model card
📬 Contact
For questions or modifications, reach out via the HuggingFace model page: wilsonl/medichat-flan-t5-base-lora