Downloads · 30 days
0
hamsaram/GenMedX-Adapter
GenMedX-Adapter is a machine learning model from hamsaram. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
--- libraryname: peft basemodel: BioMistral/BioMistral-7B language: - en pipelinetag: text-generation tags: - medical - healthcare - triage - risk-prediction - biomistral - rag - fine-tuned license: apache-2.0 ---
Downloads · 30 days
0
Access
Public
Updated Nov 26, 2025
Repo size
44.1 MB
Likes
0
Public
Click a slice to open those files.
.safetensors44.1 MB · 100%
From the Hugging Face model README
library_name: peft base_model: BioMistral/BioMistral-7B language:
GenMedX is a specialized medical AI system designed to assist in Emergency Department (ED) triage. It utilizes a fine-tuned BioMistral-7B model combined with Retrieval-Augmented Generation (RAG) to analyze patient complaints and vital signs, predicting risk levels and recommending diagnostic tests.
bitsandbytes and peft).
sentence-transformers/all-MiniLM-L6-v2 to retrieve similar historical cases from a vector database.This model is intended for research and academic demonstration purposes only. It is designed to simulate an "AI Medical Assistant" that can:
This model is NOT a doctor.
The model was fine-tuned on a preprocessed emergency dataset (train_preprocessed.csv) containing:
To use this model, you need the peft and transformers libraries.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
from peft import PeftModel
# 1. Configuration
base_model_id = "BioMistral/BioMistral-7B"
adapter_id = "hamsaram/GenMedX-Adapter"
# 2. Load Base Model (4-bit for efficiency)
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16,
)
model = AutoModelForCausalLM.from_pretrained(
base_model_id,
quantization_config=bnb_config,
device_map="auto",
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
# 3. Load GenMedX Adapter
model = PeftModel.from_pretrained(model, adapter_id)
# 4. Inference
prompt = "[INST] Patient has chest pain and HR 120. Assess risk. [/INST]"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))