Upload folder using huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- merge
|
4 |
+
- mergekit
|
5 |
+
- lazymergekit
|
6 |
+
- aaditya/Llama3-OpenBioLLM-8B
|
7 |
+
- johnsnowlabs/JSL-MedLlama-3-8B-v2.0
|
8 |
+
- Jayant9928/orpo_med_v3
|
9 |
+
- skumar9/Llama-medx_v3
|
10 |
+
base_model:
|
11 |
+
- aaditya/Llama3-OpenBioLLM-8B
|
12 |
+
- johnsnowlabs/JSL-MedLlama-3-8B-v2.0
|
13 |
+
- Jayant9928/orpo_med_v3
|
14 |
+
- skumar9/Llama-medx_v3
|
15 |
+
---
|
16 |
+
|
17 |
+
# Llama-3-OpenBioMed-8B-dare-ties-4x
|
18 |
+
|
19 |
+
Llama-3-OpenBioMed-8B-dare-ties-4x is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
|
20 |
+
* [aaditya/Llama3-OpenBioLLM-8B](https://huggingface.co/aaditya/Llama3-OpenBioLLM-8B)
|
21 |
+
* [johnsnowlabs/JSL-MedLlama-3-8B-v2.0](https://huggingface.co/johnsnowlabs/JSL-MedLlama-3-8B-v2.0)
|
22 |
+
* [Jayant9928/orpo_med_v3](https://huggingface.co/Jayant9928/orpo_med_v3)
|
23 |
+
* [skumar9/Llama-medx_v3](https://huggingface.co/skumar9/Llama-medx_v3)
|
24 |
+
|
25 |
+
## 🧩 Configuration
|
26 |
+
|
27 |
+
```yaml
|
28 |
+
models:
|
29 |
+
- model: johnsnowlabs/JSL-MedLlama-3-8B-v2.0
|
30 |
+
# No parameters necessary for base model
|
31 |
+
- model: aaditya/Llama3-OpenBioLLM-8B
|
32 |
+
parameters:
|
33 |
+
density: 0.53
|
34 |
+
weight: 0.2
|
35 |
+
- model: johnsnowlabs/JSL-MedLlama-3-8B-v2.0
|
36 |
+
parameters:
|
37 |
+
density: 0.53
|
38 |
+
weight: 0.3
|
39 |
+
- model: Jayant9928/orpo_med_v3
|
40 |
+
parameters:
|
41 |
+
density: 0.53
|
42 |
+
weight: 0.3
|
43 |
+
- model: skumar9/Llama-medx_v3
|
44 |
+
parameters:
|
45 |
+
density: 0.53
|
46 |
+
weight: 0.2
|
47 |
+
merge_method: dare_ties
|
48 |
+
base_model: meta-llama/Meta-Llama-3-8B-Instruct
|
49 |
+
parameters:
|
50 |
+
int8_mask: true
|
51 |
+
dtype: bfloat16
|
52 |
+
```
|
53 |
+
|
54 |
+
## 💻 Usage
|
55 |
+
|
56 |
+
```python
|
57 |
+
!pip install -qU transformers accelerate
|
58 |
+
|
59 |
+
from transformers import AutoTokenizer
|
60 |
+
import transformers
|
61 |
+
import torch
|
62 |
+
|
63 |
+
model = "abhinand/Llama-3-OpenBioMed-8B-dare-ties-4x"
|
64 |
+
messages = [{"role": "user", "content": "What is a large language model?"}]
|
65 |
+
|
66 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
67 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
68 |
+
pipeline = transformers.pipeline(
|
69 |
+
"text-generation",
|
70 |
+
model=model,
|
71 |
+
torch_dtype=torch.float16,
|
72 |
+
device_map="auto",
|
73 |
+
)
|
74 |
+
|
75 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
76 |
+
print(outputs[0]["generated_text"])
|
77 |
+
```
|