TheBloke commited on
Commit
9044e99
1 Parent(s): 04994df

Upload README.md

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