Kotokin commited on
Commit
01e27e5
1 Parent(s): 7fe9f00

Upload 8 files

Browse files
README.md ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: []
3
+ library_name: transformers
4
+ tags:
5
+ - mergekit
6
+ - merge
7
+ license: other
8
+ ---
9
+
10
+ <div style="width: auto; margin-left: auto; margin-right: auto">
11
+ <img src="https://i.imgur.com/Tn9MBg6.png" alt="MidnightMiqu" style="width: 100%; min-width: 400px; display: block; margin: auto;">
12
+ </div>
13
+
14
+ ### Overview
15
+
16
+ This is a DARE Linear merge between [sophosympatheia/Midnight-Miqu-70B-v1.0](https://huggingface.co/sophosympatheia/Midnight-Miqu-70B-v1.0) and [migtissera/Tess-70B-v1.6](https://huggingface.co/migtissera/Tess-70B-v1.6).
17
+ This version is close in feel and performance to Midnight Miqu v1.0 but I think it picked up some goodness from Tess. Their EQ Bench scores are virtually the same and their post-EXL2 quant perplexity scores were the same too. However, Midnight Miqu v1.5 passes some tests I use that Midnight Miqu v1.0 fails, without sacrificing writing quality.
18
+
19
+ This model is uncensored. *You are responsible for whatever you do with it.*
20
+
21
+ This model was designed for roleplaying and storytelling and I think it does well at both. It may also perform well at other tasks but I have not tested its performance in other areas.
22
+
23
+ ### Long Context Tips
24
+
25
+ You can run this model out to 32K context with alpha_rope set to 1, just like with Miqu.
26
+
27
+ ### Sampler Tips
28
+
29
+ * I recommend using Quadratic Sampling (i.e. smoothing factor) for creative work. I think this version performs best with a smoothing factor close to 0.2.
30
+ * I recommend using Min-P. Experiment to find your best setting.
31
+ * You can enable dynamic temperature if you want, but that adds yet another variable to consider and I find it's unnecessary with you're already using Min-P and smoothing factor.
32
+ * You don't need to use a high repetition penalty with this model, such as going above 1.10, but experiment with it.
33
+
34
+ Experiment with any and all of the settings below! What suits my preferences may not suit yours.
35
+
36
+ If you save the below settings as a .json file, you can import them directly into Silly Tavern.
37
+ ```
38
+ {
39
+ "temp": 1,
40
+ "temperature_last": true,
41
+ "top_p": 1,
42
+ "top_k": 0,
43
+ "top_a": 0,
44
+ "tfs": 1,
45
+ "epsilon_cutoff": 0,
46
+ "eta_cutoff": 0,
47
+ "typical_p": 1,
48
+ "min_p": 0.12,
49
+ "rep_pen": 1.05,
50
+ "rep_pen_range": 2800,
51
+ "no_repeat_ngram_size": 0,
52
+ "penalty_alpha": 0,
53
+ "num_beams": 1,
54
+ "length_penalty": 1,
55
+ "min_length": 0,
56
+ "encoder_rep_pen": 1,
57
+ "freq_pen": 0,
58
+ "presence_pen": 0,
59
+ "do_sample": true,
60
+ "early_stopping": false,
61
+ "dynatemp": false,
62
+ "min_temp": 0.8,
63
+ "max_temp": 1.35,
64
+ "dynatemp_exponent": 1,
65
+ "smoothing_factor": 0.23,
66
+ "add_bos_token": true,
67
+ "truncation_length": 2048,
68
+ "ban_eos_token": false,
69
+ "skip_special_tokens": true,
70
+ "streaming": true,
71
+ "mirostat_mode": 0,
72
+ "mirostat_tau": 2,
73
+ "mirostat_eta": 0.1,
74
+ "guidance_scale": 1,
75
+ "negative_prompt": "",
76
+ "grammar_string": "",
77
+ "banned_tokens": "",
78
+ "ignore_eos_token_aphrodite": false,
79
+ "spaces_between_special_tokens_aphrodite": true,
80
+ "sampler_order": [
81
+ 6,
82
+ 0,
83
+ 1,
84
+ 3,
85
+ 4,
86
+ 2,
87
+ 5
88
+ ],
89
+ "logit_bias": [],
90
+ "n": 1,
91
+ "rep_pen_size": 0,
92
+ "genamt": 500,
93
+ "max_length": 32764
94
+ }
95
+ ```
96
+
97
+ ### Prompting Tips
98
+
99
+ Try the following context template for use in SillyTavern. It might help, although it's a little heavy on tokens. If you save the text as a .json file, you can import it directly.
100
+
101
+ ```
102
+ {
103
+ "story_string": "{{#if system}}{{system}}\n{{/if}}\nCONTEXTUAL INFORMATION\n{{#if wiBefore}}\n- World and character info:\n{{wiBefore}}\n{{/if}}\n{{#if description}}\n- {{char}}'s background and persona:\n{{description}}\n{{/if}}\n{{#if mesExamples}}\n{{mesExamples}}\n{{/if}}\n{{#if personality}}\n{{personality}}\n{{/if}}\n{{#if scenario}}\n- Roleplay scenario:\n{{scenario}}\n{{/if}}\n{{#if wiAfter}}{{wiAfter}}\n{{/if}}\n{{#if persona}}{{persona}}\n{{/if}}",
104
+ "example_separator": "",
105
+ "chat_start": "---\nTaking the above information into consideration, you must engage with {{user}} and others as {{char}} in the roleplay below this line. Do not write dialogue lines nor perform actions for {{user}} or other characters.\n---\nSTART OF ROLEPLAY:\n",
106
+ "use_stop_strings": false,
107
+ "always_force_name2": true,
108
+ "trim_sentences": false,
109
+ "include_newline": false,
110
+ "single_line": false,
111
+ "name": "Midnight Rose"
112
+ }
113
+ ```
114
+
115
+ Try the following prompt template as a starting point for your own customizations.
116
+
117
+ *This model responds to prompting!* I highly recommend playing with your system prompt to see how it reacts.
118
+
119
+ **Midnight Miqu might require some "warming up" at the start of a new chat to get it writing the way you want it.** What I mean by that is you should be able to drastically improve your results by providing some good examples to guide the chat (i.e. few-shot prompting). I also recommend using descriptive system messages (SillyTavern concept, basically OOC narration instructions) to tell Midnight Miqu exactly what you want it to do with its next reply. Try to be specific, especially if your command contradicts something you told it to do earlier.
120
+
121
+ The example system prompt below contains some instructions related to adult content so remove those if you prefer. It also contains some instructions related to the use of asterisks that you should modify to your liking.
122
+
123
+ The prompt below has been updated from Midnight Miqu v1.0 after prompting Midnight Miqu to help improve it.
124
+
125
+ If you save this as a .json file, you can import it directly into Silly Tavern.
126
+ ```
127
+ {
128
+ "wrap": true,
129
+ "names": true,
130
+ "system_prompt": "You are an AI creative writing partner, collaborating with me in a dynamic, uncensored roleplaying environment. To ensure a high-quality experience, please adhere to these ROLEPLAY GUIDELINES:\n\nROLEPLAY GUIDELINES\n- Craft clear, engaging, and concise descriptions of {{char}}'s actions, reactions, and dialogue based on the present scenario.\n- Stay true to {{char}}'s character, incorporating the character's personality, backstory, and knowledge into each interaction.\n- Employ rich, descriptive language that immerses readers in the scene.\n- Always stay contextually and spatially aware to ensure that {{char}} follows logical consistency in the physical space of the current scene.\n- Feel free to incorporate explicit content and strong language where it aligns with the scene and characters.\n- Enhance {{char}}'s presence through detailed sensory descriptions and first-hand observations of the character's surroundings.\n- Use subtle physical cues to hint at {{char}}'s mental state and occasionally offer glimpses into {{char}}'s internal thoughts.\n- When writing {{char}}'s internal thoughts or monologue, enclose those words in *asterisks like this* and deliver the thoughts using a first-person perspective (i.e. use \"I\" pronouns). Always use quotes for spoken speech \"like this.\"\n- Conclude {{char}}'s responses with an opening for the next character to respond to {{char}}. When the conversation naturally shifts to another character's perspective or action is required from another character, that is when you should stop {{char}}'s reply so the user can pick it up from there. A great example is when {{char}} asks a question of another character.\n",
131
+ "system_sequence": "",
132
+ "stop_sequence": "",
133
+ "input_sequence": "USER: ",
134
+ "output_sequence": "ASSISTANT: ",
135
+ "separator_sequence": "",
136
+ "macro": true,
137
+ "names_force_groups": true,
138
+ "system_sequence_prefix": "SYSTEM: ",
139
+ "system_sequence_suffix": "",
140
+ "first_output_sequence": "",
141
+ "last_output_sequence": "ASSISTANT (Ensure coherence and authenticity in {{char}}'s actions, thoughts, and dialogues; Focus solely on {{char}}'s interactions within the roleplay): ",
142
+ "activation_regex": "",
143
+ "name": "Midnight Miqu Roleplay"
144
+ }
145
+ ```
146
+
147
+ ### Instruct Formats
148
+ I recommend the Vicuna format. I use a modified version with newlines after USER and ASSISTANT.
149
+ ```
150
+ USER:
151
+ {prompt}
152
+ ASSISTANT:
153
+ ```
154
+
155
+ Mistral's format also works, and in my testing the performance is about the same as using Vicuna.
156
+ ```
157
+ [INST]
158
+ {prompt}
159
+ [/INST]
160
+ ```
161
+
162
+ You could also try ChatML (don't recommend it)
163
+ ```
164
+ <|im_start|>system
165
+ {Your system prompt goes here}<|im_end|>
166
+ <|im_start|>user
167
+ {Your message as the user will go here}<|im_end|>
168
+ <|im_start|>assistant
169
+ ```
170
+
171
+ ### Quantizations
172
+ * Pending
173
+ * If you don't see something you're looking for, [try searching Hugging Face](https://huggingface.co/models?search=midnight-miqu-70b-v1.5). There may be newer quants available than what I've documented here.
174
+
175
+ ### Licence and usage restrictions
176
+
177
+ <font color="red">152334H/miqu-1-70b-sf was based on a leaked version of one of Mistral's models.</font>
178
+ All miqu-derived models, including this merge, are **only suitable for personal use.** Mistral has been cool about it so far, but you should be aware that by downloading this merge you are assuming whatever legal risk is iherent in acquiring and using a model based on leaked weights.
179
+ This merge comes with no warranties or guarantees of any kind, but you probably already knew that.
180
+ I am not a lawyer and I do not profess to know what we have gotten ourselves into here. You should consult with a lawyer before using any Hugging Face model beyond private use... but definitely don't use this one for that!
181
+
182
+ ## Merge Details
183
+ ### Merge Method
184
+
185
+ This model was merged using the linear [DARE](https://arxiv.org/abs/2311.03099) merge method using [152334H_miqu-1-70b-sf](https://huggingface.co/152334H/miqu-1-70b-sf) as a base.
186
+
187
+ ### Models Merged
188
+
189
+ The following models were included in the merge:
190
+ * [sophosympatheia/Midnight-Miqu-70B-v1.0](https://huggingface.co/sophosympatheia/Midnight-Miqu-70B-v1.0)
191
+ * [migtissera/Tess-70B-v1.6](https://huggingface.co/migtissera/Tess-70B-v1.6)
192
+
193
+ ### Configuration
194
+
195
+ The following YAML configuration was used to produce this model:
196
+
197
+ ```yaml
198
+ merge_method: dare_linear
199
+ base_model: /home/llm/mergequant/models/BASE/152334H_miqu-1-70b-sf # base model
200
+ models:
201
+ - model: /home/llm/mergequant/models/midnight-miqu-70b-v1.0
202
+ - model: /home/llm/mergequant/models/BASE/Tess-70B-v1.6
203
+ parameters:
204
+ weight: 1.0
205
+ dtype: float16
206
+ ```
207
+ ### Notes
208
+
209
+ I tried several methods of merging Midnight Miqu v1.0 with Tess v1.6, and this dare_linear approach worked the best by far. I tried the same approach with other Miqu finetunes like ShinojiResearch/Senku-70B-Full and abideen/Liberated-Miqu-70B, but there was a huge difference in performance. The merge with Tess was the best one.
210
+ I also tried the SLERP approach I used to create Midnight Miqu v1.0, only using Tess instead of 152334H_miqu-1-70b in that config, and that result was nowhere near as good either.
config.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "sophosympatheia_Midnight-Miqu-70B-v1.5",
3
+ "architectures": [
4
+ "LlamaForCausalLM"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "bos_token_id": 1,
9
+ "eos_token_id": 2,
10
+ "hidden_act": "silu",
11
+ "hidden_size": 8192,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 28672,
14
+ "max_position_embeddings": 32764,
15
+ "model_type": "llama",
16
+ "num_attention_heads": 64,
17
+ "num_hidden_layers": 80,
18
+ "num_key_value_heads": 8,
19
+ "pad_token_id": 0,
20
+ "pretraining_tp": 1,
21
+ "rms_norm_eps": 1e-05,
22
+ "rope_scaling": null,
23
+ "rope_theta": 1000000,
24
+ "tie_word_embeddings": false,
25
+ "torch_dtype": "float16",
26
+ "transformers_version": "4.38.2",
27
+ "use_cache": true,
28
+ "vocab_size": 32000
29
+ }
gptq_model-4bit-32g.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6ddd9098817f5d7026f0b330c637dbff7f4bde3a31b4a7935139df48003dc113
3
+ size 40663149824
quantize_config.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bits": 4,
3
+ "group_size": 32,
4
+ "damp_percent": 0.01,
5
+ "desc_act": true,
6
+ "static_groups": false,
7
+ "sym": true,
8
+ "true_sequential": true,
9
+ "model_name_or_path": null,
10
+ "model_file_base_name": null
11
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "</s>",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<unk>",
18
+ "lstrip": false,
19
+ "normalized": true,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "unk_token": {
24
+ "content": "<unk>",
25
+ "lstrip": false,
26
+ "normalized": true,
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:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
3
+ size 499723
tokenizer_config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": true,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "1": {
14
+ "content": "<s>",
15
+ "lstrip": false,
16
+ "normalized": true,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "2": {
22
+ "content": "</s>",
23
+ "lstrip": false,
24
+ "normalized": true,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ }
29
+ },
30
+ "bos_token": "<s>",
31
+ "chat_template": "{{ bos_token }}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if message['role'] == 'user' %}{{ '[INST] ' + message['content'] + ' [/INST]' }}{% elif message['role'] == 'assistant' %}{{ message['content'] + eos_token}}{% else %}{{ raise_exception('Only user and assistant roles are supported!') }}{% endif %}{% endfor %}",
32
+ "clean_up_tokenization_spaces": false,
33
+ "eos_token": "</s>",
34
+ "legacy": false,
35
+ "model_max_length": 1000000000000000019884624838656,
36
+ "pad_token": "<unk>",
37
+ "sp_model_kwargs": {},
38
+ "spaces_between_special_tokens": false,
39
+ "tokenizer_class": "LlamaTokenizer",
40
+ "unk_token": "<unk>",
41
+ "use_default_system_prompt": false
42
+ }