Text Generation
PEFT
Safetensors
English
medical
triage
healthcare
llama
lora
fine-tuned
gradio
conversational
Instructions to use bilalchawdhary/clinic_flow with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use bilalchawdhary/clinic_flow with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/Llama-3.2-3B-Instruct-bnb-4bit") model = PeftModel.from_pretrained(base_model, "bilalchawdhary/clinic_flow") - Notebooks
- Google Colab
- Kaggle
π₯ ClinicFlow AI
A medical triage and patient intake assistant fine-tuned on Llama 3.2 3B using LoRA adapters.
πΊ Demo Video
π Live Demo
π Try ClinicFlow AI on HuggingFace Spaces
π What is ClinicFlow AI
ClinicFlow AI is a responsible clinic triage and patient intake assistant. It conducts multi-turn conversations to collect patient symptoms, asks focused follow-up questions, and generates a structured clinical summary at the end.
π§ Model Details
| Detail | Info |
|---|---|
| Base Model | unsloth/Llama-3.2-3B-Instruct |
| Fine-tuning Method | LoRA (PEFT) |
| Training Loss | 0.107 |
| Task | Medical Triage & Patient Intake |
| Language | English |
| License | MIT |
π οΈ Tech Stack
- Python + PyTorch
- HuggingFace Transformers
- TRL 1.3.0 + PEFT + LoRA
- Trained on Google Colab A100 GPU
- Gradio UI
π¬ How to Use
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_model_name = "unsloth/Llama-3.2-3B-Instruct"
adapter_name = "bilalchawdhary/clinic_flow"
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_name,
torch_dtype=torch.float16,
device_map="auto"
)
model = PeftModel.from_pretrained(base_model, adapter_name)
prompt = """<|begin_of_text|><|start_header_id|>system<|end_header_id|>
You are ClinicFlow AI, a responsible clinic triage
and patient intake assistant.<|eot_id|>
<|start_header_id|>user<|end_header_id|>
I have a headache and fever since 2 days<|eot_id|>
<|start_header_id|>assistant<|end_header_id|>
"""
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
input_length = inputs["input_ids"].shape[1]
outputs = model.generate(
**inputs,
max_new_tokens=300,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.2,
do_sample=True,
pad_token_id=tokenizer.eos_token_id,
)
new_tokens = outputs[0][input_length:]
response = tokenizer.decode(new_tokens, skip_special_tokens=True)
print(response)
β Capabilities
- Multi-turn patient intake conversations
- Focused symptom follow-up questions
- Never diagnoses or prescribes
- Structured clinical summary at end
- Recommends consulting a real doctor
β οΈ Disclaimer
ClinicFlow AI is for demonstration purposes only. It is NOT a replacement for a real doctor. Always consult a qualified medical professional for diagnosis and treatment.
π¨βπ» Built By
Bilal Chawdhary β Software Engineering Graduate building AI products and sharing the journey.
- π₯ Demo Video
- π€ Live Demo
- Downloads last month
- 1
Model tree for bilalchawdhary/clinic_flow
Base model
meta-llama/Llama-3.2-3B-Instruct Finetuned
unsloth/Llama-3.2-3B-Instruct