Update README.md
Browse files
README.md
CHANGED
@@ -1,33 +1,29 @@
|
|
1 |
---
|
2 |
-
base_model:
|
3 |
-
- Nexusflow/Starling-LM-7B-beta
|
4 |
-
- mistralai/Mistral-7B-v0.1
|
5 |
-
library_name: transformers
|
6 |
tags:
|
7 |
-
- mergekit
|
8 |
- merge
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
---
|
11 |
-
# merge
|
12 |
|
13 |
-
|
14 |
|
15 |
-
## Merge Details
|
16 |
-
### Merge Method
|
17 |
|
18 |
-
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
The following models were included in the merge:
|
23 |
* [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
|
|
|
24 |
|
25 |
-
|
26 |
|
27 |
-
|
28 |
|
29 |
```yaml
|
30 |
-
|
31 |
models:
|
32 |
- model: Nexusflow/Starling-LM-7B-beta
|
33 |
parameters:
|
@@ -44,5 +40,51 @@ base_model: Nexusflow/Starling-LM-7B-beta
|
|
44 |
parameters:
|
45 |
int8_mask: true
|
46 |
dtype: bfloat16
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
|
|
|
|
|
|
|
|
2 |
tags:
|
|
|
3 |
- merge
|
4 |
+
- mergekit
|
5 |
+
- lazymergekit
|
6 |
+
- Nexusflow/Starling-LM-7B-beta
|
7 |
+
- mistralai/Mistral-7B-v0.1
|
8 |
+
base_model:
|
9 |
+
- Nexusflow/Starling-LM-7B-beta
|
10 |
+
license: apache-2.0
|
11 |
---
|
|
|
12 |
|
13 |
+
# JSL-MedMNX-7B
|
14 |
|
|
|
|
|
15 |
|
16 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/660cfe98280a82e38fe4ef49/EvDSQBDbZMzLJYTcOEHy8.png)
|
17 |
|
18 |
+
**JSL-MedMNX-7B** is a merge of the following models using [Mergekit](https://github.com/arcee-ai/mergekit):
|
|
|
|
|
19 |
* [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
|
20 |
+
* [Nexusflow/Starling-LM-7B-beta](https://huggingface.co/Nexusflow/Starling-LM-7B-beta)
|
21 |
|
22 |
+
Special thanks to Charles Goddard for the quick implementation!
|
23 |
|
24 |
+
## 🧩 Configuration
|
25 |
|
26 |
```yaml
|
|
|
27 |
models:
|
28 |
- model: Nexusflow/Starling-LM-7B-beta
|
29 |
parameters:
|
|
|
40 |
parameters:
|
41 |
int8_mask: true
|
42 |
dtype: bfloat16
|
43 |
+
```
|
44 |
+
|
45 |
+
## 💻 Usage
|
46 |
+
|
47 |
+
```python
|
48 |
+
!pip install -qU transformers accelerate
|
49 |
|
50 |
+
from transformers import AutoTokenizer
|
51 |
+
import transformers
|
52 |
+
import torch
|
53 |
+
|
54 |
+
model = "johnsnowlabs/JSL-MedMNX-7B"
|
55 |
+
messages = [{"role": "user", "content": "What is a large language model?"}]
|
56 |
+
|
57 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
58 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
59 |
+
pipeline = transformers.pipeline(
|
60 |
+
"text-generation",
|
61 |
+
model=model,
|
62 |
+
torch_dtype=torch.float16,
|
63 |
+
device_map="auto",
|
64 |
+
)
|
65 |
+
|
66 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
67 |
+
print(outputs[0]["generated_text"])
|
68 |
```
|
69 |
+
## 🏆 Evaluation
|
70 |
+
|
71 |
+
| Tasks |Version|Filter|n-shot| Metric |Value | |Stderr|
|
72 |
+
|-------------------------------|-------|------|-----:|--------|-----:|---|-----:|
|
73 |
+
|stem |N/A |none | 0|acc_norm|0.5191|± |0.0068|
|
74 |
+
| | |none | 0|acc |0.5658|± |0.0058|
|
75 |
+
| - medmcqa |Yaml |none | 0|acc |0.5135|± |0.0077|
|
76 |
+
| | |none | 0|acc_norm|0.5135|± |0.0077|
|
77 |
+
| - medqa_4options |Yaml |none | 0|acc |0.5373|± |0.0140|
|
78 |
+
| | |none | 0|acc_norm|0.5373|± |0.0140|
|
79 |
+
| - anatomy (mmlu) | 0|none | 0|acc |0.6370|± |0.0415|
|
80 |
+
| - clinical_knowledge (mmlu) | 0|none | 0|acc |0.7245|± |0.0275|
|
81 |
+
| - college_biology (mmlu) | 0|none | 0|acc |0.7500|± |0.0362|
|
82 |
+
| - college_medicine (mmlu) | 0|none | 0|acc |0.6590|± |0.0361|
|
83 |
+
| - medical_genetics (mmlu) | 0|none | 0|acc |0.7200|± |0.0451|
|
84 |
+
| - professional_medicine (mmlu)| 0|none | 0|acc |0.7206|± |0.0273|
|
85 |
+
| - pubmedqa | 1|none | 0|acc |0.7720|± |0.0188|
|
86 |
+
|
87 |
+
|Groups|Version|Filter|n-shot| Metric |Value | |Stderr|
|
88 |
+
|------|-------|------|-----:|--------|-----:|---|-----:|
|
89 |
+
|stem |N/A |none | 0|acc_norm|0.5191|± |0.0068|
|
90 |
+
| | |none | 0|acc |0.5658|± |0.0058|
|