Mistral-7B Blood Pressure Medical Assistant
Model Description
This is a fine-tuned version of Mistral-7B-Instruct-v0.3 specialized for blood pressure assessment and medical consultation. The model acts as an intelligent medical assistant that:
- β Analyzes blood pressure readings
- β Asks relevant follow-up questions based on BP levels
- β Provides personalized medical guidance
- β Handles various scenarios (with/without patient context)
- β Never hallucinates information - only responds to what the patient shares
- β Recognizes emergency situations (hypertensive crisis)
Model Type
LoRA Adapter
Training Details
- Base Model: mistralai/Mistral-7B-Instruct-v0.3
- Dataset: TesterColab/MIMICDB (880 clinical examples)
- Training Method: LoRA (Low-Rank Adaptation)
- Training Scenarios:
- BP reading only (model asks questions)
- BP with patient context (model uses provided information)
- Speech-to-text variations
Usage
Installation
pip install transformers torch peft accelerate
Basic Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# Load model
model_id = "TesterColab/mistral-finetuned-v3"
base_model_id = "mistralai/Mistral-7B-Instruct-v0.3"
tokenizer = AutoTokenizer.from_pretrained(model_id)
base_model = AutoModelForCausalLM.from_pretrained(base_model_id, device_map='auto', torch_dtype=torch.float16)
model = PeftModel.from_pretrained(base_model, model_id)
# Use the model
prompt = """<s>[INST] You are a medical doctor. A patient shares their blood pressure reading. Analyze it and respond appropriately - if abnormal, ask relevant questions; if normal, provide encouragement. Never assume information the patient hasn't told you.
Patient: My blood pressure is 145 over 95 [/INST]
"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=300, temperature=0.7, top_p=0.9)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response.split('[/INST]')[-1].strip())
Example Conversations
Example 1: Normal BP
User: My blood pressure is 115 over 75
Assistant: Your blood pressure reading of 115/75 mmHg is within the normal range - that's great! To maintain this healthy blood pressure, continue with regular exercise, a balanced diet low in sodium, maintain a healthy weight, limit alcohol, and manage stress. Keep monitoring it regularly.
Example 2: High BP - Asks Questions
User: 145 over 95
Assistant: Your blood pressure reading of 145/95 indicates Stage 2 hypertension. To help you properly, I need to understand your health better. Can you tell me: Do you smoke? How often do you exercise? Do you have any family history of heart disease or stroke? Are you currently taking any medications?
Example 3: With Context
User: My BP is 130 over 85 and I smoke
Assistant: Your blood pressure reading of 130/85 shows Stage 1 hypertension, and smoking is a significant risk factor that can worsen this. I need to understand more: How much do you smoke per day? How long have you been smoking? Have you tried to quit before? Also, tell me about your exercise routine and diet.
Intended Use
- π₯ Health monitoring applications
- π± Mobile health assistants
- π¬ Conversational health bots
- π©Ί Telemedicine support tools
Limitations
β οΈ Important Medical Disclaimer:
- This model is for informational purposes only
- NOT a replacement for professional medical advice
- Always consult healthcare professionals for medical decisions
- In emergencies (chest pain, severe symptoms), seek immediate medical care
- Model may occasionally generate incorrect medical information
Ethical Considerations
- Trained to recognize emergency situations
- Asks appropriate follow-up questions
- Does not assume or hallucinate patient information
- Provides general guidance, not diagnoses
- Encourages seeking professional medical care when appropriate
Training Data
Trained on the MIMICDB dataset containing clinical blood pressure readings with patient context including:
- Age groups
- Smoking status
- Pregnancy status
- Activity levels
- Diet information
- ABP (Arterial Blood Pressure) measurements
Performance
The model has been trained to handle multiple scenarios:
- β BP readings without context β Asks appropriate questions
- β BP readings with patient info β Uses provided context
- β Emergency situations β Recognizes and advises immediate care
- β Normal readings β Provides encouragement and maintenance tips
Citation
@model{mistral-bp-doctor,
author = {TesterColab},
title = {Mistral-7B Blood Pressure Medical Assistant},
year = {2024},
publisher = {HuggingFace},
url = {https://huggingface.co/TesterColab/mistral-finetuned-v3}
}
License
Apache 2.0 (inherits from Mistral-7B-Instruct-v0.3)
Contact
For questions or issues, please open an issue on the model repository.
Built with β€οΈ for better health monitoring
Model tree for TesterColab/mistral-finetuned-v3
Base model
mistralai/Mistral-7B-v0.3
Finetuned
mistralai/Mistral-7B-Instruct-v0.3