Update README.md
Browse files
README.md
CHANGED
@@ -1,66 +1,67 @@
|
|
1 |
-
---
|
2 |
-
tags:
|
3 |
-
- llama-3-8b
|
4 |
-
- sft
|
5 |
-
- medical
|
6 |
-
base_model:
|
7 |
-
- meta-llama/Meta-Llama-3-8B
|
8 |
-
license: cc-by-nc-nd-4.0
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
import
|
28 |
-
import
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
51 |
-
|
|
52 |
-
|
|
53 |
-
|
|
54 |
-
|
|
55 |
-
|
|
56 |
-
| -
|
57 |
-
| -
|
58 |
-
| -
|
59 |
-
| -
|
60 |
-
| -
|
61 |
-
| -
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
|
|
66 |
| | |none | 0|acc_norm|0.6124|± |0.0066|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- llama-3-8b
|
4 |
+
- sft
|
5 |
+
- medical
|
6 |
+
base_model:
|
7 |
+
- meta-llama/Meta-Llama-3-8B
|
8 |
+
license: cc-by-nc-nd-4.0
|
9 |
+
datasets:
|
10 |
+
- lighteval/med_mcqa
|
11 |
+
- qiaojin/PubMedQA
|
12 |
+
- bigbio/med_qa
|
13 |
+
---
|
14 |
+
|
15 |
+
# MedLLaMA-3
|
16 |
+
[<img src="https://repository-images.githubusercontent.com/104670986/2e728700-ace4-11ea-9cfc-f3e060b25ddf">](http://www.johnsnowlabs.com)
|
17 |
+
|
18 |
+
|
19 |
+
This model is developed by Basel Anaya.
|
20 |
+
|
21 |
+
|
22 |
+
## 💻 Usage
|
23 |
+
|
24 |
+
```python
|
25 |
+
!pip install -qU transformers accelerate
|
26 |
+
|
27 |
+
from transformers import AutoTokenizer
|
28 |
+
import transformers
|
29 |
+
import torch
|
30 |
+
|
31 |
+
model = "Reverb/MedLLaMA-3"
|
32 |
+
messages = [{"role": "user", "content": "What is a large language model?"}]
|
33 |
+
|
34 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
35 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
36 |
+
pipeline = transformers.pipeline(
|
37 |
+
"text-generation",
|
38 |
+
model=model,
|
39 |
+
torch_dtype=torch.float16,
|
40 |
+
device_map="auto",
|
41 |
+
)
|
42 |
+
|
43 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
44 |
+
print(outputs[0]["generated_text"])
|
45 |
+
```
|
46 |
+
## 🏆 Evaluation
|
47 |
+
|
48 |
+
| Tasks |Version|Filter|n-shot| Metric |Value | |Stderr|
|
49 |
+
|-------------------------------|-------|------|-----:|--------|-----:|---|-----:|
|
50 |
+
|stem |N/A |none | 0|acc |0.6466|± |0.0056|
|
51 |
+
| | |none | 0|acc_norm|0.6124|± |0.0066|
|
52 |
+
| - medmcqa |Yaml |none | 0|acc |0.6118|± |0.0075|
|
53 |
+
| | |none | 0|acc_norm|0.6118|± |0.0075|
|
54 |
+
| - medqa_4options |Yaml |none | 0|acc |0.6143|± |0.0136|
|
55 |
+
| | |none | 0|acc_norm|0.6143|± |0.0136|
|
56 |
+
| - anatomy (mmlu) | 0|none | 0|acc |0.7185|± |0.0389|
|
57 |
+
| - clinical_knowledge (mmlu) | 0|none | 0|acc |0.7811|± |0.0254|
|
58 |
+
| - college_biology (mmlu) | 0|none | 0|acc |0.8264|± |0.0317|
|
59 |
+
| - college_medicine (mmlu) | 0|none | 0|acc |0.7110|± |0.0346|
|
60 |
+
| - medical_genetics (mmlu) | 0|none | 0|acc |0.8300|± |0.0378|
|
61 |
+
| - professional_medicine (mmlu)| 0|none | 0|acc |0.7868|± |0.0249|
|
62 |
+
| - pubmedqa | 1|none | 0|acc |0.7420|± |0.0196|
|
63 |
+
|
64 |
+
|Groups|Version|Filter|n-shot| Metric |Value | |Stderr|
|
65 |
+
|------|-------|------|-----:|--------|-----:|---|-----:|
|
66 |
+
|stem |N/A |none | 0|acc |0.6466|± |0.0056|
|
67 |
| | |none | 0|acc_norm|0.6124|± |0.0066|
|