Upload folder using huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model:
|
3 |
+
- GoToCompany/gemma2-9b-cpt-sahabatai-v1-instruct
|
4 |
+
- GoToCompany/gemma2-9b-cpt-sahabatai-v1-instruct
|
5 |
+
tags:
|
6 |
+
- merge
|
7 |
+
- mergekit
|
8 |
+
- lazymergekit
|
9 |
+
- GoToCompany/gemma2-9b-cpt-sahabatai-v1-instruct
|
10 |
+
---
|
11 |
+
|
12 |
+
# gemma2-9b-sahabatai-v1-instruct-BaseTIES
|
13 |
+
|
14 |
+
gemma2-9b-sahabatai-v1-instruct-BaseTIES is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
|
15 |
+
* [GoToCompany/gemma2-9b-cpt-sahabatai-v1-instruct](https://huggingface.co/GoToCompany/gemma2-9b-cpt-sahabatai-v1-instruct)
|
16 |
+
* [GoToCompany/gemma2-9b-cpt-sahabatai-v1-instruct](https://huggingface.co/GoToCompany/gemma2-9b-cpt-sahabatai-v1-instruct)
|
17 |
+
|
18 |
+
## 🧩 Configuration
|
19 |
+
|
20 |
+
```yaml
|
21 |
+
models:
|
22 |
+
- model: GoToCompany/gemma2-9b-cpt-sahabatai-v1-instruct
|
23 |
+
parameters:
|
24 |
+
weight: 1
|
25 |
+
density: 1
|
26 |
+
- model: GoToCompany/gemma2-9b-cpt-sahabatai-v1-instruct
|
27 |
+
parameters:
|
28 |
+
weight: 1
|
29 |
+
density: 1
|
30 |
+
merge_method: ties
|
31 |
+
base_model: aisingapore/gemma2-9b-cpt-sea-lionv3-instruct
|
32 |
+
parameters:
|
33 |
+
density: 1
|
34 |
+
normalize: true
|
35 |
+
int8_mask: true
|
36 |
+
dtype: bfloat16
|
37 |
+
```
|
38 |
+
|
39 |
+
## 💻 Usage
|
40 |
+
|
41 |
+
```python
|
42 |
+
!pip install -qU transformers accelerate
|
43 |
+
|
44 |
+
from transformers import AutoTokenizer
|
45 |
+
import transformers
|
46 |
+
import torch
|
47 |
+
|
48 |
+
model = "gmonsoon/gemma2-9b-sahabatai-v1-instruct-BaseTIES"
|
49 |
+
messages = [{"role": "user", "content": "What is a large language model?"}]
|
50 |
+
|
51 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
52 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
53 |
+
pipeline = transformers.pipeline(
|
54 |
+
"text-generation",
|
55 |
+
model=model,
|
56 |
+
torch_dtype=torch.float16,
|
57 |
+
device_map="auto",
|
58 |
+
)
|
59 |
+
|
60 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
61 |
+
print(outputs[0]["generated_text"])
|
62 |
+
```
|