TheBloke commited on
Commit
f4dfaf1
1 Parent(s): 388600c

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +436 -0
README.md ADDED
@@ -0,0 +1,436 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base model: mistralai/Mixtral-8x7B-v0.1
3
+ base_model: Sao10K/Sensualize-Mixtral-bf16
4
+ datasets:
5
+ - NobodyExistsOnTheInternet/full120k
6
+ inference: false
7
+ license: cc-by-nc-4.0
8
+ model_creator: Saofiq
9
+ model_name: Sensualize Mixtral
10
+ model_type: mixtral
11
+ prompt_template: '### Instruction:
12
+
13
+ {system_message}
14
+
15
+
16
+ ### Input:
17
+
18
+ {prompt}
19
+
20
+
21
+ ### Response:
22
+
23
+ '
24
+ quantized_by: TheBloke
25
+ ---
26
+ <!-- markdownlint-disable MD041 -->
27
+
28
+ <!-- header start -->
29
+ <!-- 200823 -->
30
+ <div style="width: auto; margin-left: auto; margin-right: auto">
31
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
32
+ </div>
33
+ <div style="display: flex; justify-content: space-between; width: 100%;">
34
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
35
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
36
+ </div>
37
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
38
+ <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>
39
+ </div>
40
+ </div>
41
+ <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>
42
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
43
+ <!-- header end -->
44
+
45
+ # Sensualize Mixtral - AWQ
46
+ - Model creator: [Saofiq](https://huggingface.co/Sao10K)
47
+ - Original model: [Sensualize Mixtral](https://huggingface.co/Sao10K/Sensualize-Mixtral-bf16)
48
+
49
+ <!-- description start -->
50
+ ## Description
51
+
52
+ This repo contains AWQ model files for [Saofiq's Sensualize Mixtral](https://huggingface.co/Sao10K/Sensualize-Mixtral-bf16).
53
+
54
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
55
+
56
+
57
+ **MIXTRAL AWQ**
58
+
59
+ This is a Mixtral AWQ model.
60
+
61
+ For AutoAWQ inference, please install AutoAWQ 0.1.8 or later.
62
+
63
+ Support via Transformers is also available, but currently requires installing Transformers from Github: `pip3 install git+https://github.com/huggingface/transformers.git`
64
+
65
+ vLLM: version 0.2.6 is confirmed to support Mixtral AWQs.
66
+
67
+ TGI: I tested version 1.3.3 and it loaded the model fine, but I was not able to get any output back. Further testing/debug is required. (Let me know if you get it working!)
68
+
69
+ ### About AWQ
70
+
71
+ 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.
72
+
73
+ AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
74
+
75
+ AWQ models are supported by (note that not all of these may support Mixtral models yet - see above):
76
+
77
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
78
+ - [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
79
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
80
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
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/Sensualize-Mixtral-AWQ)
88
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Sensualize-Mixtral-GPTQ)
89
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Sensualize-Mixtral-GGUF)
90
+ * [Saofiq's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Sao10K/Sensualize-Mixtral-bf16)
91
+ <!-- repositories-available end -->
92
+
93
+ <!-- prompt-template start -->
94
+ ## Prompt template: Instruction-Input-Response
95
+
96
+ ```
97
+ ### Instruction:
98
+ {system_message}
99
+
100
+ ### Input:
101
+ {prompt}
102
+
103
+ ### Response:
104
+
105
+ ```
106
+
107
+ <!-- prompt-template end -->
108
+
109
+
110
+ <!-- README_AWQ.md-provided-files start -->
111
+ ## Provided files, and AWQ parameters
112
+
113
+ I currently release 128g GEMM models only. The addition of group_size 32 models, and GEMV kernel models, is being actively considered.
114
+
115
+ Models are released as sharded safetensors files.
116
+
117
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
118
+ | ------ | ---- | -- | ----------- | ------- | ---- |
119
+ | [main](https://huggingface.co/TheBloke/Sensualize-Mixtral-AWQ/tree/main) | 4 | 128 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 24.65 GB
120
+
121
+ <!-- README_AWQ.md-provided-files end -->
122
+
123
+ <!-- README_AWQ.md-text-generation-webui start -->
124
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
125
+
126
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
127
+
128
+ 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.
129
+
130
+ 1. Click the **Model tab**.
131
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/Sensualize-Mixtral-AWQ`.
132
+ 3. Click **Download**.
133
+ 4. The model will start downloading. Once it's finished it will say "Done".
134
+ 5. In the top left, click the refresh icon next to **Model**.
135
+ 6. In the **Model** dropdown, choose the model you just downloaded: `Sensualize-Mixtral-AWQ`
136
+ 7. Select **Loader: AutoAWQ**.
137
+ 8. Click Load, and the model will load and is now ready for use.
138
+ 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.
139
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
140
+ <!-- README_AWQ.md-text-generation-webui end -->
141
+
142
+ <!-- README_AWQ.md-use-from-vllm start -->
143
+ ## Multi-user inference server: vLLM
144
+
145
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
146
+
147
+ - Please ensure you are using vLLM version 0.2 or later.
148
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
149
+
150
+ For example:
151
+
152
+ ```shell
153
+ python3 -m vllm.entrypoints.api_server --model TheBloke/Sensualize-Mixtral-AWQ --quantization awq --dtype auto
154
+ ```
155
+
156
+ - When using vLLM from Python code, again set `quantization=awq`.
157
+
158
+ For example:
159
+
160
+ ```python
161
+ from vllm import LLM, SamplingParams
162
+
163
+ prompts = [
164
+ "Tell me about AI",
165
+ "Write a story about llamas",
166
+ "What is 291 - 150?",
167
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
168
+ ]
169
+ prompt_template=f'''### Instruction:
170
+ {system_message}
171
+
172
+ ### Input:
173
+ {prompt}
174
+
175
+ ### Response:
176
+ '''
177
+
178
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
179
+
180
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
181
+
182
+ llm = LLM(model="TheBloke/Sensualize-Mixtral-AWQ", quantization="awq", dtype="auto")
183
+
184
+ outputs = llm.generate(prompts, sampling_params)
185
+
186
+ # Print the outputs.
187
+ for output in outputs:
188
+ prompt = output.prompt
189
+ generated_text = output.outputs[0].text
190
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
191
+ ```
192
+ <!-- README_AWQ.md-use-from-vllm start -->
193
+
194
+ <!-- README_AWQ.md-use-from-tgi start -->
195
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
196
+
197
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
198
+
199
+ Example Docker parameters:
200
+
201
+ ```shell
202
+ --model-id TheBloke/Sensualize-Mixtral-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
203
+ ```
204
+
205
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
206
+
207
+ ```shell
208
+ pip3 install huggingface-hub
209
+ ```
210
+
211
+ ```python
212
+ from huggingface_hub import InferenceClient
213
+
214
+ endpoint_url = "https://your-endpoint-url-here"
215
+
216
+ prompt = "Tell me about AI"
217
+ prompt_template=f'''### Instruction:
218
+ {system_message}
219
+
220
+ ### Input:
221
+ {prompt}
222
+
223
+ ### Response:
224
+ '''
225
+
226
+ client = InferenceClient(endpoint_url)
227
+ response = client.text_generation(prompt,
228
+ max_new_tokens=128,
229
+ do_sample=True,
230
+ temperature=0.7,
231
+ top_p=0.95,
232
+ top_k=40,
233
+ repetition_penalty=1.1)
234
+
235
+ print(f"Model output: ", response)
236
+ ```
237
+ <!-- README_AWQ.md-use-from-tgi end -->
238
+
239
+ <!-- README_AWQ.md-use-from-python start -->
240
+ ## Inference from Python code using Transformers
241
+
242
+ ### Install the necessary packages
243
+
244
+ - Requires: [Transformers](https://huggingface.co/docs/transformers) 4.35.0 or later.
245
+ - Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.6 or later.
246
+
247
+ ```shell
248
+ pip3 install --upgrade "autoawq>=0.1.6" "transformers>=4.35.0"
249
+ ```
250
+
251
+ Note that if you are using PyTorch 2.0.1, the above AutoAWQ command will automatically upgrade you to PyTorch 2.1.0.
252
+
253
+ If you are using CUDA 11.8 and wish to continue using PyTorch 2.0.1, instead run this command:
254
+
255
+ ```shell
256
+ pip3 install https://github.com/casper-hansen/AutoAWQ/releases/download/v0.1.6/autoawq-0.1.6+cu118-cp310-cp310-linux_x86_64.whl
257
+ ```
258
+
259
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
260
+
261
+ ```shell
262
+ pip3 uninstall -y autoawq
263
+ git clone https://github.com/casper-hansen/AutoAWQ
264
+ cd AutoAWQ
265
+ pip3 install .
266
+ ```
267
+
268
+ ### Transformers example code (requires Transformers 4.35.0 and later)
269
+
270
+ ```python
271
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
272
+
273
+ model_name_or_path = "TheBloke/Sensualize-Mixtral-AWQ"
274
+
275
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
276
+ model = AutoModelForCausalLM.from_pretrained(
277
+ model_name_or_path,
278
+ low_cpu_mem_usage=True,
279
+ device_map="cuda:0"
280
+ )
281
+
282
+ # Using the text streamer to stream output one token at a time
283
+ streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
284
+
285
+ prompt = "Tell me about AI"
286
+ prompt_template=f'''### Instruction:
287
+ {system_message}
288
+
289
+ ### Input:
290
+ {prompt}
291
+
292
+ ### Response:
293
+ '''
294
+
295
+ # Convert prompt to tokens
296
+ tokens = tokenizer(
297
+ prompt_template,
298
+ return_tensors='pt'
299
+ ).input_ids.cuda()
300
+
301
+ generation_params = {
302
+ "do_sample": True,
303
+ "temperature": 0.7,
304
+ "top_p": 0.95,
305
+ "top_k": 40,
306
+ "max_new_tokens": 512,
307
+ "repetition_penalty": 1.1
308
+ }
309
+
310
+ # Generate streamed output, visible one token at a time
311
+ generation_output = model.generate(
312
+ tokens,
313
+ streamer=streamer,
314
+ **generation_params
315
+ )
316
+
317
+ # Generation without a streamer, which will include the prompt in the output
318
+ generation_output = model.generate(
319
+ tokens,
320
+ **generation_params
321
+ )
322
+
323
+ # Get the tokens from the output, decode them, print them
324
+ token_output = generation_output[0]
325
+ text_output = tokenizer.decode(token_output)
326
+ print("model.generate output: ", text_output)
327
+
328
+ # Inference is also possible via Transformers' pipeline
329
+ from transformers import pipeline
330
+
331
+ pipe = pipeline(
332
+ "text-generation",
333
+ model=model,
334
+ tokenizer=tokenizer,
335
+ **generation_params
336
+ )
337
+
338
+ pipe_output = pipe(prompt_template)[0]['generated_text']
339
+ print("pipeline output: ", pipe_output)
340
+
341
+ ```
342
+ <!-- README_AWQ.md-use-from-python end -->
343
+
344
+ <!-- README_AWQ.md-compatibility start -->
345
+ ## Compatibility
346
+
347
+ The files provided are tested to work with:
348
+
349
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
350
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
351
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
352
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later.
353
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
354
+
355
+ <!-- README_AWQ.md-compatibility end -->
356
+
357
+ <!-- footer start -->
358
+ <!-- 200823 -->
359
+ ## Discord
360
+
361
+ For further support, and discussions on these models and AI in general, join us at:
362
+
363
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
364
+
365
+ ## Thanks, and how to contribute
366
+
367
+ Thanks to the [chirper.ai](https://chirper.ai) team!
368
+
369
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
370
+
371
+ 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.
372
+
373
+ 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.
374
+
375
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
376
+
377
+ * Patreon: https://patreon.com/TheBlokeAI
378
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
379
+
380
+ **Special thanks to**: Aemon Algiz.
381
+
382
+ **Patreon special mentions**: Michael Levine, 阿明, Trailburnt, Nikolai Manek, John Detwiler, Randy H, Will Dee, Sebastain Graf, NimbleBox.ai, Eugene Pentland, Emad Mostaque, Ai Maven, Jim Angel, Jeff Scroggin, Michael Davis, Manuel Alberto Morcote, Stephen Murray, Robert, Justin Joy, Luke @flexchar, Brandon Frisco, Elijah Stavena, S_X, Dan Guido, Undi ., Komninos Chatzipapas, Shadi, theTransient, Lone Striker, Raven Klaugh, jjj, Cap'n Zoog, Michel-Marie MAUDET (LINAGORA), Matthew Berman, David, Fen Risland, Omer Bin Jawed, Luke Pendergrass, Kalila, OG, Erik Bjäreholt, Rooh Singh, Joseph William Delisle, Dan Lewis, TL, John Villwock, AzureBlack, Brad, Pedro Madruga, Caitlyn Gatomon, K, jinyuan sun, Mano Prime, Alex, Jeffrey Morgan, Alicia Loh, Illia Dulskyi, Chadd, transmissions 11, fincy, Rainer Wilmers, ReadyPlayerEmma, knownsqashed, Mandus, biorpg, Deo Leter, Brandon Phillips, SuperWojo, Sean Connelly, Iucharbius, Jack West, Harry Royden McLaughlin, Nicholas, terasurfer, Vitor Caleffi, Duane Dunston, Johann-Peter Hartmann, David Ziegler, Olakabola, Ken Nordquist, Trenton Dambrowitz, Tom X Nguyen, Vadim, Ajan Kanaga, Leonard Tan, Clay Pascal, Alexandros Triantafyllidis, JM33133, Xule, vamX, ya boyyy, subjectnull, Talal Aujan, Alps Aficionado, wassieverse, Ari Malik, James Bentley, Woland, Spencer Kim, Michael Dempsey, Fred von Graf, Elle, zynix, William Richards, Stanislav Ovsiannikov, Edmond Seymore, Jonathan Leane, Martin Kemka, usrbinkat, Enrico Ros
383
+
384
+
385
+ Thank you to all my generous patrons and donaters!
386
+
387
+ And thank you again to a16z for their generous grant.
388
+
389
+ <!-- footer end -->
390
+
391
+ # Original model card: Saofiq's Sensualize Mixtral
392
+
393
+
394
+ Trained using a randomised subset of Full120k - 60K Samples [Roughly 50M Tokens] + More of my own NSFW Instruct & De-Alignment Data [Roughly 30M Tokens Total]
395
+ <br>Total Tokens used for Training: 80M over 1 epoch, over 2xA100s at batch size 5, grad 5 for 12 hours.
396
+
397
+ ***
398
+
399
+ Experimental model, trained on [mistralai/Mixtral-8x7B-v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-v0.1) using [Charles Goddard](https://huggingface.co/chargoddard)'s ZLoss and Megablocks-based fork of transformers.
400
+
401
+ ***
402
+
403
+ Trained with Alpaca format.
404
+
405
+ ```
406
+ ### Instruction:
407
+ <Prompt>
408
+
409
+ ### Input:
410
+ <Insert Context Here>
411
+
412
+ ### Response:
413
+
414
+ ```
415
+ ***
416
+
417
+ Useful prompt guide: https://rentry.org/mixtralforretards
418
+
419
+ useful stopping strings:
420
+ ```
421
+ ["\nInput:", "\n[", "\n(", "\n### Input:"]
422
+ ```
423
+
424
+ *stops run-off generations after response, important for alpaca*
425
+
426
+ ***
427
+
428
+ Roleplay based model, specifically the ERP type one.
429
+
430
+ I mean, its pretty good sometimes? I had various testing versions of Mistral 7B and L2 70B, L2 13B, and even Solar with the same dataset and various learning rates, they did much better. MoE tuning kinda meh still.
431
+
432
+ about gptisms. It's weird. with certain prompts its never there, with some its there. despite the prose of full120k, I never encountered gptslop with mistral, solar or l2 based trains which was why I was confident about this being good initially.
433
+
434
+ Mixtral is really finicky. with the right settings this model can shine. I recommend Universal-Light or Universal-Creative in SillyTavern.
435
+
436
+ Anyways... Enjoy?