Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
# JSL-MedLlama-3-8B-v2.0
|
| 12 |
+
[<img src="https://repository-images.githubusercontent.com/104670986/2e728700-ace4-11ea-9cfc-f3e060b25ddf">](http://www.johnsnowlabs.com)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
This model is developed by [John Snow Labs](https://www.johnsnowlabs.com/).
|
| 16 |
+
|
| 17 |
+
This model is available under a [CC-BY-NC-ND](https://creativecommons.org/licenses/by-nc-nd/4.0/deed.en) license and must also conform to this [Acceptable Use Policy](https://huggingface.co/johnsnowlabs). If you need to license this model for commercial use, please contact us at [email protected].
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
## 💻 Usage
|
| 22 |
+
|
| 23 |
+
```python
|
| 24 |
+
!pip install -qU transformers accelerate
|
| 25 |
+
|
| 26 |
+
from transformers import AutoTokenizer
|
| 27 |
+
import transformers
|
| 28 |
+
import torch
|
| 29 |
+
|
| 30 |
+
model = "johnsnowlabs/JSL-MedLlama-3-8B-v2.0"
|
| 31 |
+
messages = [{"role": "user", "content": "What is a large language model?"}]
|
| 32 |
+
|
| 33 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
| 34 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 35 |
+
pipeline = transformers.pipeline(
|
| 36 |
+
"text-generation",
|
| 37 |
+
model=model,
|
| 38 |
+
torch_dtype=torch.float16,
|
| 39 |
+
device_map="auto",
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
| 43 |
+
print(outputs[0]["generated_text"])
|
| 44 |
+
```
|
| 45 |
+
## 🏆 Evaluation
|
| 46 |
+
|
| 47 |
+
| Tasks |Version|Filter|n-shot| Metric |Value | |Stderr|
|
| 48 |
+
|-------------------------------|-------|------|-----:|--------|-----:|---|-----:|
|
| 49 |
+
|stem |N/A |none | 0|acc |0.6466|± |0.0056|
|
| 50 |
+
| | |none | 0|acc_norm|0.6124|± |0.0066|
|
| 51 |
+
| - medmcqa |Yaml |none | 0|acc |0.6118|± |0.0075|
|
| 52 |
+
| | |none | 0|acc_norm|0.6118|± |0.0075|
|
| 53 |
+
| - medqa_4options |Yaml |none | 0|acc |0.6143|± |0.0136|
|
| 54 |
+
| | |none | 0|acc_norm|0.6143|± |0.0136|
|
| 55 |
+
| - anatomy (mmlu) | 0|none | 0|acc |0.7185|± |0.0389|
|
| 56 |
+
| - clinical_knowledge (mmlu) | 0|none | 0|acc |0.7811|± |0.0254|
|
| 57 |
+
| - college_biology (mmlu) | 0|none | 0|acc |0.8264|± |0.0317|
|
| 58 |
+
| - college_medicine (mmlu) | 0|none | 0|acc |0.7110|± |0.0346|
|
| 59 |
+
| - medical_genetics (mmlu) | 0|none | 0|acc |0.8300|± |0.0378|
|
| 60 |
+
| - professional_medicine (mmlu)| 0|none | 0|acc |0.7868|± |0.0249|
|
| 61 |
+
| - pubmedqa | 1|none | 0|acc |0.7420|± |0.0196|
|
| 62 |
+
|
| 63 |
+
|Groups|Version|Filter|n-shot| Metric |Value | |Stderr|
|
| 64 |
+
|------|-------|------|-----:|--------|-----:|---|-----:|
|
| 65 |
+
|stem |N/A |none | 0|acc |0.6466|± |0.0056|
|
| 66 |
+
| | |none | 0|acc_norm|0.6124|± |0.0066|
|