TheBloke commited on
Commit
48f10d9
1 Parent(s): acebe4f

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +357 -0
README.md ADDED
@@ -0,0 +1,357 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Undi95/UndiMix-v3-13B
3
+ inference: false
4
+ license: cc-by-nc-4.0
5
+ model_creator: Undi
6
+ model_name: Undimix v3 13B
7
+ model_type: llama
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
+
23
+ <!-- header start -->
24
+ <!-- 200823 -->
25
+ <div style="width: auto; margin-left: auto; margin-right: auto">
26
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
27
+ </div>
28
+ <div style="display: flex; justify-content: space-between; width: 100%;">
29
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
30
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
31
+ </div>
32
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
33
+ <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>
34
+ </div>
35
+ </div>
36
+ <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>
37
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
38
+ <!-- header end -->
39
+
40
+ # Undimix v3 13B - AWQ
41
+ - Model creator: [Undi](https://huggingface.co/Undi95)
42
+ - Original model: [Undimix v3 13B](https://huggingface.co/Undi95/UndiMix-v3-13B)
43
+
44
+ <!-- description start -->
45
+ ## Description
46
+
47
+ This repo contains AWQ model files for [Undi's Undimix v3 13B](https://huggingface.co/Undi95/UndiMix-v3-13B).
48
+
49
+
50
+ ### About AWQ
51
+
52
+ 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.
53
+
54
+ It is also now supported by continuous batching server [vLLM](https://github.com/vllm-project/vllm), allowing use of Llama AWQ models for high-throughput concurrent inference in multi-user server scenarios.
55
+
56
+ As of September 25th 2023, preliminary Llama-only AWQ support has also been added to [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference).
57
+
58
+ Note that, at the time of writing, overall throughput is still lower than running vLLM or TGI with unquantised models, however using AWQ enables using much smaller GPUs which can lead to easier deployment and overall cost savings. For example, a 70B model can be run on 1 x 48GB GPU instead of 2 x 80GB.
59
+ <!-- description end -->
60
+ <!-- repositories-available start -->
61
+ ## Repositories available
62
+
63
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/UndiMix-v3-13B-AWQ)
64
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/UndiMix-v3-13B-GPTQ)
65
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/UndiMix-v3-13B-GGUF)
66
+ * [Undi's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Undi95/UndiMix-v3-13B)
67
+ <!-- repositories-available end -->
68
+
69
+ <!-- prompt-template start -->
70
+ ## Prompt template: Alpaca
71
+
72
+ ```
73
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
74
+
75
+ ### Instruction:
76
+ {prompt}
77
+
78
+ ### Response:
79
+
80
+ ```
81
+
82
+ <!-- prompt-template end -->
83
+ <!-- licensing start -->
84
+ ## Licensing
85
+
86
+ The creator of the source model has listed its license as `cc-by-nc-4.0`, and this quantization has therefore used that same license.
87
+
88
+ 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.
89
+
90
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [Undi's Undimix v3 13B](https://huggingface.co/Undi95/UndiMix-v3-13B).
91
+ <!-- licensing end -->
92
+ <!-- README_AWQ.md-provided-files start -->
93
+ ## Provided files, and AWQ parameters
94
+
95
+ For my first release of AWQ models, I am releasing 128g models only. I will consider adding 32g as well if there is interest, and once I have done perplexity and evaluation comparisons, but at this time 32g models are still not fully tested with AutoAWQ and vLLM.
96
+
97
+ Models are released as sharded safetensors files.
98
+
99
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
100
+ | ------ | ---- | -- | ----------- | ------- | ---- |
101
+ | [main](https://huggingface.co/TheBloke/UndiMix-v3-13B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 GB
102
+
103
+ <!-- README_AWQ.md-provided-files end -->
104
+
105
+ <!-- README_AWQ.md-use-from-vllm start -->
106
+ ## Serving this model from vLLM
107
+
108
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
109
+
110
+ Note: at the time of writing, vLLM has not yet done a new release with AWQ support.
111
+
112
+ If you try the vLLM examples below and get an error about `quantization` being unrecognised, or other AWQ-related issues, please install vLLM from Github source.
113
+
114
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
115
+
116
+ ```shell
117
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/UndiMix-v3-13B-AWQ --quantization awq --dtype half
118
+ ```
119
+
120
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
121
+
122
+ ```python
123
+ from vllm import LLM, SamplingParams
124
+
125
+ prompts = [
126
+ "Hello, my name is",
127
+ "The president of the United States is",
128
+ "The capital of France is",
129
+ "The future of AI is",
130
+ ]
131
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
132
+
133
+ llm = LLM(model="TheBloke/UndiMix-v3-13B-AWQ", quantization="awq", dtype="half")
134
+
135
+ outputs = llm.generate(prompts, sampling_params)
136
+
137
+ # Print the outputs.
138
+ for output in outputs:
139
+ prompt = output.prompt
140
+ generated_text = output.outputs[0].text
141
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
142
+ ```
143
+ <!-- README_AWQ.md-use-from-vllm start -->
144
+
145
+ <!-- README_AWQ.md-use-from-tgi start -->
146
+ ## Serving this model from Text Generation Inference (TGI)
147
+
148
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
149
+
150
+ Example Docker parameters:
151
+
152
+ ```shell
153
+ --model-id TheBloke/UndiMix-v3-13B-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
154
+ ```
155
+
156
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
157
+
158
+ ```shell
159
+ pip3 install huggingface-hub
160
+ ```
161
+
162
+ ```python
163
+ from huggingface_hub import InferenceClient
164
+
165
+ endpoint_url = "https://your-endpoint-url-here"
166
+
167
+ prompt = "Tell me about AI"
168
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
169
+
170
+ ### Instruction:
171
+ {prompt}
172
+
173
+ ### Response:
174
+
175
+ '''
176
+
177
+ client = InferenceClient(endpoint_url)
178
+ response = client.text_generation(prompt,
179
+ max_new_tokens=128,
180
+ do_sample=True,
181
+ temperature=0.7,
182
+ top_p=0.95,
183
+ top_k=40,
184
+ repetition_penalty=1.1)
185
+
186
+ print(f"Model output: {response}")
187
+ ```
188
+ <!-- README_AWQ.md-use-from-tgi end -->
189
+
190
+ <!-- README_AWQ.md-use-from-python start -->
191
+ ## How to use this AWQ model from Python code
192
+
193
+ ### Install the necessary packages
194
+
195
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.1 or later
196
+
197
+ ```shell
198
+ pip3 install autoawq
199
+ ```
200
+
201
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
202
+
203
+ ```shell
204
+ pip3 uninstall -y autoawq
205
+ git clone https://github.com/casper-hansen/AutoAWQ
206
+ cd AutoAWQ
207
+ pip3 install .
208
+ ```
209
+
210
+ ### You can then try the following example code
211
+
212
+ ```python
213
+ from awq import AutoAWQForCausalLM
214
+ from transformers import AutoTokenizer
215
+
216
+ model_name_or_path = "TheBloke/UndiMix-v3-13B-AWQ"
217
+
218
+ # Load model
219
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
220
+ trust_remote_code=False, safetensors=True)
221
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
222
+
223
+ prompt = "Tell me about AI"
224
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
225
+
226
+ ### Instruction:
227
+ {prompt}
228
+
229
+ ### Response:
230
+
231
+ '''
232
+
233
+ print("\n\n*** Generate:")
234
+
235
+ tokens = tokenizer(
236
+ prompt_template,
237
+ return_tensors='pt'
238
+ ).input_ids.cuda()
239
+
240
+ # Generate output
241
+ generation_output = model.generate(
242
+ tokens,
243
+ do_sample=True,
244
+ temperature=0.7,
245
+ top_p=0.95,
246
+ top_k=40,
247
+ max_new_tokens=512
248
+ )
249
+
250
+ print("Output: ", tokenizer.decode(generation_output[0]))
251
+
252
+ """
253
+ # Inference should be possible with transformers pipeline as well in future
254
+ # But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
255
+ from transformers import pipeline
256
+
257
+ print("*** Pipeline:")
258
+ pipe = pipeline(
259
+ "text-generation",
260
+ model=model,
261
+ tokenizer=tokenizer,
262
+ max_new_tokens=512,
263
+ do_sample=True,
264
+ temperature=0.7,
265
+ top_p=0.95,
266
+ top_k=40,
267
+ repetition_penalty=1.1
268
+ )
269
+
270
+ print(pipe(prompt_template)[0]['generated_text'])
271
+ """
272
+ ```
273
+ <!-- README_AWQ.md-use-from-python end -->
274
+
275
+ <!-- README_AWQ.md-compatibility start -->
276
+ ## Compatibility
277
+
278
+ The files provided are tested to work with:
279
+
280
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ)
281
+ - [vLLM](https://github.com/vllm-project/vllm)
282
+ - [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
283
+
284
+ TGI merged AWQ support on September 25th, 2023: [TGI PR #1054](https://github.com/huggingface/text-generation-inference/pull/1054). Use the `:latest` Docker container until the next TGI release is made.
285
+
286
+ <!-- README_AWQ.md-compatibility end -->
287
+
288
+ <!-- footer start -->
289
+ <!-- 200823 -->
290
+ ## Discord
291
+
292
+ For further support, and discussions on these models and AI in general, join us at:
293
+
294
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
295
+
296
+ ## Thanks, and how to contribute
297
+
298
+ Thanks to the [chirper.ai](https://chirper.ai) team!
299
+
300
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
301
+
302
+ 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.
303
+
304
+ 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.
305
+
306
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
307
+
308
+ * Patreon: https://patreon.com/TheBlokeAI
309
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
310
+
311
+ **Special thanks to**: Aemon Algiz.
312
+
313
+ **Patreon special mentions**: Pierre Kircher, Stanislav Ovsiannikov, Michael Levine, Eugene Pentland, Andrey, 준교 김, Randy H, Fred von Graf, Artur Olbinski, Caitlyn Gatomon, terasurfer, Jeff Scroggin, James Bentley, Vadim, Gabriel Puliatti, Harry Royden McLaughlin, Sean Connelly, Dan Guido, Edmond Seymore, Alicia Loh, subjectnull, AzureBlack, Manuel Alberto Morcote, Thomas Belote, Lone Striker, Chris Smitley, Vitor Caleffi, Johann-Peter Hartmann, Clay Pascal, biorpg, Brandon Frisco, sidney chen, transmissions 11, Pedro Madruga, jinyuan sun, Ajan Kanaga, Emad Mostaque, Trenton Dambrowitz, Jonathan Leane, Iucharbius, usrbinkat, vamX, George Stoitzev, Luke Pendergrass, theTransient, Olakabola, Swaroop Kallakuri, Cap'n Zoog, Brandon Phillips, Michael Dempsey, Nikolai Manek, danny, Matthew Berman, Gabriel Tamborski, alfie_i, Raymond Fosdick, Tom X Nguyen, Raven Klaugh, LangChain4j, Magnesian, Illia Dulskyi, David Ziegler, Mano Prime, Luis Javier Navarrete Lozano, Erik Bjäreholt, 阿明, Nathan Dryer, Alex, Rainer Wilmers, zynix, TL, Joseph William Delisle, John Villwock, Nathan LeClaire, Willem Michiel, Joguhyik, GodLy, OG, Alps Aficionado, Jeffrey Morgan, ReadyPlayerEmma, Tiffany J. Kim, Sebastain Graf, Spencer Kim, Michael Davis, webtim, Talal Aujan, knownsqashed, John Detwiler, Imad Khwaja, Deo Leter, Jerry Meng, Elijah Stavena, Rooh Singh, Pieter, SuperWojo, Alexandros Triantafyllidis, Stephen Murray, Ai Maven, ya boyyy, Enrico Ros, Ken Nordquist, Deep Realms, Nicholas, Spiking Neurons AB, Elle, Will Dee, Jack West, RoA, Luke @flexchar, Viktor Bowallius, Derek Yates, Subspace Studios, jjj, Toran Billups, Asp the Wyvern, Fen Risland, Ilya, NimbleBox.ai, Chadd, Nitin Borwankar, Emre, Mandus, Leonard Tan, Kalila, K, Trailburnt, S_X, Cory Kujawski
314
+
315
+
316
+ Thank you to all my generous patrons and donaters!
317
+
318
+ And thank you again to a16z for their generous grant.
319
+
320
+ <!-- footer end -->
321
+
322
+ # Original model card: Undi's Undimix v3 13B
323
+
324
+
325
+ <!-- description start -->
326
+ ## Description
327
+
328
+ This repo contains fp16 files of personal mix : "UndiMix-v3".
329
+
330
+ It can be hot, serious, playful, and can use emoji thanks to llama-2-13b-chat-limarp-v2-merged.
331
+
332
+ What change from V2 is the that I didn't use Llama-2-13B-fp16 for the base anymore, and got straight into the merging with SLERP taking ReMM-S-Kimiko-v2-13B as a base.
333
+
334
+ <!-- description end -->
335
+ <!-- description start -->
336
+ ## Models used
337
+
338
+ - Undi95/ReMM-S-Kimiko-v2-13B (0.272) (base)
339
+ - The-Face-Of-Goonery/Huginn-13b-v1.2 (0.264)
340
+ - Doctor-Shotgun/llama-2-13b-chat-limarp-v2-merged (0.264)
341
+ - jondurbin/airoboros-l2-13b-2.1 (0.10)
342
+ - IkariDev/Athena-v1 (0.10)
343
+ <!-- description end -->
344
+ <!-- prompt-template start -->
345
+ ## Prompt template: Alpaca
346
+
347
+ ```
348
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
349
+
350
+ ### Instruction:
351
+ {prompt}
352
+
353
+ ### Response:
354
+
355
+ ```
356
+
357
+ Special thanks to Sushi kek