Downloads · 30 days
62
6% of all-time downloads
abhishek-ch/biomistral-7b-synthetic-ehr
biomistral-7b-synthetic-ehr is a text generation model from abhishek-ch. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
62
6% of all-time downloads
All-time downloads
1.1K
Public
Parameters
7.2B
18.4 GB on disk
Likes
4
Public
Click a slice to open those files.
.safetensors14.5 GB · 100%
From the Hugging Face model README

This model was converted to MLX format from BioMistral/BioMistral-7B-DARE.
Refer to the original model card for more details on the model.
pip install mlx-lm
The model was LoRA fine-tuned on health_facts and Synthetic EHR dataset inspired by MIMIC-IV using the format below, for 1000 steps (~1M tokens) using mlx.
def format_prompt(prompt:str, question: str) -> str:
return """<s>[INST]
## Instructions
{}
## User Question
{}.
[/INST]</s>
""".format(prompt, question)
Example For Synthetic EHR Diagnosis System Prompt
You are an expert in provide diagnosis summary based on clinical notes inspired by MIMIC-IV-Note dataset.
These notes encompass Chief Complaint along with Patient Summary & medical admission details.
Example for Healthfacts Check System Prompt
You are a Public Health AI Assistant. You can do the fact-checking of public health claims. \nEach answer labelled with true, false, unproven or mixture. \nPlease provide the reason behind the answer
mlxfrom mlx_lm import generate, load
model, tokenizer = load("abhishek-ch/biomistral-7b-synthetic-ehr")
response = generate(
fused_model,
fused_tokenizer,
prompt=format_prompt(prompt, question),
verbose=True, # Set to True to see the prompt and response
temp=0.0,
max_tokens=512,
)
transformersfrom transformers import AutoModelForCausalLM, AutoTokenizer
repo_id = "abhishek-ch/biomistral-7b-synthetic-ehr"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForCausalLM.from_pretrained(repo_id)
model.to("mps")
input_text = format_prompt(system_prompt, question)
input_ids = tokenizer(input_text, return_tensors="pt").to("mps")
outputs = model.generate(
**input_ids,
max_new_tokens=512,
)
print(tokenizer.decode(outputs[0]))