Views
No views yet
| Name | Quant method | Size |
|---|---|---|
| Medical-Llama3-8B.Q2_K.gguf | Q2_K | 2.96GB |
| Medical-Llama3-8B.IQ3_XS.gguf | IQ3_XS | 3.28GB |
| Medical-Llama3-8B.IQ3_S.gguf | IQ3_S | 3.43GB |
| Medical-Llama3-8B.Q3_K_S.gguf | Q3_K_S | 3.41GB |
| Medical-Llama3-8B.IQ3_M.gguf | IQ3_M | 3.52GB |
| Medical-Llama3-8B.Q3_K.gguf | Q3_K | 3.74GB |
| Medical-Llama3-8B.Q3_K_M.gguf | Q3_K_M | 3.74GB |
| Medical-Llama3-8B.Q3_K_L.gguf | Q3_K_L | 4.03GB |
| Medical-Llama3-8B.IQ4_XS.gguf | IQ4_XS | 4.18GB |
| Medical-Llama3-8B.Q4_0.gguf | Q4_0 | 4.34GB |
| Medical-Llama3-8B.IQ4_NL.gguf | IQ4_NL | 4.38GB |
| Medical-Llama3-8B.Q4_K_S.gguf | Q4_K_S | 4.37GB |
| Medical-Llama3-8B.Q4_K.gguf | Q4_K | 4.58GB |
| Medical-Llama3-8B.Q4_K_M.gguf | Q4_K_M | 4.58GB |
| Medical-Llama3-8B.Q4_1.gguf | Q4_1 | 4.78GB |
| Medical-Llama3-8B.Q5_0.gguf | Q5_0 | 5.21GB |
| Medical-Llama3-8B.Q5_K_S.gguf | Q5_K_S | 5.21GB |
| Medical-Llama3-8B.Q5_K.gguf | Q5_K | 5.34GB |
| Medical-Llama3-8B.Q5_K_M.gguf | Q5_K_M | 5.34GB |
| Medical-Llama3-8B.Q5_1.gguf | Q5_1 | 5.65GB |
| Medical-Llama3-8B.Q6_K.gguf | Q6_K | 6.14GB |
| Medical-Llama3-8B.Q8_0.gguf | Q8_0 | 7.95GB |

pip install transformers bitsandbytes accelerateMedical-Llama3-8B-16bit model and generate answers to your medical questions:1from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
2import torch
3model_name = "ruslanmv/Medical-Llama3-8B"
4device_map = 'auto'
5bnb_config = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",bnb_4bit_compute_dtype=torch.float16,)
6model = AutoModelForCausalLM.from_pretrained( model_name,quantization_config=bnb_config, trust_remote_code=True,use_cache=False,device_map=device_map)
7tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
8tokenizer.pad_token = tokenizer.eos_token
9
10def askme(question):
11 sys_message = '''
12 You are an AI Medical Assistant trained on a vast dataset of health information. Please be thorough and
13 provide an informative answer. If you don't know the answer to a specific medical inquiry, advise seeking professional help.
14 '''
15 # Create messages structured for the chat template
16 messages = [{"role": "system", "content": sys_message}, {"role": "user", "content": question}]
17
18 # Applying chat template
19 prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
20 inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
21 outputs = model.generate(**inputs, max_new_tokens=100, use_cache=True)
22
23 # Extract and return the generated text, removing the prompt
24 response_text = tokenizer.batch_decode(outputs)[0].strip()
25 answer = response_text.split('<|im_start|>assistant')[-1].strip()
26 return answer
27# Example usage
28# - Context: First describe your problem.
29# - Question: Then make the question.
30
31question = '''I'm a 35-year-old male and for the past few months, I've been experiencing fatigue,
32increased sensitivity to cold, and dry, itchy skin.
33Could these symptoms be related to hypothyroidism?
34If so, what steps should I take to get a proper diagnosis and discuss treatment options?'''
35
36print(askme(question))
37Based on your description, it sounds like you may be experiencing symptoms of hypothyroidism.
Hypothyroidism is a condition where the thyroid gland doesn't produce enough hormones, leading to a variety of symptoms.
Some common symptoms include fatigue, weight gain, constipation, and dry skin.
If you're experiencing any of these symptoms, it's important to see a doctor for a proper diagnosis and treatment plan.
Your doctor may order blood tests to check your thyroid hormone levels