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|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: nitky/Oumuamua-7b-instruct
|
3 |
+
library_name: transformers
|
4 |
+
tags:
|
5 |
+
- mergekit
|
6 |
+
- merge
|
7 |
+
language:
|
8 |
+
- ja
|
9 |
+
- en
|
10 |
+
pipeline_tag: text-generation
|
11 |
+
license: apache-2.0
|
12 |
+
---
|
13 |
+
# Oumuamua-7b-instruct-GGUF
|
14 |
+
This is quantized version of [nitky/Oumuamua-7b-instruct](https://huggingface.co/nitky/Oumuamua-7b-instruct) created using llama.cpp
|
15 |
+
|
16 |
+
# Model Description
|
17 |
+
This is a merge of pre-trained language models created using [mergekit](https://github.com/cg123/mergekit).
|
18 |
+
|
19 |
+
## Output example
|
20 |
+
|
21 |
+
```
|
22 |
+
[INST] <<SYS>>
|
23 |
+
ใใชใใฏๆฅๆฌ่ชใ่ฉฑใๅช็งใชใขใทในใฟใณใใงใใๅ็ญใซใฏๅฟ
ใๆฅๆฌ่ชใง็ญใใฆใใ ใใใใพใ่ใใ้็จใๅบๅใใฆใใ ใใใ
|
24 |
+
<</SYS>>
|
25 |
+
|
26 |
+
้่ทฏใงๆณฃใใฆใใๅญไพใใใพใใใใฎๅญไพใซใฏไฝใใใฃใใจ่ใใใใพใใ๏ผ [/INST] ้่ทฏใงๆณฃใใฆใใๅญไพใใใๅ ดๅใ่ใใใใ็็ฑใฏใใใคใใใใพใใ
|
27 |
+
|
28 |
+
1. ๆชๆใใใ: ่ปขใใงๆชๆใใใใใไฝใใซใถใคใใฃใฆ็ใฟใๆใใฆใใๅฏ่ฝๆงใใใใพใใ
|
29 |
+
2. ่ฟทๅญใซใชใฃใ: ่ฆชใไฟ่ญท่
ใจใฏใใใฆใใพใฃใใใพใใฏ้ใซ่ฟทใฃใฆไธๅฎใซใชใฃใฆใใๅฏ่ฝๆงใใใใพใใ
|
30 |
+
3. ใ่
นใ็ฉบใใ: ้ทๆ้้ฃไบใใใฆใใชใใใพใใฏใ่
นใ็ฉบใใฆใใใใใซๆณฃใใฆใใๅฏ่ฝๆงใใใใพใใ
|
31 |
+
4. ็ฒใใ: ้ทๆ้ๆญฉใใฆใใใใ้ใณ็ฒใใฆ็ฒใใฆใใๅฏ่ฝๆงใใใใพใใ
|
32 |
+
5. ๅฏใใใฃใ: ไธไบบใงใใใใจใซๅฏใใใๆใใฆใใใใพใใฏ่ฆชใๅ้ใใใชใใฆๅฏใใใจๆใใฆใใๅฏ่ฝๆงใใใใพใใ
|
33 |
+
6. ๆใๆใใใใ: ่ปใไธๅฏฉ่
ใซ้ญ้ใใใใพใใฏไฝใใซ้ฉใใๅฏ่ฝๆงใใใใพใใ
|
34 |
+
7. ไฝ่ชฟใๆชใ: ็บ็ฑใ้ ญ็ใๅใๆฐใชใฉใฎไฝ่ชฟไธ่ฏใๆใใฆใใๅฏ่ฝๆงใใใใพใใ
|
35 |
+
8. ใใคใฌใซ่กใใใ: ใใใคใๆฟกใใฆใใใใใใคใฌใซ่กใใใใฆๆณฃใใฆใใๅฏ่ฝๆงใใใใพใใ
|
36 |
+
9. ไฝใใๆฑใใฆใใ: ๆณจๆใๅผใใใใฃใใใๅฉใใๆฑใใฆใใๅฏ่ฝๆงใใใใพใใ
|
37 |
+
|
38 |
+
ๅญไพใฎ็ถๆณใใใ่ฆณๅฏใใๅฃฐใใใใฆ่ฉฑใ่ใใฆใฟใใใจใๅคงๅใงใใๅฟ
่ฆใซๅฟใใฆใไฟ่ญท่
ใ่ญฆๅฏใๆๆฅ่ปใๅผใถใชใฉใฎๅฏพๅฟใใใๅฟ
่ฆใใใใใใใใพใใใ
|
39 |
+
```
|
40 |
+
|
41 |
+
## Test environment
|
42 |
+
|
43 |
+
This model was tested using [text-generation-webui](https://github.com/oobabooga/text-generation-webui/tree/main). I use preset `min_p` and `Null preset` with temperature=0.3 for Generation.
|
44 |
+
|
45 |
+
|
46 |
+
## Usage
|
47 |
+
|
48 |
+
This format must be adhered to strictly, as deviations may result in less optimal outputs from the model.
|
49 |
+
|
50 |
+
The template used to construct a prompt for the Instruct model is specified as follows:
|
51 |
+
|
52 |
+
```
|
53 |
+
<s>[INST] <<SYS>>\n{SYSTEM_PROMPT}\n<</SYS>>\n\n{USER_MESSAGE_1} [/INST] {BOT_MESSAGE_1}</s>[INST] {USER_MESSAGE_2} [/INST]
|
54 |
+
```
|
55 |
+
|
56 |
+
|
57 |
+
Please be aware that ``<s>`` and ``</s>`` are special tokens used for the beginning of string (BOS) and end of string (EOS), respectively, while [INST] and [/INST] are considered regular strings.
|
58 |
+
|
59 |
+
For the "{SYSTEM_PROMPT}" part, We recommend using "ใใชใใฏๆฅๆฌ่ชใ่ฉฑใๅช็งใชใขใทในใฟใณใใงใใๅ็ญใซใฏๅฟ
ใๆฅๆฌ่ชใง็ญใใฆใใ ใใใใพใ่ใใ้็จใๅบๅใใฆใใ ใใใ"
|
60 |
+
|
61 |
+
For the "{USER_MESSAGE_1}" part, We recommend using {instruction}\n{input}
|
62 |
+
|
63 |
+
In other words, We recommend the following:
|
64 |
+
|
65 |
+
```
|
66 |
+
<s>[INST] <<SYS>>\nใใชใใฏๆฅๆฌ่ชใ่ฉฑใๅช็งใชใขใทในใฟใณใใงใใๅ็ญใซใฏๅฟ
ใๆฅๆฌ่ชใง็ญใใฆใใ ใใใใพใ่ใใ้็จใๅบๅใใฆใใ ใใใ\n<</SYS>>\n\n{instruction1}\n{input1} [/INST] {BOT_MESSAGE_1}</s>[INST] {instruction2}\n{input2} [/INST]
|
67 |
+
```
|
68 |
+
|
69 |
+
### Use the instruct model
|
70 |
+
|
71 |
+
```python
|
72 |
+
import torch
|
73 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
74 |
+
|
75 |
+
model_name = "nitky/Oumuamua-7b-instruct"
|
76 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
|
77 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
78 |
+
|
79 |
+
device = "cuda"
|
80 |
+
|
81 |
+
messages = [
|
82 |
+
{"role": "system", "content": "ใใชใใฏๆฅๆฌ่ชใ่ฉฑใๅช็งใชใขใทในใฟใณใใงใใๅ็ญใซใฏๅฟ
ใๆฅๆฌ่ชใง็ญใใฆใใ ใใใใพใ่ใใ้็จใๅบๅใใฆใใ ใใใ"},
|
83 |
+
{"role": "user", "content": "้่ทฏใงๆณฃใใฆใใๅญไพใใใพใใใใฎๅญไพใซใฏไฝใใใฃใใจ่ใใใใพใใ๏ผ"}
|
84 |
+
]
|
85 |
+
|
86 |
+
encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")
|
87 |
+
|
88 |
+
model_inputs = encodeds.to(device)
|
89 |
+
model.to(device)
|
90 |
+
|
91 |
+
generated_ids = model.generate(model_inputs, max_new_tokens=256, do_sample=True, temperature=0.3)
|
92 |
+
decoded = tokenizer.batch_decode(generated_ids)
|
93 |
+
print(decoded[0])
|
94 |
+
```
|
95 |
+
|
96 |
+
## Merge Details
|
97 |
+
### Merge Method
|
98 |
+
|
99 |
+
This model was merged using the [Model Stock](https://arxiv.org/abs/2403.19522) merge method using [nitky/Oumuamua-7b-base](https://huggingface.co/nitky/Oumuamua-7b-base) as a base.
|
100 |
+
|
101 |
+
### Models Merged
|
102 |
+
|
103 |
+
The following models were included in the merge:
|
104 |
+
* [stabilityai/japanese-stablelm-base-gamma-7b](https://huggingface.co/stabilityai/japanese-stablelm-base-gamma-7b)
|
105 |
+
* [tokyotech-llm/Swallow-MS-7b-v0.1](https://huggingface.co/tokyotech-llm/Swallow-MS-7b-v0.1)
|
106 |
+
* [DataPilot/ArrowPro-7B-KillerWhale](https://huggingface.co/DataPilot/ArrowPro-7B-KillerWhale)
|
107 |
+
* [nitky/RP-7b-instruct](https://huggingface.co/nitky/RP-7b-instruct)
|
108 |
+
* [mistralai/Mistral-7B-Instruct-v0.3](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3)
|
109 |
+
* [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
|
110 |
+
|
111 |
+
### Configuration
|
112 |
+
|
113 |
+
The following YAML configuration was used to produce this model:
|
114 |
+
|
115 |
+
```yaml
|
116 |
+
merge_method: task_arithmetic
|
117 |
+
base_model: mistralai/Mistral-7B-v0.1
|
118 |
+
models:
|
119 |
+
- model: tokyotech-llm/Swallow-MS-7b-v0.1
|
120 |
+
parameters:
|
121 |
+
weight:
|
122 |
+
- filter: embed_tokens
|
123 |
+
value: 1.0
|
124 |
+
- value: 0
|
125 |
+
dtype: bfloat16
|
126 |
+
tokenizer_source: model:tokyotech-llm/Swallow-MS-7b-v0.1
|
127 |
+
name: Mistral-7B-v0.1-VE-Swallow-MS
|
128 |
+
---
|
129 |
+
merge_method: task_arithmetic
|
130 |
+
base_model: stabilityai/japanese-stablelm-base-gamma-7b
|
131 |
+
models:
|
132 |
+
- model: tokyotech-llm/Swallow-MS-7b-v0.1
|
133 |
+
parameters:
|
134 |
+
weight:
|
135 |
+
- filter: embed_tokens
|
136 |
+
value: 1.0
|
137 |
+
- value: 0
|
138 |
+
dtype: bfloat16
|
139 |
+
tokenizer_source: model:tokyotech-llm/Swallow-MS-7b-v0.1
|
140 |
+
name: japanese-stablelm-base-gamma-7b-VE-Swallow-MS
|
141 |
+
---
|
142 |
+
merge_method: task_arithmetic
|
143 |
+
base_model: DataPilot/ArrowPro-7B-KillerWhale
|
144 |
+
models:
|
145 |
+
- model: tokyotech-llm/Swallow-MS-7b-v0.1
|
146 |
+
parameters:
|
147 |
+
weight:
|
148 |
+
- filter: embed_tokens
|
149 |
+
value: 1.0
|
150 |
+
- value: 0
|
151 |
+
dtype: bfloat16
|
152 |
+
tokenizer_source: model:tokyotech-llm/Swallow-MS-7b-v0.1
|
153 |
+
name: ArrowPro-7B-KillerWhale-VE-Swallow-MS
|
154 |
+
---
|
155 |
+
merge_method: task_arithmetic
|
156 |
+
base_model: nitky/RP-7b-instruct
|
157 |
+
models:
|
158 |
+
- model: tokyotech-llm/Swallow-MS-7b-v0.1
|
159 |
+
parameters:
|
160 |
+
weight:
|
161 |
+
- filter: embed_tokens
|
162 |
+
value: 1.0
|
163 |
+
- value: 0
|
164 |
+
dtype: bfloat16
|
165 |
+
tokenizer_source: model:tokyotech-llm/Swallow-MS-7b-v0.1
|
166 |
+
name: RP-7b-instruct-VE-Swallow-MS
|
167 |
+
---
|
168 |
+
merge_method: task_arithmetic
|
169 |
+
base_model: mistralai/Mistral-7B-Instruct-v0.3
|
170 |
+
models:
|
171 |
+
- model: tokyotech-llm/Swallow-MS-7b-v0.1
|
172 |
+
parameters:
|
173 |
+
weight:
|
174 |
+
- filter: embed_tokens
|
175 |
+
value: 1.0
|
176 |
+
- value: 0
|
177 |
+
dtype: bfloat16
|
178 |
+
tokenizer_source: model:tokyotech-llm/Swallow-MS-7b-v0.1
|
179 |
+
name: Mistral-7B-Instruct-v0.3-VE-Swallow-MS
|
180 |
+
---
|
181 |
+
merge_method: linear
|
182 |
+
models:
|
183 |
+
- model: nitky/Oumuamua-7b-base
|
184 |
+
parameters:
|
185 |
+
weight: 1.0
|
186 |
+
- model: tokyotech-llm/Swallow-MS-7b-instruct-v0.1
|
187 |
+
parameters:
|
188 |
+
weight: 0.8
|
189 |
+
- model: tokyotech-llm/Swallow-MS-7b-v0.1
|
190 |
+
parameters:
|
191 |
+
weight: -0.8
|
192 |
+
- model: Mistral-7B-Instruct-v0.3-VE-Swallow-MS
|
193 |
+
parameters:
|
194 |
+
weight: 0.8
|
195 |
+
- model: Mistral-7B-v0.1-VE-Swallow-MS
|
196 |
+
parameters:
|
197 |
+
weight: -0.8
|
198 |
+
dtype: bfloat16
|
199 |
+
name: Oumuamua-7b-instruct-alpha
|
200 |
+
---
|
201 |
+
merge_method: linear
|
202 |
+
models:
|
203 |
+
- model: nitky/Oumuamua-7b-base
|
204 |
+
parameters:
|
205 |
+
weight: 1.0
|
206 |
+
- model: ArrowPro-7B-KillerWhale-VE-Swallow-MS # include Mistral-7B-Instruct-v0.3
|
207 |
+
parameters:
|
208 |
+
weight: 0.8
|
209 |
+
- model: japanese-stablelm-base-gamma-7b-VE-Swallow-MS
|
210 |
+
parameters:
|
211 |
+
weight: -0.8
|
212 |
+
dtype: bfloat16
|
213 |
+
name: Oumuamua-7b-instruct-beta
|
214 |
+
---
|
215 |
+
merge_method: linear
|
216 |
+
models:
|
217 |
+
- model: nitky/Oumuamua-7b-base
|
218 |
+
parameters:
|
219 |
+
weight: 1.0
|
220 |
+
- model: RP-7b-instruct-VE-Swallow-MS
|
221 |
+
parameters:
|
222 |
+
weight: 0.8
|
223 |
+
- model: japanese-stablelm-base-gamma-7b-VE-Swallow-MS
|
224 |
+
parameters:
|
225 |
+
weight: -0.8
|
226 |
+
- model: Mistral-7B-Instruct-v0.3-VE-Swallow-MS
|
227 |
+
parameters:
|
228 |
+
weight: 0.8
|
229 |
+
- model: Mistral-7B-v0.1-VE-Swallow-MS
|
230 |
+
parameters:
|
231 |
+
weight: -0.8
|
232 |
+
dtype: bfloat16
|
233 |
+
name: Oumuamua-7b-instruct-gamma
|
234 |
+
---
|
235 |
+
merge_method: model_stock
|
236 |
+
base_model: nitky/Oumuamua-7b-base
|
237 |
+
models:
|
238 |
+
- model: Oumuamua-7b-instruct-alpha
|
239 |
+
- model: Oumuamua-7b-instruct-beta
|
240 |
+
- model: Oumuamua-7b-instruct-gamma
|
241 |
+
dtype: bfloat16
|
242 |
+
name: Oumuamua-7b-instruct
|
243 |
+
```
|