Text Generation
Transformers
Safetensors
English
llama
text-generation-inference
4-bit precision
awq
TheBloke commited on
Commit
9a21227
1 Parent(s): 3de2a7c

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +307 -0
README.md ADDED
@@ -0,0 +1,307 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/openaccess-ai-collective/wizard-mega-13b
3
+ datasets:
4
+ - anon8231489123/ShareGPT_Vicuna_unfiltered
5
+ - ehartford/wizard_vicuna_70k_unfiltered
6
+ - ehartford/WizardLM_alpaca_evol_instruct_70k_unfiltered
7
+ inference: false
8
+ language:
9
+ - en
10
+ library_name: transformers
11
+ license: other
12
+ model_creator: Open Access AI Collective
13
+ model_name: Wizard Mega 13B
14
+ model_type: llama
15
+ pipeline_tag: text-generation
16
+ prompt_template: 'A chat between a curious user and an artificial intelligence assistant.
17
+ The assistant gives helpful, detailed, and polite answers to the user''s questions.
18
+ USER: {prompt} ASSISTANT:
19
+
20
+ '
21
+ quantized_by: TheBloke
22
+ ---
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
+ # Wizard Mega 13B - AWQ
42
+ - Model creator: [Open Access AI Collective](https://huggingface.co/openaccess-ai-collective)
43
+ - Original model: [Wizard Mega 13B](https://huggingface.co/openaccess-ai-collective/wizard-mega-13b)
44
+
45
+ <!-- description start -->
46
+ ## Description
47
+
48
+ This repo contains AWQ model files for [Open Access AI Collective's Wizard Mega 13B](https://huggingface.co/openaccess-ai-collective/wizard-mega-13b).
49
+
50
+
51
+ ### About AWQ
52
+
53
+ 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.
54
+
55
+ It is also now supported by continuous batching server [vLLM](https://github.com/vllm-project/vllm), allowing use of AWQ models for high-throughput concurrent inference in multi-user server scenarios. Note that, at the time of writing, overall throughput is still lower than running vLLM 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.
56
+ <!-- description end -->
57
+ <!-- repositories-available start -->
58
+ ## Repositories available
59
+
60
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/wizard-mega-13B-AWQ)
61
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/wizard-mega-13B-GPTQ)
62
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/wizard-mega-13B-GGUF)
63
+ * [Open Access AI Collective's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/openaccess-ai-collective/wizard-mega-13b)
64
+ <!-- repositories-available end -->
65
+
66
+ <!-- prompt-template start -->
67
+ ## Prompt template: Vicuna
68
+
69
+ ```
70
+ A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: {prompt} ASSISTANT:
71
+
72
+ ```
73
+
74
+ <!-- prompt-template end -->
75
+
76
+
77
+ <!-- README_AWQ.md-provided-files start -->
78
+ ## Provided files and AWQ parameters
79
+
80
+ 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.
81
+
82
+ Models are released as sharded safetensors files.
83
+
84
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
85
+ | ------ | ---- | -- | ----------- | ------- | ---- |
86
+ | [main](https://huggingface.co/TheBloke/wizard-mega-13B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 GB
87
+
88
+ <!-- README_AWQ.md-provided-files end -->
89
+
90
+ <!-- README_AWQ.md-use-from-vllm start -->
91
+ ## Serving this model from vLLM
92
+
93
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
94
+
95
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
96
+
97
+ ```shell
98
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/wizard-mega-13B-AWQ --quantization awq
99
+ ```
100
+
101
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
102
+
103
+ ```python
104
+ from vllm import LLM, SamplingParams
105
+
106
+ prompts = [
107
+ "Hello, my name is",
108
+ "The president of the United States is",
109
+ "The capital of France is",
110
+ "The future of AI is",
111
+ ]
112
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
113
+
114
+ llm = LLM(model="TheBloke/wizard-mega-13B-AWQ", quantization="awq")
115
+
116
+ outputs = llm.generate(prompts, sampling_params)
117
+
118
+ # Print the outputs.
119
+ for output in outputs:
120
+ prompt = output.prompt
121
+ generated_text = output.outputs[0].text
122
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
123
+ ```
124
+ <!-- README_AWQ.md-use-from-vllm start -->
125
+
126
+ <!-- README_AWQ.md-use-from-python start -->
127
+ ## How to use this AWQ model from Python code
128
+
129
+ ### Install the necessary packages
130
+
131
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
132
+
133
+ ```shell
134
+ pip3 install autoawq
135
+ ```
136
+
137
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
138
+
139
+ ```shell
140
+ pip3 uninstall -y autoawq
141
+ git clone https://github.com/casper-hansen/AutoAWQ
142
+ cd AutoAWQ
143
+ pip3 install .
144
+ ```
145
+
146
+ ### You can then try the following example code
147
+
148
+ ```python
149
+ from awq import AutoAWQForCausalLM
150
+ from transformers import AutoTokenizer
151
+
152
+ model_name_or_path = "TheBloke/wizard-mega-13B-AWQ"
153
+
154
+ # Load model
155
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
156
+ trust_remote_code=False, safetensors=True)
157
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
158
+
159
+ prompt = "Tell me about AI"
160
+ prompt_template=f'''A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: {prompt} ASSISTANT:
161
+
162
+ '''
163
+
164
+ print("\n\n*** Generate:")
165
+
166
+ tokens = tokenizer(
167
+ prompt_template,
168
+ return_tensors='pt'
169
+ ).input_ids.cuda()
170
+
171
+ # Generate output
172
+ generation_output = model.generate(
173
+ tokens,
174
+ do_sample=True,
175
+ temperature=0.7,
176
+ top_p=0.95,
177
+ top_k=40,
178
+ max_new_tokens=512
179
+ )
180
+
181
+ print("Output: ", tokenizer.decode(generation_output[0]))
182
+
183
+ # Inference can also be done using transformers' pipeline
184
+ from transformers import pipeline
185
+
186
+ print("*** Pipeline:")
187
+ pipe = pipeline(
188
+ "text-generation",
189
+ model=model,
190
+ tokenizer=tokenizer,
191
+ max_new_tokens=512,
192
+ do_sample=True,
193
+ temperature=0.7,
194
+ top_p=0.95,
195
+ top_k=40,
196
+ repetition_penalty=1.1
197
+ )
198
+
199
+ print(pipe(prompt_template)[0]['generated_text'])
200
+ ```
201
+ <!-- README_AWQ.md-use-from-python end -->
202
+
203
+ <!-- README_AWQ.md-compatibility start -->
204
+ ## Compatibility
205
+
206
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
207
+
208
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is not yet compatible with AWQ, but a PR is open which should bring support soon: [TGI PR #781](https://github.com/huggingface/text-generation-inference/issues/781).
209
+ <!-- README_AWQ.md-compatibility end -->
210
+
211
+ <!-- footer start -->
212
+ <!-- 200823 -->
213
+ ## Discord
214
+
215
+ For further support, and discussions on these models and AI in general, join us at:
216
+
217
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
218
+
219
+ ## Thanks, and how to contribute
220
+
221
+ Thanks to the [chirper.ai](https://chirper.ai) team!
222
+
223
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
224
+
225
+ 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.
226
+
227
+ 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.
228
+
229
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
230
+
231
+ * Patreon: https://patreon.com/TheBlokeAI
232
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
233
+
234
+ **Special thanks to**: Aemon Algiz.
235
+
236
+ **Patreon special mentions**: Alicia Loh, Stephen Murray, K, Ajan Kanaga, RoA, Magnesian, Deo Leter, Olakabola, Eugene Pentland, zynix, Deep Realms, Raymond Fosdick, Elijah Stavena, Iucharbius, Erik Bjäreholt, Luis Javier Navarrete Lozano, Nicholas, theTransient, John Detwiler, alfie_i, knownsqashed, Mano Prime, Willem Michiel, Enrico Ros, LangChain4j, OG, Michael Dempsey, Pierre Kircher, Pedro Madruga, James Bentley, Thomas Belote, Luke @flexchar, Leonard Tan, Johann-Peter Hartmann, Illia Dulskyi, Fen Risland, Chadd, S_X, Jeff Scroggin, Ken Nordquist, Sean Connelly, Artur Olbinski, Swaroop Kallakuri, Jack West, Ai Maven, David Ziegler, Russ Johnson, transmissions 11, John Villwock, Alps Aficionado, Clay Pascal, Viktor Bowallius, Subspace Studios, Rainer Wilmers, Trenton Dambrowitz, vamX, Michael Levine, 준교 김, Brandon Frisco, Kalila, Trailburnt, Randy H, Talal Aujan, Nathan Dryer, Vadim, 阿明, ReadyPlayerEmma, Tiffany J. Kim, George Stoitzev, Spencer Kim, Jerry Meng, Gabriel Tamborski, Cory Kujawski, Jeffrey Morgan, Spiking Neurons AB, Edmond Seymore, Alexandros Triantafyllidis, Lone Striker, Cap'n Zoog, Nikolai Manek, danny, ya boyyy, Derek Yates, usrbinkat, Mandus, TL, Nathan LeClaire, subjectnull, Imad Khwaja, webtim, Raven Klaugh, Asp the Wyvern, Gabriel Puliatti, Caitlyn Gatomon, Joseph William Delisle, Jonathan Leane, Luke Pendergrass, SuperWojo, Sebastain Graf, Will Dee, Fred von Graf, Andrey, Dan Guido, Daniel P. Andersen, Nitin Borwankar, Elle, Vitor Caleffi, biorpg, jjj, NimbleBox.ai, Pieter, Matthew Berman, terasurfer, Michael Davis, Alex, Stanislav Ovsiannikov
237
+
238
+
239
+ Thank you to all my generous patrons and donaters!
240
+
241
+ And thank you again to a16z for their generous grant.
242
+
243
+ <!-- footer end -->
244
+
245
+ # Original model card: Open Access AI Collective's Wizard Mega 13B
246
+
247
+
248
+ # Wizard Mega 13B has been updated and is now Manticore 13B
249
+
250
+ [<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)
251
+ **[💵 Donate to OpenAccess AI Collective](https://github.com/sponsors/OpenAccess-AI-Collective) to help us keep building great tools and models!**
252
+
253
+ Manticore is available at https://huggingface.co/openaccess-ai-collective/manticore-13b and fixes many issues with Wizard Mega and adds new datasets to the training.
254
+
255
+ Wizard Mega is a Llama 13B model fine-tuned on the [ShareGPT](https://huggingface.co/datasets/anon8231489123/ShareGPT_Vicuna_unfiltered), [WizardLM](https://huggingface.co/datasets/ehartford/WizardLM_alpaca_evol_instruct_70k_unfiltered), and [Wizard-Vicuna](https://huggingface.co/datasets/ehartford/wizard_vicuna_70k_unfiltered) datasets. These particular datasets have all been filtered to remove responses where the model responds with "As an AI language model...", etc or when the model refuses to respond.
256
+
257
+ # Demo
258
+
259
+ Try out the model in HF Spaces. The demo uses a quantized GGML version of the model to quickly return predictions on smaller GPUs (and even CPUs). Quantized GGML may have some minimal loss of model quality.
260
+ - https://huggingface.co/spaces/openaccess-ai-collective/wizard-mega-ggml
261
+
262
+ ## Release (Epoch Two)
263
+
264
+ The Wizard Mega 13B SFT model is being released after two epochs as the eval loss increased during the 3rd (final planned epoch). Because of this, we have preliminarily decided to use the epoch 2 checkpoint as the final release candidate. https://wandb.ai/wing-lian/vicuna-13b/runs/5uebgm49
265
+
266
+ ## Build
267
+
268
+ Wizard Mega was built with [Axolotl](https://github.com/OpenAccess-AI-Collective/axolotl) on 8xA100 80GB for 15 hours. The configuration to duplicate this build is provided in this repo's [/config folder](https://huggingface.co/openaccess-ai-collective/wizard-mega-13b/tree/main/configs).
269
+
270
+ ## Bias, Risks, and Limitations
271
+ Wizard Mega has not been aligned to human preferences with techniques like RLHF or deployed with in-the-loop filtering of responses like ChatGPT, so the model can produce problematic outputs (especially when prompted to do so).
272
+ Wizard Mega was fine-tuned from the base model LlaMa 13B, please refer to its model card's Limitations Section for relevant information.
273
+
274
+ ## Examples
275
+
276
+ ````
277
+ ### Instruction: write Python code that returns the first n numbers of the Fibonacci sequence using memoization.
278
+
279
+ ### Assistant:
280
+ ```python
281
+ def fib(n):
282
+ if n < 2:
283
+ return n
284
+ elif n in cache:
285
+ return cache[n]
286
+ else:
287
+ a, b = 0, 1
288
+ for i in range(2, n+1):
289
+ cache[i] = a
290
+ a, b = b, a + b
291
+ return cache[n]
292
+
293
+ def first_n(n):
294
+ fib_list = [fib(i) for i in range(n+1)]
295
+ return fib_list[:n]
296
+ ```
297
+ This function uses memoization to store the values of previous Fibonacci numbers in a cache. This way, if the same number is requested again, it can be returned immediately without recalculating it.
298
+ The `first_n` function takes an integer `n` as input, and calculates the first n numbers of the Fibonacci sequence using memoization. It returns a list of those numbers.
299
+ ````
300
+
301
+ ```
302
+ ### Instruction: Finish the joke, a mechanic and a car salesman walk into a bar...
303
+
304
+ ### Assistant: ...and the bartender says "Hey guys, what can I get for you?" The mechanic replies, "I'll have a beer, but make it a quick one. I have to fix this guy's car before he finds out I
305
+ fiddled with his brakes." The salesman quips, "And I'll have a martini, shaken not stirred. After all, I have to sell this guy a car that doesn't break down on him within the first year of ownership."
306
+ ```
307
+