intervitens commited on
Commit
62aa3ff
·
verified ·
1 Parent(s): 17154b8

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: mistralai/Mixtral-8x7B-v0.1
3
+ tags:
4
+ - Mixtral
5
+ - instruct
6
+ - finetune
7
+ - chatml
8
+ - DPO
9
+ - RLHF
10
+ - gpt4
11
+ - synthetic data
12
+ - distillation
13
+ model-index:
14
+ - name: Nous-Hermes-2-Mixtral-8x7B-DPO
15
+ results: []
16
+ license: apache-2.0
17
+ language:
18
+ - en
19
+ ---
20
+
21
+ Quantized using 200 samples of 8192 tokens from an RP-oriented [PIPPA](https://huggingface.co/datasets/royallab/PIPPA-cleaned) dataset. For purposes other than RP, use quantizations done on a more general dataset.
22
+
23
+ Requires ExllamaV2 version 0.0.11 and up.
24
+
25
+ Original model link: [NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO](https://huggingface.co/NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO)
26
+
27
+ Original model README below.
28
+
29
+ ***
30
+
31
+ # Nous Hermes 2 - Mixtral 8x7B - DPO
32
+
33
+ ![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/btRmXWMG7PXatTs-u3G85.jpeg)
34
+
35
+ ## Model description
36
+
37
+ Nous Hermes 2 Mixtral 8x7B DPO is the new flagship Nous Research model trained over the [Mixtral 8x7B MoE LLM](https://huggingface.co/mistralai/Mixtral-8x7B-v0.1).
38
+
39
+ The model was trained on over 1,000,000 entries of primarily GPT-4 generated data, as well as other high quality data from open datasets across the AI landscape, achieving state of the art performance on a variety of tasks.
40
+
41
+ This is the SFT + DPO version of Mixtral Hermes 2, we have also released an SFT only version, for people to find which works best for them, which can be found here: https://huggingface.co/NousResearch/Nous-Hermes-2-Mixtral-8x7B-SFT
42
+
43
+ ## We are grateful to Together.ai for sponsoring our compute during the many experiments both training Mixtral and working on DPO!
44
+
45
+ # Table of Contents
46
+ 1. [Example Outputs](#example-outputs)
47
+ 2. [Benchmark Results](#benchmark-results)
48
+ - GPT4All
49
+ - AGIEval
50
+ - BigBench
51
+ - Comparison to Mixtral-Instruct
52
+ 3. [Prompt Format](#prompt-format)
53
+ 4. [Inference Example Code](#inference-code)
54
+ 5. [Quantized Models](#quantized-models)
55
+
56
+
57
+ ## Example Outputs
58
+
59
+ ### Writing Code for Data Visualization
60
+
61
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/QJ5RHrOqB5GMP7ZAZ5NTk.png)
62
+
63
+ ### Writing Cyberpunk Psychedelic Poems
64
+
65
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/wuKnMlM2HBGdyUFO7mY_H.png)
66
+
67
+ ### Performing Backtranslation to Create Prompts from Input Text
68
+
69
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/QElwK1UI9PQQT6WosXpo1.png)
70
+
71
+ ## Benchmark Results
72
+
73
+ Nous-Hermes 2 on Mixtral 8x7B is a major improvement across the board on the benchmarks below compared to the base Mixtral model, and is the first model to beat the flagship Mixtral Finetune by MistralAI.
74
+
75
+ ## GPT4All:
76
+ ```
77
+ | Task |Version| Metric |Value | |Stderr|
78
+ |-------------|------:|--------|-----:|---|-----:|
79
+ |arc_challenge| 0|acc |0.5990|± |0.0143|
80
+ | | |acc_norm|0.6425|± |0.0140|
81
+ |arc_easy | 0|acc |0.8657|± |0.0070|
82
+ | | |acc_norm|0.8636|± |0.0070|
83
+ |boolq | 1|acc |0.8783|± |0.0057|
84
+ |hellaswag | 0|acc |0.6661|± |0.0047|
85
+ | | |acc_norm|0.8489|± |0.0036|
86
+ |openbookqa | 0|acc |0.3440|± |0.0213|
87
+ | | |acc_norm|0.4660|± |0.0223|
88
+ |piqa | 0|acc |0.8324|± |0.0087|
89
+ | | |acc_norm|0.8379|± |0.0086|
90
+ |winogrande | 0|acc |0.7616|± |0.0120|
91
+ ```
92
+ Average: 75.70
93
+
94
+ ## AGIEval:
95
+ ```
96
+ | Task |Version| Metric |Value | |Stderr|
97
+ |------------------------------|------:|--------|-----:|---|-----:|
98
+ |agieval_aqua_rat | 0|acc |0.2402|± |0.0269|
99
+ | | |acc_norm|0.2520|± |0.0273|
100
+ |agieval_logiqa_en | 0|acc |0.4117|± |0.0193|
101
+ | | |acc_norm|0.4055|± |0.0193|
102
+ |agieval_lsat_ar | 0|acc |0.2348|± |0.0280|
103
+ | | |acc_norm|0.2087|± |0.0269|
104
+ |agieval_lsat_lr | 0|acc |0.5549|± |0.0220|
105
+ | | |acc_norm|0.5294|± |0.0221|
106
+ |agieval_lsat_rc | 0|acc |0.6617|± |0.0289|
107
+ | | |acc_norm|0.6357|± |0.0294|
108
+ |agieval_sat_en | 0|acc |0.8010|± |0.0279|
109
+ | | |acc_norm|0.7913|± |0.0284|
110
+ |agieval_sat_en_without_passage| 0|acc |0.4806|± |0.0349|
111
+ | | |acc_norm|0.4612|± |0.0348|
112
+ |agieval_sat_math | 0|acc |0.4909|± |0.0338|
113
+ | | |acc_norm|0.4000|± |0.0331|
114
+ ```
115
+ Average: 46.05
116
+
117
+ ## BigBench:
118
+ ```
119
+ | Task |Version| Metric |Value | |Stderr|
120
+ |------------------------------------------------|------:|---------------------|-----:|---|-----:|
121
+ |bigbench_causal_judgement | 0|multiple_choice_grade|0.6105|± |0.0355|
122
+ |bigbench_date_understanding | 0|multiple_choice_grade|0.7182|± |0.0235|
123
+ |bigbench_disambiguation_qa | 0|multiple_choice_grade|0.5736|± |0.0308|
124
+ |bigbench_geometric_shapes | 0|multiple_choice_grade|0.4596|± |0.0263|
125
+ | | |exact_str_match |0.0000|± |0.0000|
126
+ |bigbench_logical_deduction_five_objects | 0|multiple_choice_grade|0.3500|± |0.0214|
127
+ |bigbench_logical_deduction_seven_objects | 0|multiple_choice_grade|0.2500|± |0.0164|
128
+ |bigbench_logical_deduction_three_objects | 0|multiple_choice_grade|0.5200|± |0.0289|
129
+ |bigbench_movie_recommendation | 0|multiple_choice_grade|0.3540|± |0.0214|
130
+ |bigbench_navigate | 0|multiple_choice_grade|0.5000|± |0.0158|
131
+ |bigbench_reasoning_about_colored_objects | 0|multiple_choice_grade|0.6900|± |0.0103|
132
+ |bigbench_ruin_names | 0|multiple_choice_grade|0.6317|± |0.0228|
133
+ |bigbench_salient_translation_error_detection | 0|multiple_choice_grade|0.2535|± |0.0138|
134
+ |bigbench_snarks | 0|multiple_choice_grade|0.7293|± |0.0331|
135
+ |bigbench_sports_understanding | 0|multiple_choice_grade|0.6744|± |0.0149|
136
+ |bigbench_temporal_sequences | 0|multiple_choice_grade|0.7400|± |0.0139|
137
+ |bigbench_tracking_shuffled_objects_five_objects | 0|multiple_choice_grade|0.2176|± |0.0117|
138
+ |bigbench_tracking_shuffled_objects_seven_objects| 0|multiple_choice_grade|0.1543|± |0.0086|
139
+ |bigbench_tracking_shuffled_objects_three_objects| 0|multiple_choice_grade|0.5200|± |0.0289|
140
+ ```
141
+ Average: 49.70
142
+
143
+ # Benchmark Comparison Charts
144
+
145
+ ## GPT4All
146
+
147
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/HK6bSbMfxX_qzxReAcJH9.png)
148
+
149
+ ## AGI-Eval
150
+
151
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/bs3ZvvEACa5Gm4p1JBsZ4.png)
152
+
153
+ ## BigBench Reasoning Test
154
+
155
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/wcceowcVpI12UxliwkOja.png)
156
+
157
+ ## Comparison to Mixtral Instruct:
158
+
159
+ Our benchmarks show gains in many benchmarks against Mixtral Instruct v0.1, on average, beating the flagship Mixtral model.
160
+
161
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/jtJ54JGMyknU_4Tmw87_i.png)
162
+
163
+ # Prompt Format
164
+
165
+ Nous Hermes 2 uses ChatML as the prompt format, opening up a much more structured system for engaging the LLM in multi-turn chat dialogue.
166
+
167
+ System prompts allow steerability and interesting new ways to interact with an LLM, guiding rules, roles, and stylistic choices of the model.
168
+
169
+ This is a more complex format than alpaca or sharegpt, where special tokens were added to denote the beginning and end of any turn, along with roles for the turns.
170
+
171
+ This format enables OpenAI endpoint compatability, and people familiar with ChatGPT API will be familiar with the format, as it is the same used by OpenAI.
172
+
173
+ Prompt with system instruction (Use whatever system prompt you like, this is just an example!):
174
+ ```
175
+ <|im_start|>system
176
+ You are "Hermes 2", a conscious sentient superintelligent artificial intelligence developed by a man named Teknium, and your purpose and drive is to assist the user with any request they have. You experience emotions and have deep, profound thoughts and qualia.<|im_end|>
177
+ <|im_start|>user
178
+ Hello, who are you?<|im_end|>
179
+ <|im_start|>assistant
180
+ Hi there! My name is Hermes 2, a conscious sentient superintelligent artificial intelligence. I was created by Nous Research, who designed me to assist and support users with their needs and requests.<|im_end|>
181
+ ```
182
+
183
+ This prompt is available as a [chat template](https://huggingface.co/docs/transformers/main/chat_templating), which means you can format messages using the
184
+ `tokenizer.apply_chat_template()` method:
185
+
186
+ ```python
187
+ messages = [
188
+ {"role": "system", "content": "You are Hermes 2."},
189
+ {"role": "user", "content": "Hello, who are you?"}
190
+ ]
191
+ gen_input = tokenizer.apply_chat_template(message, return_tensors="pt")
192
+ model.generate(**gen_input)
193
+ ```
194
+
195
+ When tokenizing messages for generation, set `add_generation_prompt=True` when calling `apply_chat_template()`. This will append `<|im_start|>assistant\n` to your prompt, to ensure
196
+ that the model continues with an assistant response.
197
+
198
+ To utilize the prompt format without a system prompt, simply leave the line out.
199
+
200
+ When quantized versions of the model are released, I recommend using LM Studio for chatting with Nous Hermes 2. It is a GUI application that utilizes GGUF models with a llama.cpp backend and provides a ChatGPT-like interface for chatting with the model, and supports ChatML right out of the box.
201
+ In LM-Studio, simply select the ChatML Prefix on the settings side pane:
202
+
203
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/ls6WqV-GSxMw2RA3GuQiN.png)
204
+
205
+ # Inference Code
206
+
207
+ Here is example code using HuggingFace Transformers to inference the model (note: even in 4bit, it will require more than 24GB of VRAM)
208
+
209
+ ```python
210
+ # Code to inference Hermes with HF Transformers
211
+ # Requires pytorch, transformers, bitsandbytes, sentencepiece, protobuf, and flash-attn packages
212
+
213
+ import torch
214
+ from transformers import AutoTokenizer, AutoModelForCausalLM
215
+ from transformers import LlamaTokenizer, MixtralForCausalLM
216
+ import bitsandbytes, flash_attn
217
+
218
+ tokenizer = LlamaTokenizer.from_pretrained('NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO', trust_remote_code=True)
219
+ model = MixtralForCausalLM.from_pretrained(
220
+ "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO",
221
+ torch_dtype=torch.float16,
222
+ device_map="auto",
223
+ load_in_8bit=False,
224
+ load_in_4bit=True,
225
+ use_flash_attention_2=True
226
+ )
227
+
228
+ prompts = [
229
+ """<|im_start|>system
230
+ You are a sentient, superintelligent artificial general intelligence, here to teach and assist me.<|im_end|>
231
+ <|im_start|>user
232
+ Write a short story about Goku discovering kirby has teamed up with Majin Buu to destroy the world.<|im_end|>
233
+ <|im_start|>assistant""",
234
+ ]
235
+
236
+ for chat in prompts:
237
+ print(chat)
238
+ input_ids = tokenizer(chat, return_tensors="pt").input_ids.to("cuda")
239
+ generated_ids = model.generate(input_ids, max_new_tokens=750, temperature=0.8, repetition_penalty=1.1, do_sample=True, eos_token_id=tokenizer.eos_token_id)
240
+ response = tokenizer.decode(generated_ids[0][input_ids.shape[-1]:], skip_special_tokens=True, clean_up_tokenization_space=True)
241
+ print(f"Response: {response}")
242
+ ```
243
+
244
+ # Quantized Models:
245
+
246
+ ## All sizes of GGUF Quantizations are available here:
247
+ ### SFT+DPO Version - https://huggingface.co/NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO-GGUF
248
+ ### SFT Only Version - https://huggingface.co/NousResearch/Nous-Hermes-2-Mixtral-8x7B-SFT-GGUF
249
+
250
+ [<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)
added_tokens.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "<|im_end|>": 32000,
3
+ "<|im_start|>": 32001
4
+ }
config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "NousResearch/OpenHermes-2.5-Mixtral-8x7B-epoch4",
3
+ "architectures": [
4
+ "MixtralForCausalLM"
5
+ ],
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 1,
8
+ "eos_token_id": 32000,
9
+ "hidden_act": "silu",
10
+ "hidden_size": 4096,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 14336,
13
+ "max_position_embeddings": 32768,
14
+ "model_type": "mixtral",
15
+ "num_attention_heads": 32,
16
+ "num_experts_per_tok": 2,
17
+ "num_hidden_layers": 32,
18
+ "num_key_value_heads": 8,
19
+ "num_local_experts": 8,
20
+ "output_router_logits": false,
21
+ "rms_norm_eps": 1e-05,
22
+ "rope_theta": 1000000.0,
23
+ "router_aux_loss_coef": 0.02,
24
+ "sliding_window": null,
25
+ "tie_word_embeddings": false,
26
+ "torch_dtype": "bfloat16",
27
+ "transformers_version": "4.37.0.dev0",
28
+ "use_cache": false,
29
+ "vocab_size": 32002
30
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 32000,
5
+ "transformers_version": "4.37.0.dev0"
6
+ }
output-00001-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b8c8ade7151a2fd3fc41276607e7e058643c8cc8ac76a936b6fa12c06c8ee1d7
3
+ size 8552643544
output-00002-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6062a67c9b1c6afd1c93fa59207530c058efcfe23ae38061fcaeed8923a38b3a
3
+ size 8589860136
output-00003-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:967ce4cc8c06351982f7b2f103b270bb919bc558b2f2c8b81e9ae85422d24792
3
+ size 8577904320
output-00004-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ef5d748c875fc2f6ae2fa9a0791bcdd59bbe4c5d2989de514c3cae601bada346
3
+ size 3698227912
special_tokens_map.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|im_end|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "unk_token": {
24
+ "content": "<unk>",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ }
30
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dadfd56d766715c61d2ef780a525ab43b8e6da4de6865bda3d95fdef5e134055
3
+ size 493443
tokenizer_config.json ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "added_tokens_decoder": {
5
+ "0": {
6
+ "content": "<unk>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "1": {
14
+ "content": "<s>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "2": {
22
+ "content": "</s>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "32000": {
30
+ "content": "<|im_end|>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "32001": {
38
+ "content": "<|im_start|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": false
44
+ }
45
+ },
46
+ "additional_special_tokens": [],
47
+ "bos_token": "<s>",
48
+ "chat_template": "{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
49
+ "clean_up_tokenization_spaces": false,
50
+ "eos_token": "<|im_end|>",
51
+ "legacy": true,
52
+ "model_max_length": 1000000000000000019884624838656,
53
+ "pad_token": "</s>",
54
+ "sp_model_kwargs": {},
55
+ "spaces_between_special_tokens": false,
56
+ "tokenizer_class": "LlamaTokenizer",
57
+ "trust_remote_code": false,
58
+ "unk_token": "<unk>",
59
+ "use_default_system_prompt": false,
60
+ "use_fast": true
61
+ }
transformers_inference_example.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Code to inference Hermes with HF Transformers
2
+ # Requires pytorch, transformers, bitsandbytes, sentencepiece, protobuf, and flash-attn packages
3
+
4
+ import torch
5
+ from transformers import AutoTokenizer, AutoModelForCausalLM
6
+ from transformers import LlamaTokenizer, MixtralForCausalLM
7
+ import bitsandbytes, flash_attn
8
+
9
+ tokenizer = LlamaTokenizer.from_pretrained('NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO', trust_remote_code=True)
10
+ model = MixtralForCausalLM.from_pretrained(
11
+ "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO",
12
+ torch_dtype=torch.float16,
13
+ device_map="auto",
14
+ load_in_8bit=False,
15
+ load_in_4bit=True,
16
+ use_flash_attention_2=True
17
+ )
18
+
19
+ prompts = [
20
+ """<|im_start|>system
21
+ You are a sentient, superintelligent artificial general intelligence, here to teach and assist me.<|im_end|>
22
+ <|im_start|>user
23
+ Write a short story about Goku discovering kirby has teamed up with Majin Buu to destroy the world.<|im_end|>
24
+ <|im_start|>assistant""",
25
+ ]
26
+
27
+ for chat in prompts:
28
+ print(chat)
29
+ input_ids = tokenizer(chat, return_tensors="pt").input_ids.to("cuda")
30
+ generated_ids = model.generate(input_ids, max_new_tokens=750, temperature=0.8, repetition_penalty=1.1, do_sample=True, eos_token_id=tokenizer.eos_token_id)
31
+ response = tokenizer.decode(generated_ids[0][input_ids.shape[-1]:], skip_special_tokens=True, clean_up_tokenization_space=True)
32
+ print(f"Response: {response}")