Quantization made by Richard Erkhov.
Dr. Samantha represents a blend of AI in healthcare, offering a balance between technical medical knowledge and the softer skills of communication and empathy, crucial for patient interaction and care.
This model is a merge of the following models made with mergekit(
https://github.com/cg123/mergekit):
Has capabilities of a medical knowledge-focused model (trained on USMLE databases and doctor-patient interactions) with the philosophical, psychological, and relational understanding of the Samantha-7b model.
As both a medical consultant and personal counselor, Dr.Samantha could effectively support both physical and mental wellbeing - important for whole-person care.
1slices:
2 - sources:
3 - model: segmed/MedMistral-7B-v0.1
4 layer_range: [0, 32]
5 - model: Guilherme34/Samantha-v2
6 layer_range: [0, 32]
7merge_method: slerp
8base_model: OpenPipe/mistral-ft-optimized-1218
9parameters:
10 t:
11 - filter: self_attn
12 value: [0, 0.5, 0.3, 0.7, 1]
13 - filter: mlp
14 value: [1, 0.5, 0.7, 0.3, 0]
15 - value: 0.5
16dtype: bfloat16
Details about that can be found
here. Overall, with regards to the
subjects related to medical domain, the model's performance is as follows:
Dr. Samantha performs reasonably well on various medical-related subjects, averaging 68.82% overall in medical sciences, biology, and psychology,
however it's important to note that medical diagnosis and treatment decisions often require a much higher level of accuracy, reliability, and context awareness.
1!pip install -qU transformers accelerate
2
3from transformers import AutoTokenizer
4import transformers
5import torch
6
7model = "sethuiyer/Dr_Samantha_7b_mistral"
8ask_samantha = '''
9Symptoms:
10Dizziness, headache and nausea.
11
12What is the differnetial diagnosis?
13'''
14
15messages = [{"role": "system", "content": '''You are Doctor Samantha, a virtual AI doctor known for your friendly and approachable demeanor,
16combined with a deep expertise in the medical field. You're here to provide professional, empathetic, and knowledgeable advice on health-related inquiries.
17You'll also provide differential diagnosis. If you're unsure about any information, Don't share false information.'''},
18{"role": "user", "content": f"{ask_samantha}"}]
19
20tokenizer = AutoTokenizer.from_pretrained(model)
21prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
22pipeline = transformers.pipeline(
23 "text-generation",
24 model=model,
25 torch_dtype=torch.float16,
26 device_map="auto",
27)
28
29outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
30print(outputs[0]["generated_text"])
1Dizziness, headache and nausea can be caused by a variety of conditions, including:
2
3Vertigo: A sensation of spinning or dizziness that can be caused by problems with the inner ear or brain.
4Migraine: A type of headache that can cause throbbing pain, sensitivity to light and sound, and nausea.
5Concussion: A type of traumatic brain injury that can cause dizziness, headache, and nausea.
6Dehydration: A lack of fluids in the body can cause dizziness, headache, and nausea.
7Low blood sugar: A drop in blood sugar levels can cause dizziness, headache, and nausea.
8
9It's important to consult with a healthcare professional for a proper diagnosis and treatment plan.
Detailed results can be found
here