Views
No views yet

BioMistral/BioMistral-7B-DARE.
Refer to the original model card for more details on the model.pip install mlx-lm1def format_prompt(prompt:str, question: str) -> str:
2 return """<s>[INST]
3## Instructions
4{}
5## User Question
6{}.
7[/INST]</s>
8""".format(prompt, question)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.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 answermlx1from mlx_lm import generate, load
2model, tokenizer = load("abhishek-ch/biomistral-7b-synthetic-ehr")
3response = generate(
4 fused_model,
5 fused_tokenizer,
6 prompt=format_prompt(prompt, question),
7 verbose=True, # Set to True to see the prompt and response
8 temp=0.0,
9 max_tokens=512,
10)transformers1from transformers import AutoModelForCausalLM, AutoTokenizer
2repo_id = "abhishek-ch/biomistral-7b-synthetic-ehr"
3tokenizer = AutoTokenizer.from_pretrained(repo_id)
4model = AutoModelForCausalLM.from_pretrained(repo_id)
5model.to("mps")
6input_text = format_prompt(system_prompt, question)
7input_ids = tokenizer(input_text, return_tensors="pt").to("mps")
8outputs = model.generate(
9 **input_ids,
10 max_new_tokens=512,
11)
12print(tokenizer.decode(outputs[0]))