munish0838 commited on
Commit
772ff0a
โ€ข
1 Parent(s): 1178013

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +243 -0
README.md ADDED
@@ -0,0 +1,243 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ```