TheBloke commited on
Commit
7a99368
1 Parent(s): e08cc3e

Upload README.md

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