TheBloke commited on
Commit
6cfc867
1 Parent(s): baeeea8

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +382 -0
README.md ADDED
@@ -0,0 +1,382 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Undi95/Mixtral-8x7B-MoE-RP-Story
3
+ inference: false
4
+ license: cc-by-nc-4.0
5
+ model_creator: Undi
6
+ model_name: Mixtral 8X7B MoE RP Story
7
+ model_type: mixtral
8
+ prompt_template: '{prompt}
9
+
10
+ '
11
+ quantized_by: TheBloke
12
+ tags:
13
+ - not-for-all-audiences
14
+ - nsfw
15
+ ---
16
+ <!-- markdownlint-disable MD041 -->
17
+
18
+ <!-- header start -->
19
+ <!-- 200823 -->
20
+ <div style="width: auto; margin-left: auto; margin-right: auto">
21
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
22
+ </div>
23
+ <div style="display: flex; justify-content: space-between; width: 100%;">
24
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
25
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
26
+ </div>
27
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
28
+ <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>
29
+ </div>
30
+ </div>
31
+ <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>
32
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
33
+ <!-- header end -->
34
+
35
+ # Mixtral 8X7B MoE RP Story - AWQ
36
+ - Model creator: [Undi](https://huggingface.co/Undi95)
37
+ - Original model: [Mixtral 8X7B MoE RP Story](https://huggingface.co/Undi95/Mixtral-8x7B-MoE-RP-Story)
38
+
39
+ <!-- description start -->
40
+ ## Description
41
+
42
+ This repo contains AWQ model files for [Undi's Mixtral 8X7B MoE RP Story](https://huggingface.co/Undi95/Mixtral-8x7B-MoE-RP-Story).
43
+
44
+
45
+ **MIXTRAL AWQ**
46
+
47
+ This is a Mixtral AWQ model.
48
+
49
+ For AutoAWQ inference, please install AutoAWQ from source.
50
+
51
+ Support via Transformers is coming soon, via this PR: https://github.com/huggingface/transformers/pull/27950 which should be merged to Transformers `main` very soon.
52
+
53
+ Support via vLLM and TGI has not yet been confirmed.
54
+
55
+ ### About AWQ
56
+
57
+ 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.
58
+
59
+ AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
60
+
61
+ AWQ models are supported by (note that not all of these may support Mixtral models yet):
62
+
63
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
64
+ - [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
65
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
66
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
67
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
68
+
69
+ <!-- description end -->
70
+ <!-- repositories-available start -->
71
+ ## Repositories available
72
+
73
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Mixtral-8x7B-MoE-RP-Story-AWQ)
74
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Mixtral-8x7B-MoE-RP-Story-GPTQ)
75
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Mixtral-8x7B-MoE-RP-Story-GGUF)
76
+ * [Undi's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Undi95/Mixtral-8x7B-MoE-RP-Story)
77
+ <!-- repositories-available end -->
78
+
79
+ <!-- prompt-template start -->
80
+ ## Prompt template: Unknown
81
+
82
+ ```
83
+ {prompt}
84
+
85
+ ```
86
+
87
+ <!-- prompt-template end -->
88
+
89
+
90
+ <!-- README_AWQ.md-provided-files start -->
91
+ ## Provided files, and AWQ parameters
92
+
93
+ I currently release 128g GEMM models only. The addition of group_size 32 models, and GEMV kernel models, is being actively considered.
94
+
95
+ Models are released as sharded safetensors files.
96
+
97
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
98
+ | ------ | ---- | -- | ----------- | ------- | ---- |
99
+ | [main](https://huggingface.co/TheBloke/Mixtral-8x7B-MoE-RP-Story-AWQ/tree/main) | 4 | 128 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 24.65 GB
100
+
101
+ <!-- README_AWQ.md-provided-files end -->
102
+
103
+ <!-- README_AWQ.md-text-generation-webui start -->
104
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
105
+
106
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
107
+
108
+ 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.
109
+
110
+ 1. Click the **Model tab**.
111
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/Mixtral-8x7B-MoE-RP-Story-AWQ`.
112
+ 3. Click **Download**.
113
+ 4. The model will start downloading. Once it's finished it will say "Done".
114
+ 5. In the top left, click the refresh icon next to **Model**.
115
+ 6. In the **Model** dropdown, choose the model you just downloaded: `Mixtral-8x7B-MoE-RP-Story-AWQ`
116
+ 7. Select **Loader: AutoAWQ**.
117
+ 8. Click Load, and the model will load and is now ready for use.
118
+ 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.
119
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
120
+ <!-- README_AWQ.md-text-generation-webui end -->
121
+
122
+ <!-- README_AWQ.md-use-from-vllm start -->
123
+ ## Multi-user inference server: vLLM
124
+
125
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
126
+
127
+ - Please ensure you are using vLLM version 0.2 or later.
128
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
129
+
130
+ For example:
131
+
132
+ ```shell
133
+ python3 -m vllm.entrypoints.api_server --model TheBloke/Mixtral-8x7B-MoE-RP-Story-AWQ --quantization awq --dtype auto
134
+ ```
135
+
136
+ - When using vLLM from Python code, again set `quantization=awq`.
137
+
138
+ For example:
139
+
140
+ ```python
141
+ from vllm import LLM, SamplingParams
142
+
143
+ prompts = [
144
+ "Tell me about AI",
145
+ "Write a story about llamas",
146
+ "What is 291 - 150?",
147
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
148
+ ]
149
+ prompt_template=f'''{prompt}
150
+ '''
151
+
152
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
153
+
154
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
155
+
156
+ llm = LLM(model="TheBloke/Mixtral-8x7B-MoE-RP-Story-AWQ", quantization="awq", dtype="auto")
157
+
158
+ outputs = llm.generate(prompts, sampling_params)
159
+
160
+ # Print the outputs.
161
+ for output in outputs:
162
+ prompt = output.prompt
163
+ generated_text = output.outputs[0].text
164
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
165
+ ```
166
+ <!-- README_AWQ.md-use-from-vllm start -->
167
+
168
+ <!-- README_AWQ.md-use-from-tgi start -->
169
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
170
+
171
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
172
+
173
+ Example Docker parameters:
174
+
175
+ ```shell
176
+ --model-id TheBloke/Mixtral-8x7B-MoE-RP-Story-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
177
+ ```
178
+
179
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
180
+
181
+ ```shell
182
+ pip3 install huggingface-hub
183
+ ```
184
+
185
+ ```python
186
+ from huggingface_hub import InferenceClient
187
+
188
+ endpoint_url = "https://your-endpoint-url-here"
189
+
190
+ prompt = "Tell me about AI"
191
+ prompt_template=f'''{prompt}
192
+ '''
193
+
194
+ client = InferenceClient(endpoint_url)
195
+ response = client.text_generation(prompt,
196
+ max_new_tokens=128,
197
+ do_sample=True,
198
+ temperature=0.7,
199
+ top_p=0.95,
200
+ top_k=40,
201
+ repetition_penalty=1.1)
202
+
203
+ print(f"Model output: ", response)
204
+ ```
205
+ <!-- README_AWQ.md-use-from-tgi end -->
206
+
207
+ <!-- README_AWQ.md-use-from-python start -->
208
+ ## Inference from Python code using Transformers
209
+
210
+ ### Install the necessary packages
211
+
212
+ - Requires: [Transformers](https://huggingface.co/docs/transformers) 4.35.0 or later.
213
+ - Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.6 or later.
214
+
215
+ ```shell
216
+ pip3 install --upgrade "autoawq>=0.1.6" "transformers>=4.35.0"
217
+ ```
218
+
219
+ Note that if you are using PyTorch 2.0.1, the above AutoAWQ command will automatically upgrade you to PyTorch 2.1.0.
220
+
221
+ If you are using CUDA 11.8 and wish to continue using PyTorch 2.0.1, instead run this command:
222
+
223
+ ```shell
224
+ pip3 install https://github.com/casper-hansen/AutoAWQ/releases/download/v0.1.6/autoawq-0.1.6+cu118-cp310-cp310-linux_x86_64.whl
225
+ ```
226
+
227
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
228
+
229
+ ```shell
230
+ pip3 uninstall -y autoawq
231
+ git clone https://github.com/casper-hansen/AutoAWQ
232
+ cd AutoAWQ
233
+ pip3 install .
234
+ ```
235
+
236
+ ### Transformers example code (requires Transformers 4.35.0 and later)
237
+
238
+ ```python
239
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
240
+
241
+ model_name_or_path = "TheBloke/Mixtral-8x7B-MoE-RP-Story-AWQ"
242
+
243
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
244
+ model = AutoModelForCausalLM.from_pretrained(
245
+ model_name_or_path,
246
+ low_cpu_mem_usage=True,
247
+ device_map="cuda:0"
248
+ )
249
+
250
+ # Using the text streamer to stream output one token at a time
251
+ streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
252
+
253
+ prompt = "Tell me about AI"
254
+ prompt_template=f'''{prompt}
255
+ '''
256
+
257
+ # Convert prompt to tokens
258
+ tokens = tokenizer(
259
+ prompt_template,
260
+ return_tensors='pt'
261
+ ).input_ids.cuda()
262
+
263
+ generation_params = {
264
+ "do_sample": True,
265
+ "temperature": 0.7,
266
+ "top_p": 0.95,
267
+ "top_k": 40,
268
+ "max_new_tokens": 512,
269
+ "repetition_penalty": 1.1
270
+ }
271
+
272
+ # Generate streamed output, visible one token at a time
273
+ generation_output = model.generate(
274
+ tokens,
275
+ streamer=streamer,
276
+ **generation_params
277
+ )
278
+
279
+ # Generation without a streamer, which will include the prompt in the output
280
+ generation_output = model.generate(
281
+ tokens,
282
+ **generation_params
283
+ )
284
+
285
+ # Get the tokens from the output, decode them, print them
286
+ token_output = generation_output[0]
287
+ text_output = tokenizer.decode(token_output)
288
+ print("model.generate output: ", text_output)
289
+
290
+ # Inference is also possible via Transformers' pipeline
291
+ from transformers import pipeline
292
+
293
+ pipe = pipeline(
294
+ "text-generation",
295
+ model=model,
296
+ tokenizer=tokenizer,
297
+ **generation_params
298
+ )
299
+
300
+ pipe_output = pipe(prompt_template)[0]['generated_text']
301
+ print("pipeline output: ", pipe_output)
302
+
303
+ ```
304
+ <!-- README_AWQ.md-use-from-python end -->
305
+
306
+ <!-- README_AWQ.md-compatibility start -->
307
+ ## Compatibility
308
+
309
+ The files provided are tested to work with:
310
+
311
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
312
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
313
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
314
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later.
315
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
316
+
317
+ <!-- README_AWQ.md-compatibility end -->
318
+
319
+ <!-- footer start -->
320
+ <!-- 200823 -->
321
+ ## Discord
322
+
323
+ For further support, and discussions on these models and AI in general, join us at:
324
+
325
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
326
+
327
+ ## Thanks, and how to contribute
328
+
329
+ Thanks to the [chirper.ai](https://chirper.ai) team!
330
+
331
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
332
+
333
+ 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.
334
+
335
+ 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.
336
+
337
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
338
+
339
+ * Patreon: https://patreon.com/TheBlokeAI
340
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
341
+
342
+ **Special thanks to**: Aemon Algiz.
343
+
344
+ **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
345
+
346
+
347
+ Thank you to all my generous patrons and donaters!
348
+
349
+ And thank you again to a16z for their generous grant.
350
+
351
+ <!-- footer end -->
352
+
353
+ # Original model card: Undi's Mixtral 8X7B MoE RP Story
354
+
355
+
356
+ Mixtral-8x7B-MoE-RP-Story is a model made primarely for chatting, RP (Roleplay) and storywriting.
357
+ 2 RP model, 2 chat model, 1 occult model, 1 storywritting model, 1 mathematic model and 1 DPO model was used for a MoE. Bagel was the base.
358
+
359
+ The DPO chat model is here to help get more human reply.
360
+
361
+ This is my first try at doing this, so don't hesitate to give feedback!
362
+
363
+ WARNING: ALL THE "K" GGUF QUANT OF MIXTRAL MODELS SEEMS TO BE [BROKEN](https://cdn-uploads.huggingface.co/production/uploads/63ab1241ad514ca8d1430003/TvjEP14ps7ZUgJ-0-mhIX.png), PREFER Q4_0, Q5_0 or Q8_0!
364
+
365
+ <!-- description start -->
366
+ ## Description
367
+
368
+ This repo contains fp16 files of Mixtral-8x7B-MoE-RP-Story.
369
+
370
+ <!-- description end -->
371
+ <!-- description start -->
372
+ ## Models used
373
+
374
+ The list of model used and their activator/theme can be found [here](https://huggingface.co/Undi95/Mixtral-8x7B-MoE-RP-Story/blob/main/config.yaml)
375
+
376
+ <!-- description end -->
377
+ <!-- prompt-template start -->
378
+ ## Prompt template: Custom
379
+
380
+ Using Bagel as a base let us a lot of different prompting system theorically, you can see all the prompting available [here](https://huggingface.co/jondurbin/bagel-7b-v0.1#prompt-formatting).
381
+
382
+ If you want to support me, you can [here](https://ko-fi.com/undiai).