TheBloke commited on
Commit
2f1c903
1 Parent(s): 939d85e

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +423 -0
README.md ADDED
@@ -0,0 +1,423 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: ddh0/OrcaMaidXL-17B-32k
3
+ inference: false
4
+ license: other
5
+ license_link: https://huggingface.co/microsoft/Orca-2-13b/blob/main/LICENSE
6
+ license_name: microsoft-research-license
7
+ model_creator: ddh0
8
+ model_name: OrcaMaidXL 17B 32K
9
+ model_type: llama
10
+ pipeline_tag: text-generation
11
+ prompt_template: 'Below is an instruction that describes a task. Write a response
12
+ that appropriately completes the request.
13
+
14
+
15
+ ### Instruction:
16
+
17
+ {prompt}
18
+
19
+
20
+ ### Response:
21
+
22
+ '
23
+ quantized_by: TheBloke
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
+ # OrcaMaidXL 17B 32K - AWQ
45
+ - Model creator: [ddh0](https://huggingface.co/ddh0)
46
+ - Original model: [OrcaMaidXL 17B 32K](https://huggingface.co/ddh0/OrcaMaidXL-17B-32k)
47
+
48
+ <!-- description start -->
49
+ ## Description
50
+
51
+ This repo contains AWQ model files for [ddh0's OrcaMaidXL 17B 32K](https://huggingface.co/ddh0/OrcaMaidXL-17B-32k).
52
+
53
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
54
+
55
+
56
+ ### About AWQ
57
+
58
+ 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.
59
+
60
+ AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
61
+
62
+ It is supported by:
63
+
64
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
65
+ - [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
66
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
67
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
68
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
69
+
70
+ <!-- description end -->
71
+ <!-- repositories-available start -->
72
+ ## Repositories available
73
+
74
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/OrcaMaidXL-17B-32k-AWQ)
75
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/OrcaMaidXL-17B-32k-GPTQ)
76
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/OrcaMaidXL-17B-32k-GGUF)
77
+ * [ddh0's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/ddh0/OrcaMaidXL-17B-32k)
78
+ <!-- repositories-available end -->
79
+
80
+ <!-- prompt-template start -->
81
+ ## Prompt template: Alpaca
82
+
83
+ ```
84
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
85
+
86
+ ### Instruction:
87
+ {prompt}
88
+
89
+ ### Response:
90
+
91
+ ```
92
+
93
+ <!-- prompt-template end -->
94
+ <!-- licensing start -->
95
+ ## Licensing
96
+
97
+ The creator of the source model has listed its license as `other`, and this quantization has therefore used that same license.
98
+
99
+ As this model is based on Llama 2, it is also subject to the Meta Llama 2 license terms, and the license files for that are additionally included. It should therefore be considered as being claimed to be licensed under both licenses. I contacted Hugging Face for clarification on dual licensing but they do not yet have an official position. Should this change, or should Meta provide any feedback on this situation, I will update this section accordingly.
100
+
101
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [ddh0's OrcaMaidXL 17B 32K](https://huggingface.co/ddh0/OrcaMaidXL-17B-32k).
102
+ <!-- licensing end -->
103
+ <!-- README_AWQ.md-provided-files start -->
104
+ ## Provided files, and AWQ parameters
105
+
106
+ I currently release 128g GEMM models only. The addition of group_size 32 models, and GEMV kernel models, is being actively considered.
107
+
108
+ Models are released as sharded safetensors files.
109
+
110
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
111
+ | ------ | ---- | -- | ----------- | ------- | ---- |
112
+ | [main](https://huggingface.co/TheBloke/OrcaMaidXL-17B-32k-AWQ/tree/main) | 4 | 128 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 9.56 GB
113
+
114
+ <!-- README_AWQ.md-provided-files end -->
115
+
116
+ <!-- README_AWQ.md-text-generation-webui start -->
117
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
118
+
119
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
120
+
121
+ 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.
122
+
123
+ 1. Click the **Model tab**.
124
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/OrcaMaidXL-17B-32k-AWQ`.
125
+ 3. Click **Download**.
126
+ 4. The model will start downloading. Once it's finished it will say "Done".
127
+ 5. In the top left, click the refresh icon next to **Model**.
128
+ 6. In the **Model** dropdown, choose the model you just downloaded: `OrcaMaidXL-17B-32k-AWQ`
129
+ 7. Select **Loader: AutoAWQ**.
130
+ 8. Click Load, and the model will load and is now ready for use.
131
+ 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.
132
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
133
+ <!-- README_AWQ.md-text-generation-webui end -->
134
+
135
+ <!-- README_AWQ.md-use-from-vllm start -->
136
+ ## Multi-user inference server: vLLM
137
+
138
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
139
+
140
+ - Please ensure you are using vLLM version 0.2 or later.
141
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
142
+
143
+ For example:
144
+
145
+ ```shell
146
+ python3 -m vllm.entrypoints.api_server --model TheBloke/OrcaMaidXL-17B-32k-AWQ --quantization awq --dtype auto
147
+ ```
148
+
149
+ - When using vLLM from Python code, again set `quantization=awq`.
150
+
151
+ For example:
152
+
153
+ ```python
154
+ from vllm import LLM, SamplingParams
155
+
156
+ prompts = [
157
+ "Tell me about AI",
158
+ "Write a story about llamas",
159
+ "What is 291 - 150?",
160
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
161
+ ]
162
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
163
+
164
+ ### Instruction:
165
+ {prompt}
166
+
167
+ ### Response:
168
+ '''
169
+
170
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
171
+
172
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
173
+
174
+ llm = LLM(model="TheBloke/OrcaMaidXL-17B-32k-AWQ", quantization="awq", dtype="auto")
175
+
176
+ outputs = llm.generate(prompts, sampling_params)
177
+
178
+ # Print the outputs.
179
+ for output in outputs:
180
+ prompt = output.prompt
181
+ generated_text = output.outputs[0].text
182
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
183
+ ```
184
+ <!-- README_AWQ.md-use-from-vllm start -->
185
+
186
+ <!-- README_AWQ.md-use-from-tgi start -->
187
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
188
+
189
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
190
+
191
+ Example Docker parameters:
192
+
193
+ ```shell
194
+ --model-id TheBloke/OrcaMaidXL-17B-32k-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
195
+ ```
196
+
197
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
198
+
199
+ ```shell
200
+ pip3 install huggingface-hub
201
+ ```
202
+
203
+ ```python
204
+ from huggingface_hub import InferenceClient
205
+
206
+ endpoint_url = "https://your-endpoint-url-here"
207
+
208
+ prompt = "Tell me about AI"
209
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
210
+
211
+ ### Instruction:
212
+ {prompt}
213
+
214
+ ### Response:
215
+ '''
216
+
217
+ client = InferenceClient(endpoint_url)
218
+ response = client.text_generation(prompt,
219
+ max_new_tokens=128,
220
+ do_sample=True,
221
+ temperature=0.7,
222
+ top_p=0.95,
223
+ top_k=40,
224
+ repetition_penalty=1.1)
225
+
226
+ print(f"Model output: ", response)
227
+ ```
228
+ <!-- README_AWQ.md-use-from-tgi end -->
229
+
230
+ <!-- README_AWQ.md-use-from-python start -->
231
+ ## Inference from Python code using Transformers
232
+
233
+ ### Install the necessary packages
234
+
235
+ - Requires: [Transformers](https://huggingface.co/docs/transformers) 4.35.0 or later.
236
+ - Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.6 or later.
237
+
238
+ ```shell
239
+ pip3 install --upgrade "autoawq>=0.1.6" "transformers>=4.35.0"
240
+ ```
241
+
242
+ Note that if you are using PyTorch 2.0.1, the above AutoAWQ command will automatically upgrade you to PyTorch 2.1.0.
243
+
244
+ If you are using CUDA 11.8 and wish to continue using PyTorch 2.0.1, instead run this command:
245
+
246
+ ```shell
247
+ pip3 install https://github.com/casper-hansen/AutoAWQ/releases/download/v0.1.6/autoawq-0.1.6+cu118-cp310-cp310-linux_x86_64.whl
248
+ ```
249
+
250
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
251
+
252
+ ```shell
253
+ pip3 uninstall -y autoawq
254
+ git clone https://github.com/casper-hansen/AutoAWQ
255
+ cd AutoAWQ
256
+ pip3 install .
257
+ ```
258
+
259
+ ### Transformers example code (requires Transformers 4.35.0 and later)
260
+
261
+ ```python
262
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
263
+
264
+ model_name_or_path = "TheBloke/OrcaMaidXL-17B-32k-AWQ"
265
+
266
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
267
+ model = AutoModelForCausalLM.from_pretrained(
268
+ model_name_or_path,
269
+ low_cpu_mem_usage=True,
270
+ device_map="cuda:0"
271
+ )
272
+
273
+ # Using the text streamer to stream output one token at a time
274
+ streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
275
+
276
+ prompt = "Tell me about AI"
277
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
278
+
279
+ ### Instruction:
280
+ {prompt}
281
+
282
+ ### Response:
283
+ '''
284
+
285
+ # Convert prompt to tokens
286
+ tokens = tokenizer(
287
+ prompt_template,
288
+ return_tensors='pt'
289
+ ).input_ids.cuda()
290
+
291
+ generation_params = {
292
+ "do_sample": True,
293
+ "temperature": 0.7,
294
+ "top_p": 0.95,
295
+ "top_k": 40,
296
+ "max_new_tokens": 512,
297
+ "repetition_penalty": 1.1
298
+ }
299
+
300
+ # Generate streamed output, visible one token at a time
301
+ generation_output = model.generate(
302
+ tokens,
303
+ streamer=streamer,
304
+ **generation_params
305
+ )
306
+
307
+ # Generation without a streamer, which will include the prompt in the output
308
+ generation_output = model.generate(
309
+ tokens,
310
+ **generation_params
311
+ )
312
+
313
+ # Get the tokens from the output, decode them, print them
314
+ token_output = generation_output[0]
315
+ text_output = tokenizer.decode(token_output)
316
+ print("model.generate output: ", text_output)
317
+
318
+ # Inference is also possible via Transformers' pipeline
319
+ from transformers import pipeline
320
+
321
+ pipe = pipeline(
322
+ "text-generation",
323
+ model=model,
324
+ tokenizer=tokenizer,
325
+ **generation_params
326
+ )
327
+
328
+ pipe_output = pipe(prompt_template)[0]['generated_text']
329
+ print("pipeline output: ", pipe_output)
330
+
331
+ ```
332
+ <!-- README_AWQ.md-use-from-python end -->
333
+
334
+ <!-- README_AWQ.md-compatibility start -->
335
+ ## Compatibility
336
+
337
+ The files provided are tested to work with:
338
+
339
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
340
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
341
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
342
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later.
343
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
344
+
345
+ <!-- README_AWQ.md-compatibility end -->
346
+
347
+ <!-- footer start -->
348
+ <!-- 200823 -->
349
+ ## Discord
350
+
351
+ For further support, and discussions on these models and AI in general, join us at:
352
+
353
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
354
+
355
+ ## Thanks, and how to contribute
356
+
357
+ Thanks to the [chirper.ai](https://chirper.ai) team!
358
+
359
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
360
+
361
+ 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.
362
+
363
+ 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.
364
+
365
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
366
+
367
+ * Patreon: https://patreon.com/TheBlokeAI
368
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
369
+
370
+ **Special thanks to**: Aemon Algiz.
371
+
372
+ **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
373
+
374
+
375
+ Thank you to all my generous patrons and donaters!
376
+
377
+ And thank you again to a16z for their generous grant.
378
+
379
+ <!-- footer end -->
380
+
381
+ # Original model card: ddh0's OrcaMaidXL 17B 32K
382
+
383
+
384
+ # OrcaMaidXL-17B-32k
385
+
386
+ This is a a slightly experimental frankenmerge of Microsoft's [Orca-2-13b](https://huggingface.co/microsoft/Orca-2-13b) and Undi and IkariDev's [Noromaid-v0.2-13b](https://huggingface.co/NeverSleep/Noromaid-13b-v0.2).
387
+
388
+ The model recipe is as follows:
389
+
390
+ ```
391
+ - [0, 12] from Noromaid (12 layers)
392
+ - [12, 22] from Orca (10 layers)
393
+ - [14, 24] from Orca (10 layers)
394
+ - [18, 28] from Orca (10 layers)
395
+ - [28, 40] from Noromaid (12 layers)
396
+ ```
397
+
398
+ In my testing so far, the model performs exceptionally well. Your experience may vary.
399
+
400
+ The prompt format is Alpaca. You can use the standard format as shown, but for best results, you should customize the system prompt to your specific needs.
401
+
402
+ ```
403
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
404
+
405
+ ### Instruction:
406
+ {YOUR MESSAGE HERE}
407
+
408
+ ### Response:
409
+ {BOT MESSAGE HERE}
410
+
411
+
412
+ ```
413
+
414
+ ### Misc. information
415
+ - Model size is 17.46B
416
+ - BOS token is `<s>`
417
+ - EOS token is `</s>`
418
+ - Native context length is `32768` via YaRN (original context length was `4096`)
419
+ - Base model is Llama 2
420
+ - Due to the inclusion of Orca-2-13b, the model is subject to the terms of the [Microsoft Research License](https://huggingface.co/microsoft/Orca-2-13b/blob/main/LICENSE)
421
+
422
+ ### Thanks
423
+ - Thanks to [Undi](https://ko-fi.com/undiai) and [IkariDev](https://ikaridevgit.github.io/) for Noromaid