TheBloke commited on
Commit
5f22180
1 Parent(s): 4bc6f72

Upload README.md

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