Text Generation
Transformers
Safetensors
English
mixtral
conversational
text-generation-inference
4-bit precision
awq
TheBloke commited on
Commit
64005f3
1 Parent(s): c12fef7

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +435 -0
README.md ADDED
@@ -0,0 +1,435 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Doctor-Shotgun/Norobara-ZLoss-8x7B
3
+ datasets:
4
+ - LDJnr/Capybara
5
+ - unalignment/toxic-dpo-v0.1
6
+ - LDJnr/Verified-Camel
7
+ - HuggingFaceH4/no_robots
8
+ - Doctor-Shotgun/no-robots-sharegpt
9
+ - Doctor-Shotgun/capybara-sharegpt
10
+ inference: false
11
+ language:
12
+ - en
13
+ library_name: transformers
14
+ model_creator: Doctor Shotgun
15
+ model_name: Norobara ZLoss 8X7B
16
+ model_type: mixtral
17
+ pipeline_tag: text-generation
18
+ prompt_template: '### Instruction:
19
+
20
+ {system_message}
21
+
22
+
23
+ ### Input:
24
+
25
+ {prompt}
26
+
27
+
28
+ ### Response:
29
+
30
+ '
31
+ quantized_by: TheBloke
32
+ tags:
33
+ - mixtral
34
+ ---
35
+ <!-- markdownlint-disable MD041 -->
36
+
37
+ <!-- header start -->
38
+ <!-- 200823 -->
39
+ <div style="width: auto; margin-left: auto; margin-right: auto">
40
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
41
+ </div>
42
+ <div style="display: flex; justify-content: space-between; width: 100%;">
43
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
44
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
45
+ </div>
46
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
47
+ <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>
48
+ </div>
49
+ </div>
50
+ <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>
51
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
52
+ <!-- header end -->
53
+
54
+ # Norobara ZLoss 8X7B - AWQ
55
+ - Model creator: [Doctor Shotgun](https://huggingface.co/Doctor-Shotgun)
56
+ - Original model: [Norobara ZLoss 8X7B](https://huggingface.co/Doctor-Shotgun/Norobara-ZLoss-8x7B)
57
+
58
+ <!-- description start -->
59
+ ## Description
60
+
61
+ This repo contains AWQ model files for [Doctor Shotgun's Norobara ZLoss 8X7B](https://huggingface.co/Doctor-Shotgun/Norobara-ZLoss-8x7B).
62
+
63
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
64
+
65
+
66
+ **MIXTRAL AWQ**
67
+
68
+ This is a Mixtral AWQ model.
69
+
70
+ For AutoAWQ inference, please install AutoAWQ 0.1.8 or later.
71
+
72
+ Support via Transformers is also available, but currently requires installing Transformers from Github: `pip3 install git+https://github.com/huggingface/transformers.git`
73
+
74
+ vLLM: version 0.2.6 is confirmed to support Mixtral AWQs.
75
+
76
+ 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!)
77
+
78
+ ### About AWQ
79
+
80
+ 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.
81
+
82
+ AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
83
+
84
+ AWQ models are supported by (note that not all of these may support Mixtral models yet - see above):
85
+
86
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
87
+ - [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
88
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
89
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
90
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
91
+
92
+ <!-- description end -->
93
+ <!-- repositories-available start -->
94
+ ## Repositories available
95
+
96
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Norobara-ZLoss-8x7B-AWQ)
97
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Norobara-ZLoss-8x7B-GPTQ)
98
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Norobara-ZLoss-8x7B-GGUF)
99
+ * [Doctor Shotgun's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Doctor-Shotgun/Norobara-ZLoss-8x7B)
100
+ <!-- repositories-available end -->
101
+
102
+ <!-- prompt-template start -->
103
+ ## Prompt template: Instruction-Input-Response
104
+
105
+ ```
106
+ ### Instruction:
107
+ {system_message}
108
+
109
+ ### Input:
110
+ {prompt}
111
+
112
+ ### Response:
113
+
114
+ ```
115
+
116
+ <!-- prompt-template end -->
117
+
118
+
119
+ <!-- README_AWQ.md-provided-files start -->
120
+ ## Provided files, and AWQ parameters
121
+
122
+ I currently release 128g GEMM models only. The addition of group_size 32 models, and GEMV kernel models, is being actively considered.
123
+
124
+ Models are released as sharded safetensors files.
125
+
126
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
127
+ | ------ | ---- | -- | ----------- | ------- | ---- |
128
+ | [main](https://huggingface.co/TheBloke/Norobara-ZLoss-8x7B-AWQ/tree/main) | 4 | 128 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 24.65 GB
129
+
130
+ <!-- README_AWQ.md-provided-files end -->
131
+
132
+ <!-- README_AWQ.md-text-generation-webui start -->
133
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
134
+
135
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
136
+
137
+ 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.
138
+
139
+ 1. Click the **Model tab**.
140
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/Norobara-ZLoss-8x7B-AWQ`.
141
+ 3. Click **Download**.
142
+ 4. The model will start downloading. Once it's finished it will say "Done".
143
+ 5. In the top left, click the refresh icon next to **Model**.
144
+ 6. In the **Model** dropdown, choose the model you just downloaded: `Norobara-ZLoss-8x7B-AWQ`
145
+ 7. Select **Loader: AutoAWQ**.
146
+ 8. Click Load, and the model will load and is now ready for use.
147
+ 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.
148
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
149
+ <!-- README_AWQ.md-text-generation-webui end -->
150
+
151
+ <!-- README_AWQ.md-use-from-vllm start -->
152
+ ## Multi-user inference server: vLLM
153
+
154
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
155
+
156
+ - Please ensure you are using vLLM version 0.2 or later.
157
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
158
+
159
+ For example:
160
+
161
+ ```shell
162
+ python3 -m vllm.entrypoints.api_server --model TheBloke/Norobara-ZLoss-8x7B-AWQ --quantization awq --dtype auto
163
+ ```
164
+
165
+ - When using vLLM from Python code, again set `quantization=awq`.
166
+
167
+ For example:
168
+
169
+ ```python
170
+ from vllm import LLM, SamplingParams
171
+
172
+ prompts = [
173
+ "Tell me about AI",
174
+ "Write a story about llamas",
175
+ "What is 291 - 150?",
176
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
177
+ ]
178
+ prompt_template=f'''### Instruction:
179
+ {system_message}
180
+
181
+ ### Input:
182
+ {prompt}
183
+
184
+ ### Response:
185
+ '''
186
+
187
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
188
+
189
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
190
+
191
+ llm = LLM(model="TheBloke/Norobara-ZLoss-8x7B-AWQ", quantization="awq", dtype="auto")
192
+
193
+ outputs = llm.generate(prompts, sampling_params)
194
+
195
+ # Print the outputs.
196
+ for output in outputs:
197
+ prompt = output.prompt
198
+ generated_text = output.outputs[0].text
199
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
200
+ ```
201
+ <!-- README_AWQ.md-use-from-vllm start -->
202
+
203
+ <!-- README_AWQ.md-use-from-tgi start -->
204
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
205
+
206
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
207
+
208
+ Example Docker parameters:
209
+
210
+ ```shell
211
+ --model-id TheBloke/Norobara-ZLoss-8x7B-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
212
+ ```
213
+
214
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
215
+
216
+ ```shell
217
+ pip3 install huggingface-hub
218
+ ```
219
+
220
+ ```python
221
+ from huggingface_hub import InferenceClient
222
+
223
+ endpoint_url = "https://your-endpoint-url-here"
224
+
225
+ prompt = "Tell me about AI"
226
+ prompt_template=f'''### Instruction:
227
+ {system_message}
228
+
229
+ ### Input:
230
+ {prompt}
231
+
232
+ ### Response:
233
+ '''
234
+
235
+ client = InferenceClient(endpoint_url)
236
+ response = client.text_generation(prompt,
237
+ max_new_tokens=128,
238
+ do_sample=True,
239
+ temperature=0.7,
240
+ top_p=0.95,
241
+ top_k=40,
242
+ repetition_penalty=1.1)
243
+
244
+ print(f"Model output: ", response)
245
+ ```
246
+ <!-- README_AWQ.md-use-from-tgi end -->
247
+
248
+ <!-- README_AWQ.md-use-from-python start -->
249
+ ## Inference from Python code using Transformers
250
+
251
+ ### Install the necessary packages
252
+
253
+ - Requires: [Transformers](https://huggingface.co/docs/transformers) 4.35.0 or later.
254
+ - Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.6 or later.
255
+
256
+ ```shell
257
+ pip3 install --upgrade "autoawq>=0.1.6" "transformers>=4.35.0"
258
+ ```
259
+
260
+ Note that if you are using PyTorch 2.0.1, the above AutoAWQ command will automatically upgrade you to PyTorch 2.1.0.
261
+
262
+ If you are using CUDA 11.8 and wish to continue using PyTorch 2.0.1, instead run this command:
263
+
264
+ ```shell
265
+ pip3 install https://github.com/casper-hansen/AutoAWQ/releases/download/v0.1.6/autoawq-0.1.6+cu118-cp310-cp310-linux_x86_64.whl
266
+ ```
267
+
268
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
269
+
270
+ ```shell
271
+ pip3 uninstall -y autoawq
272
+ git clone https://github.com/casper-hansen/AutoAWQ
273
+ cd AutoAWQ
274
+ pip3 install .
275
+ ```
276
+
277
+ ### Transformers example code (requires Transformers 4.35.0 and later)
278
+
279
+ ```python
280
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
281
+
282
+ model_name_or_path = "TheBloke/Norobara-ZLoss-8x7B-AWQ"
283
+
284
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
285
+ model = AutoModelForCausalLM.from_pretrained(
286
+ model_name_or_path,
287
+ low_cpu_mem_usage=True,
288
+ device_map="cuda:0"
289
+ )
290
+
291
+ # Using the text streamer to stream output one token at a time
292
+ streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
293
+
294
+ prompt = "Tell me about AI"
295
+ prompt_template=f'''### Instruction:
296
+ {system_message}
297
+
298
+ ### Input:
299
+ {prompt}
300
+
301
+ ### Response:
302
+ '''
303
+
304
+ # Convert prompt to tokens
305
+ tokens = tokenizer(
306
+ prompt_template,
307
+ return_tensors='pt'
308
+ ).input_ids.cuda()
309
+
310
+ generation_params = {
311
+ "do_sample": True,
312
+ "temperature": 0.7,
313
+ "top_p": 0.95,
314
+ "top_k": 40,
315
+ "max_new_tokens": 512,
316
+ "repetition_penalty": 1.1
317
+ }
318
+
319
+ # Generate streamed output, visible one token at a time
320
+ generation_output = model.generate(
321
+ tokens,
322
+ streamer=streamer,
323
+ **generation_params
324
+ )
325
+
326
+ # Generation without a streamer, which will include the prompt in the output
327
+ generation_output = model.generate(
328
+ tokens,
329
+ **generation_params
330
+ )
331
+
332
+ # Get the tokens from the output, decode them, print them
333
+ token_output = generation_output[0]
334
+ text_output = tokenizer.decode(token_output)
335
+ print("model.generate output: ", text_output)
336
+
337
+ # Inference is also possible via Transformers' pipeline
338
+ from transformers import pipeline
339
+
340
+ pipe = pipeline(
341
+ "text-generation",
342
+ model=model,
343
+ tokenizer=tokenizer,
344
+ **generation_params
345
+ )
346
+
347
+ pipe_output = pipe(prompt_template)[0]['generated_text']
348
+ print("pipeline output: ", pipe_output)
349
+
350
+ ```
351
+ <!-- README_AWQ.md-use-from-python end -->
352
+
353
+ <!-- README_AWQ.md-compatibility start -->
354
+ ## Compatibility
355
+
356
+ The files provided are tested to work with:
357
+
358
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
359
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
360
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
361
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later.
362
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
363
+
364
+ <!-- README_AWQ.md-compatibility end -->
365
+
366
+ <!-- footer start -->
367
+ <!-- 200823 -->
368
+ ## Discord
369
+
370
+ For further support, and discussions on these models and AI in general, join us at:
371
+
372
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
373
+
374
+ ## Thanks, and how to contribute
375
+
376
+ Thanks to the [chirper.ai](https://chirper.ai) team!
377
+
378
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
379
+
380
+ 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.
381
+
382
+ 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.
383
+
384
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
385
+
386
+ * Patreon: https://patreon.com/TheBlokeAI
387
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
388
+
389
+ **Special thanks to**: Aemon Algiz.
390
+
391
+ **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
392
+
393
+
394
+ Thank you to all my generous patrons and donaters!
395
+
396
+ And thank you again to a16z for their generous grant.
397
+
398
+ <!-- footer end -->
399
+
400
+ # Original model card: Doctor Shotgun's Norobara ZLoss 8X7B
401
+
402
+
403
+ # Norobara-ZLoss-8x7B
404
+
405
+ This is an experimental instruct-tuned [mistralai/Mixtral-8x7B-v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-v0.1)-based model trained using [Charles Goddard](https://huggingface.co/chargoddard)'s ZLoss and Megablocks-based fork of transformers.
406
+
407
+ It primarily uses the Capybara and No Robots datasets (thus the name). The goal was to create an uncensored general instruction following model, as well as test various loss implementations while we figure out how the heck to train Mixtral properly.
408
+
409
+ [Exl2 Quants](https://huggingface.co/royallab/Norobara-ZLoss-8x7B-exl2)
410
+
411
+ ## Usage:
412
+ The intended prompt format is a modified multi-turn Alpaca instruction format:
413
+ ```
414
+ ### Instruction:
415
+ {system prompt}
416
+
417
+ ### Input:
418
+ {user message}
419
+
420
+ ### Response:
421
+ {model response}
422
+
423
+ ### Input:
424
+ {user message}
425
+
426
+ ### Response:
427
+ {model response}
428
+
429
+ (etc.)
430
+ ```
431
+
432
+ ## Bias, Risks, and Limitations
433
+ The model will show biases present in the base model. No ethical alignment was applied to prevent the generation of toxic or harmful outputs (in fact the opposite, with examples from toxic-DPO included), so generate at your own risk.
434
+ ## Training Details
435
+ This model was trained as a QLora adapter for 3 epochs using a single H100 GPU for around 13 hours.