Update README.md
Browse files
README.md
CHANGED
|
@@ -1,49 +1,69 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
-
|
| 5 |
library_name: transformers
|
| 6 |
tags:
|
| 7 |
-
-
|
| 8 |
-
-
|
| 9 |
-
|
| 10 |
---
|
| 11 |
-
# merge
|
| 12 |
|
| 13 |
-
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
-
### Merge Method
|
| 17 |
|
| 18 |
-
This model was merged using the [DARE](https://arxiv.org/abs/2311.03099) [TIES](https://arxiv.org/abs/2306.01708) merge method using [johnsnowlabs/JSL-MedMNX-7B](https://huggingface.co/johnsnowlabs/JSL-MedMNX-7B) as a base.
|
| 19 |
|
| 20 |
-
|
|
|
|
| 21 |
|
| 22 |
-
|
| 23 |
-
* [dmis-lab/meerkat-7b-v1.0](https://huggingface.co/dmis-lab/meerkat-7b-v1.0)
|
| 24 |
|
| 25 |
-
|
| 26 |
|
| 27 |
-
|
|
|
|
| 28 |
|
| 29 |
-
|
|
|
|
|
|
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
parameters:
|
| 34 |
-
density: 0.53
|
| 35 |
-
weight: 0.4
|
| 36 |
-
- model: dmis-lab/meerkat-7b-v1.0
|
| 37 |
-
parameters:
|
| 38 |
-
density: 0.53
|
| 39 |
-
weight: 0.3
|
| 40 |
-
|
| 41 |
-
merge_method: dare_ties
|
| 42 |
-
tokenizer_source: union
|
| 43 |
-
base_model: johnsnowlabs/JSL-MedMNX-7B
|
| 44 |
-
parameters:
|
| 45 |
-
int8_mask: true
|
| 46 |
-
dtype: bfloat16
|
| 47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
|
|
|
|
|
|
| 49 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: cc-by-nc-nd-4.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
library_name: transformers
|
| 6 |
tags:
|
| 7 |
+
- reward model
|
| 8 |
+
- RLHF
|
| 9 |
+
- medical
|
| 10 |
---
|
|
|
|
| 11 |
|
| 12 |
+
# JSL-MedMNX-7B-v2.0
|
| 13 |
+
|
| 14 |
|
| 15 |
+
[<img src="https://repository-images.githubusercontent.com/104670986/2e728700-ace4-11ea-9cfc-f3e060b25ddf">](http://www.johnsnowlabs.com)
|
|
|
|
| 16 |
|
|
|
|
| 17 |
|
| 18 |
+
This model is developed by [John Snow Labs](https://www.johnsnowlabs.com/).
|
| 19 |
+
Performance on biomedical benchmarks: [Open Medical LLM Leaderboard](https://huggingface.co/spaces/openlifescienceai/open_medical_llm_leaderboard).
|
| 20 |
|
| 21 |
+
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 info@johnsnowlabs.com.
|
|
|
|
| 22 |
|
| 23 |
+
## 💻 Usage
|
| 24 |
|
| 25 |
+
```python
|
| 26 |
+
!pip install -qU transformers accelerate
|
| 27 |
|
| 28 |
+
from transformers import AutoTokenizer
|
| 29 |
+
import transformers
|
| 30 |
+
import torch
|
| 31 |
|
| 32 |
+
model = "johnsnowlabs/JSL-MedMNX-7B"
|
| 33 |
+
messages = [{"role": "user", "content": "What is a large language model?"}]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
| 36 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 37 |
+
pipeline = transformers.pipeline(
|
| 38 |
+
"text-generation",
|
| 39 |
+
model=model,
|
| 40 |
+
torch_dtype=torch.float16,
|
| 41 |
+
device_map="auto",
|
| 42 |
+
)
|
| 43 |
|
| 44 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
| 45 |
+
print(outputs[0]["generated_text"])
|
| 46 |
```
|
| 47 |
+
|
| 48 |
+
## 🏆 Evaluation
|
| 49 |
+
|
| 50 |
+
| Tasks |Version|Filter|n-shot| Metric |Value | |Stderr|
|
| 51 |
+
|-------------------------------|-------|------|-----:|--------|-----:|---|-----:|
|
| 52 |
+
|stem |N/A |none | 0|acc |0.6085|± |0.0057|
|
| 53 |
+
| | |none | 0|acc_norm|0.5700|± |0.0067|
|
| 54 |
+
| - medmcqa |Yaml |none | 0|acc |0.5625|± |0.0077|
|
| 55 |
+
| | |none | 0|acc_norm|0.5625|± |0.0077|
|
| 56 |
+
| - medqa_4options |Yaml |none | 0|acc |0.5947|± |0.0138|
|
| 57 |
+
| | |none | 0|acc_norm|0.5947|± |0.0138|
|
| 58 |
+
| - anatomy (mmlu) | 0|none | 0|acc |0.6444|± |0.0414|
|
| 59 |
+
| - clinical_knowledge (mmlu) | 0|none | 0|acc |0.7509|± |0.0266|
|
| 60 |
+
| - college_biology (mmlu) | 0|none | 0|acc |0.7639|± |0.0355|
|
| 61 |
+
| - college_medicine (mmlu) | 0|none | 0|acc |0.6532|± |0.0363|
|
| 62 |
+
| - medical_genetics (mmlu) | 0|none | 0|acc |0.7500|± |0.0435|
|
| 63 |
+
| - professional_medicine (mmlu)| 0|none | 0|acc |0.7537|± |0.0262|
|
| 64 |
+
| - pubmedqa | 1|none | 0|acc |0.7760|± |0.0187|
|
| 65 |
+
|
| 66 |
+
|Groups|Version|Filter|n-shot| Metric |Value | |Stderr|
|
| 67 |
+
|------|-------|------|-----:|--------|-----:|---|-----:|
|
| 68 |
+
|stem |N/A |none | 0|acc |0.6085|± |0.0057|
|
| 69 |
+
| | |none | 0|acc_norm|0.5700|± |0.0067|
|