TheBloke commited on
Commit
f2eac12
1 Parent(s): a9472ed

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +423 -0
README.md ADDED
@@ -0,0 +1,423 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Heralax/MistralMakise-Merged-13b
3
+ inference: false
4
+ license: apache-2.0
5
+ model_creator: Evan Armstrong
6
+ model_name: MistralMakise Merged 13B
7
+ model_type: llama
8
+ prompt_template: '## {{{{charname}}}}:
9
+
10
+ - You''re "{{{{charname}}}}" in this never-ending roleplay with "{{{{user}}}}".
11
+
12
+ ### Input:
13
+
14
+ {prompt}
15
+
16
+
17
+ ### Response:
18
+
19
+ (OOC) Understood. I will take this info into account for the roleplay. (end OOC)
20
+
21
+
22
+ ### New Roleplay:
23
+
24
+ ### Instruction:
25
+
26
+ #### {{{{char}}}}:
27
+
28
+ whatever the char says, this is the chat history
29
+
30
+ #### {{{{user}}}}:
31
+
32
+ whatever the user says, this is the chat history
33
+
34
+ ... repeated some number of times ...
35
+
36
+ ### Response 2 paragraphs, engaging, natural, authentic, descriptive, creative):
37
+
38
+ #### {{{{char}}}}:
39
+
40
+ '
41
+ quantized_by: TheBloke
42
+ ---
43
+ <!-- markdownlint-disable MD041 -->
44
+
45
+ <!-- header start -->
46
+ <!-- 200823 -->
47
+ <div style="width: auto; margin-left: auto; margin-right: auto">
48
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
49
+ </div>
50
+ <div style="display: flex; justify-content: space-between; width: 100%;">
51
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
52
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
53
+ </div>
54
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
55
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
56
+ </div>
57
+ </div>
58
+ <div style="text-align:center; margin-top: 0em; margin-bottom: 0em"><p style="margin-top: 0.25em; margin-bottom: 0em;">TheBloke's LLM work is generously supported by a grant from <a href="https://a16z.com">andreessen horowitz (a16z)</a></p></div>
59
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
60
+ <!-- header end -->
61
+
62
+ # MistralMakise Merged 13B - AWQ
63
+ - Model creator: [Evan Armstrong](https://huggingface.co/Heralax)
64
+ - Original model: [MistralMakise Merged 13B](https://huggingface.co/Heralax/MistralMakise-Merged-13b)
65
+
66
+ <!-- description start -->
67
+ ## Description
68
+
69
+ This repo contains AWQ model files for [Evan Armstrong's MistralMakise Merged 13B](https://huggingface.co/Heralax/MistralMakise-Merged-13b).
70
+
71
+
72
+ ### About AWQ
73
+
74
+ AWQ is an efficient, accurate and blazing-fast low-bit weight quantization method, currently supporting 4-bit quantization. Compared to GPTQ, it offers faster Transformers-based inference with equivalent or better quality compared to the most commonly used GPTQ settings.
75
+
76
+ It is supported by:
77
+
78
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
79
+ - [vLLM](https://github.com/vllm-project/vllm) - Llama and Mistral models only
80
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
81
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
82
+
83
+ <!-- description end -->
84
+ <!-- repositories-available start -->
85
+ ## Repositories available
86
+
87
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/MistralMakise-Merged-13B-AWQ)
88
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/MistralMakise-Merged-13B-GPTQ)
89
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/MistralMakise-Merged-13B-GGUF)
90
+ * [Evan Armstrong's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Heralax/MistralMakise-Merged-13b)
91
+ <!-- repositories-available end -->
92
+
93
+ <!-- prompt-template start -->
94
+ ## Prompt template: SillyTavern
95
+
96
+ ```
97
+ ## {{{{charname}}}}:
98
+ - You're "{{{{charname}}}}" in this never-ending roleplay with "{{{{user}}}}".
99
+ ### Input:
100
+ {prompt}
101
+
102
+ ### Response:
103
+ (OOC) Understood. I will take this info into account for the roleplay. (end OOC)
104
+
105
+ ### New Roleplay:
106
+ ### Instruction:
107
+ #### {{{{char}}}}:
108
+ whatever the char says, this is the chat history
109
+ #### {{{{user}}}}:
110
+ whatever the user says, this is the chat history
111
+ ... repeated some number of times ...
112
+ ### Response 2 paragraphs, engaging, natural, authentic, descriptive, creative):
113
+ #### {{{{char}}}}:
114
+
115
+ ```
116
+
117
+ <!-- prompt-template end -->
118
+ <!-- licensing start -->
119
+ ## Licensing
120
+
121
+ The creator of the source model has listed its license as `apache-2.0`, and this quantization has therefore used that same license.
122
+
123
+ As this model is based on Llama 2, it is also subject to the Meta Llama 2 license terms, and the license files for that are additionally included. It should therefore be considered as being claimed to be licensed under both licenses. I contacted Hugging Face for clarification on dual licensing but they do not yet have an official position. Should this change, or should Meta provide any feedback on this situation, I will update this section accordingly.
124
+
125
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [Evan Armstrong's MistralMakise Merged 13B](https://huggingface.co/Heralax/MistralMakise-Merged-13b).
126
+ <!-- licensing end -->
127
+ <!-- README_AWQ.md-provided-files start -->
128
+ ## Provided files, and AWQ parameters
129
+
130
+ For my first release of AWQ models, I am releasing 128g models only. I will consider adding 32g as well if there is interest, and once I have done perplexity and evaluation comparisons, but at this time 32g models are still not fully tested with AutoAWQ and vLLM.
131
+
132
+ Models are released as sharded safetensors files.
133
+
134
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
135
+ | ------ | ---- | -- | ----------- | ------- | ---- |
136
+ | [main](https://huggingface.co/TheBloke/MistralMakise-Merged-13B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 GB
137
+
138
+ <!-- README_AWQ.md-provided-files end -->
139
+
140
+ <!-- README_AWQ.md-text-generation-webui start -->
141
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
142
+
143
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
144
+
145
+ It is strongly recommended to use the text-generation-webui one-click-installers unless you're sure you know how to make a manual install.
146
+
147
+ 1. Click the **Model tab**.
148
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/MistralMakise-Merged-13B-AWQ`.
149
+ 3. Click **Download**.
150
+ 4. The model will start downloading. Once it's finished it will say "Done".
151
+ 5. In the top left, click the refresh icon next to **Model**.
152
+ 6. In the **Model** dropdown, choose the model you just downloaded: `MistralMakise-Merged-13B-AWQ`
153
+ 7. Select **Loader: AutoAWQ**.
154
+ 8. Click Load, and the model will load and is now ready for use.
155
+ 9. If you want any custom settings, set them and then click **Save settings for this model** followed by **Reload the Model** in the top right.
156
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
157
+ <!-- README_AWQ.md-text-generation-webui end -->
158
+
159
+ <!-- README_AWQ.md-use-from-vllm start -->
160
+ ## Multi-user inference server: vLLM
161
+
162
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
163
+
164
+ - Please ensure you are using vLLM version 0.2 or later.
165
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
166
+
167
+ For example:
168
+
169
+ ```shell
170
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/MistralMakise-Merged-13B-AWQ --quantization awq
171
+ ```
172
+
173
+ - When using vLLM from Python code, again set `quantization=awq`.
174
+
175
+ For example:
176
+
177
+ ```python
178
+ from vllm import LLM, SamplingParams
179
+
180
+ prompts = [
181
+ "Tell me about AI",
182
+ "Write a story about llamas",
183
+ "What is 291 - 150?",
184
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
185
+ ]
186
+ prompt_template=f'''## {{{{charname}}}}:
187
+ - You're "{{{{charname}}}}" in this never-ending roleplay with "{{{{user}}}}".
188
+ ### Input:
189
+ {prompt}
190
+
191
+ ### Response:
192
+ (OOC) Understood. I will take this info into account for the roleplay. (end OOC)
193
+
194
+ ### New Roleplay:
195
+ ### Instruction:
196
+ #### {{{{char}}}}:
197
+ whatever the char says, this is the chat history
198
+ #### {{{{user}}}}:
199
+ whatever the user says, this is the chat history
200
+ ... repeated some number of times ...
201
+ ### Response 2 paragraphs, engaging, natural, authentic, descriptive, creative):
202
+ #### {{{{char}}}}:
203
+ '''
204
+
205
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
206
+
207
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
208
+
209
+ llm = LLM(model="TheBloke/MistralMakise-Merged-13B-AWQ", quantization="awq", dtype="auto")
210
+
211
+ outputs = llm.generate(prompts, sampling_params)
212
+
213
+ # Print the outputs.
214
+ for output in outputs:
215
+ prompt = output.prompt
216
+ generated_text = output.outputs[0].text
217
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
218
+ ```
219
+ <!-- README_AWQ.md-use-from-vllm start -->
220
+
221
+ <!-- README_AWQ.md-use-from-tgi start -->
222
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
223
+
224
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
225
+
226
+ Example Docker parameters:
227
+
228
+ ```shell
229
+ --model-id TheBloke/MistralMakise-Merged-13B-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
230
+ ```
231
+
232
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
233
+
234
+ ```shell
235
+ pip3 install huggingface-hub
236
+ ```
237
+
238
+ ```python
239
+ from huggingface_hub import InferenceClient
240
+
241
+ endpoint_url = "https://your-endpoint-url-here"
242
+
243
+ prompt = "Tell me about AI"
244
+ prompt_template=f'''## {{{{charname}}}}:
245
+ - You're "{{{{charname}}}}" in this never-ending roleplay with "{{{{user}}}}".
246
+ ### Input:
247
+ {prompt}
248
+
249
+ ### Response:
250
+ (OOC) Understood. I will take this info into account for the roleplay. (end OOC)
251
+
252
+ ### New Roleplay:
253
+ ### Instruction:
254
+ #### {{{{char}}}}:
255
+ whatever the char says, this is the chat history
256
+ #### {{{{user}}}}:
257
+ whatever the user says, this is the chat history
258
+ ... repeated some number of times ...
259
+ ### Response 2 paragraphs, engaging, natural, authentic, descriptive, creative):
260
+ #### {{{{char}}}}:
261
+ '''
262
+
263
+ client = InferenceClient(endpoint_url)
264
+ response = client.text_generation(prompt,
265
+ max_new_tokens=128,
266
+ do_sample=True,
267
+ temperature=0.7,
268
+ top_p=0.95,
269
+ top_k=40,
270
+ repetition_penalty=1.1)
271
+
272
+ print(f"Model output: ", response)
273
+ ```
274
+ <!-- README_AWQ.md-use-from-tgi end -->
275
+
276
+ <!-- README_AWQ.md-use-from-python start -->
277
+ ## Inference from Python code using AutoAWQ
278
+
279
+ ### Install the AutoAWQ package
280
+
281
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.1 or later.
282
+
283
+ ```shell
284
+ pip3 install autoawq
285
+ ```
286
+
287
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
288
+
289
+ ```shell
290
+ pip3 uninstall -y autoawq
291
+ git clone https://github.com/casper-hansen/AutoAWQ
292
+ cd AutoAWQ
293
+ pip3 install .
294
+ ```
295
+
296
+ ### AutoAWQ example code
297
+
298
+ ```python
299
+ from awq import AutoAWQForCausalLM
300
+ from transformers import AutoTokenizer
301
+
302
+ model_name_or_path = "TheBloke/MistralMakise-Merged-13B-AWQ"
303
+
304
+ # Load tokenizer
305
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
306
+ # Load model
307
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
308
+ trust_remote_code=False, safetensors=True)
309
+
310
+ prompt = "Tell me about AI"
311
+ prompt_template=f'''## {{{{charname}}}}:
312
+ - You're "{{{{charname}}}}" in this never-ending roleplay with "{{{{user}}}}".
313
+ ### Input:
314
+ {prompt}
315
+
316
+ ### Response:
317
+ (OOC) Understood. I will take this info into account for the roleplay. (end OOC)
318
+
319
+ ### New Roleplay:
320
+ ### Instruction:
321
+ #### {{{{char}}}}:
322
+ whatever the char says, this is the chat history
323
+ #### {{{{user}}}}:
324
+ whatever the user says, this is the chat history
325
+ ... repeated some number of times ...
326
+ ### Response 2 paragraphs, engaging, natural, authentic, descriptive, creative):
327
+ #### {{{{char}}}}:
328
+ '''
329
+
330
+ print("*** Running model.generate:")
331
+
332
+ token_input = tokenizer(
333
+ prompt_template,
334
+ return_tensors='pt'
335
+ ).input_ids.cuda()
336
+
337
+ # Generate output
338
+ generation_output = model.generate(
339
+ token_input,
340
+ do_sample=True,
341
+ temperature=0.7,
342
+ top_p=0.95,
343
+ top_k=40,
344
+ max_new_tokens=512
345
+ )
346
+
347
+ # Get the tokens from the output, decode them, print them
348
+ token_output = generation_output[0]
349
+ text_output = tokenizer.decode(token_output)
350
+ print("LLM output: ", text_output)
351
+
352
+ """
353
+ # Inference should be possible with transformers pipeline as well in future
354
+ # But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
355
+ from transformers import pipeline
356
+
357
+ print("*** Pipeline:")
358
+ pipe = pipeline(
359
+ "text-generation",
360
+ model=model,
361
+ tokenizer=tokenizer,
362
+ max_new_tokens=512,
363
+ do_sample=True,
364
+ temperature=0.7,
365
+ top_p=0.95,
366
+ top_k=40,
367
+ repetition_penalty=1.1
368
+ )
369
+
370
+ print(pipe(prompt_template)[0]['generated_text'])
371
+ """
372
+ ```
373
+ <!-- README_AWQ.md-use-from-python end -->
374
+
375
+ <!-- README_AWQ.md-compatibility start -->
376
+ ## Compatibility
377
+
378
+ The files provided are tested to work with:
379
+
380
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
381
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
382
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
383
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
384
+
385
+ <!-- README_AWQ.md-compatibility end -->
386
+
387
+ <!-- footer start -->
388
+ <!-- 200823 -->
389
+ ## Discord
390
+
391
+ For further support, and discussions on these models and AI in general, join us at:
392
+
393
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
394
+
395
+ ## Thanks, and how to contribute
396
+
397
+ Thanks to the [chirper.ai](https://chirper.ai) team!
398
+
399
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
400
+
401
+ I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
402
+
403
+ If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
404
+
405
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
406
+
407
+ * Patreon: https://patreon.com/TheBlokeAI
408
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
409
+
410
+ **Special thanks to**: Aemon Algiz.
411
+
412
+ **Patreon special mentions**: Pierre Kircher, Stanislav Ovsiannikov, Michael Levine, Eugene Pentland, Andrey, 준교 김, Randy H, Fred von Graf, Artur Olbinski, Caitlyn Gatomon, terasurfer, Jeff Scroggin, James Bentley, Vadim, Gabriel Puliatti, Harry Royden McLaughlin, Sean Connelly, Dan Guido, Edmond Seymore, Alicia Loh, subjectnull, AzureBlack, Manuel Alberto Morcote, Thomas Belote, Lone Striker, Chris Smitley, Vitor Caleffi, Johann-Peter Hartmann, Clay Pascal, biorpg, Brandon Frisco, sidney chen, transmissions 11, Pedro Madruga, jinyuan sun, Ajan Kanaga, Emad Mostaque, Trenton Dambrowitz, Jonathan Leane, Iucharbius, usrbinkat, vamX, George Stoitzev, Luke Pendergrass, theTransient, Olakabola, Swaroop Kallakuri, Cap'n Zoog, Brandon Phillips, Michael Dempsey, Nikolai Manek, danny, Matthew Berman, Gabriel Tamborski, alfie_i, Raymond Fosdick, Tom X Nguyen, Raven Klaugh, LangChain4j, Magnesian, Illia Dulskyi, David Ziegler, Mano Prime, Luis Javier Navarrete Lozano, Erik Bjäreholt, 阿明, Nathan Dryer, Alex, Rainer Wilmers, zynix, TL, Joseph William Delisle, John Villwock, Nathan LeClaire, Willem Michiel, Joguhyik, GodLy, OG, Alps Aficionado, Jeffrey Morgan, ReadyPlayerEmma, Tiffany J. Kim, Sebastain Graf, Spencer Kim, Michael Davis, webtim, Talal Aujan, knownsqashed, John Detwiler, Imad Khwaja, Deo Leter, Jerry Meng, Elijah Stavena, Rooh Singh, Pieter, SuperWojo, Alexandros Triantafyllidis, Stephen Murray, Ai Maven, ya boyyy, Enrico Ros, Ken Nordquist, Deep Realms, Nicholas, Spiking Neurons AB, Elle, Will Dee, Jack West, RoA, Luke @flexchar, Viktor Bowallius, Derek Yates, Subspace Studios, jjj, Toran Billups, Asp the Wyvern, Fen Risland, Ilya, NimbleBox.ai, Chadd, Nitin Borwankar, Emre, Mandus, Leonard Tan, Kalila, K, Trailburnt, S_X, Cory Kujawski
413
+
414
+
415
+ Thank you to all my generous patrons and donaters!
416
+
417
+ And thank you again to a16z for their generous grant.
418
+
419
+ <!-- footer end -->
420
+
421
+ # Original model card: Evan Armstrong's MistralMakise Merged 13B
422
+
423
+ The same dataset and training settings as MythoMakise, but with the ReMM mistral model as a base. See that model card for more info on prompt formats and such.