TheBloke commited on
Commit
2eefb24
·
1 Parent(s): bfb56ca

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +349 -0
README.md ADDED
@@ -0,0 +1,349 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/ariellee/SuperPlatty-30B
3
+ inference: false
4
+ language:
5
+ - en
6
+ license: other
7
+ metrics:
8
+ - MMLU
9
+ - ARC
10
+ - HellaSwag
11
+ - TruthfulQA
12
+ model_creator: Ariel Lee
13
+ model_name: SuperPlatty 30B
14
+ model_type: llama
15
+ prompt_template: 'Below is an instruction that describes a task. Write a response
16
+ that appropriately completes the request.
17
+
18
+
19
+ ### Instruction:
20
+
21
+ {prompt}
22
+
23
+
24
+ ### Response:
25
+
26
+ '
27
+ quantized_by: TheBloke
28
+ tags:
29
+ - llama
30
+ ---
31
+
32
+ <!-- header start -->
33
+ <!-- 200823 -->
34
+ <div style="width: auto; margin-left: auto; margin-right: auto">
35
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
36
+ </div>
37
+ <div style="display: flex; justify-content: space-between; width: 100%;">
38
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
39
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
40
+ </div>
41
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
42
+ <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>
43
+ </div>
44
+ </div>
45
+ <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>
46
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
47
+ <!-- header end -->
48
+
49
+ # SuperPlatty 30B - AWQ
50
+ - Model creator: [Ariel Lee](https://huggingface.co/ariellee)
51
+ - Original model: [SuperPlatty 30B](https://huggingface.co/ariellee/SuperPlatty-30B)
52
+
53
+ <!-- description start -->
54
+ ## Description
55
+
56
+ This repo contains AWQ model files for [Ariel Lee's SuperPlatty 30B](https://huggingface.co/ariellee/SuperPlatty-30B).
57
+
58
+
59
+ ### About AWQ
60
+
61
+ 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.
62
+
63
+ 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.
64
+ <!-- description end -->
65
+ <!-- repositories-available start -->
66
+ ## Repositories available
67
+
68
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/SuperPlatty-30B-AWQ)
69
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/SuperPlatty-30B-GPTQ)
70
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/SuperPlatty-30B-GGUF)
71
+ * [Ariel Lee's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/ariellee/SuperPlatty-30B)
72
+ <!-- repositories-available end -->
73
+
74
+ <!-- prompt-template start -->
75
+ ## Prompt template: Alpaca
76
+
77
+ ```
78
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
79
+
80
+ ### Instruction:
81
+ {prompt}
82
+
83
+ ### Response:
84
+
85
+ ```
86
+
87
+ <!-- prompt-template end -->
88
+ <!-- licensing start -->
89
+ ## Licensing
90
+
91
+ The creator of the source model has listed its license as `other`, and this quantization has therefore used that same license.
92
+
93
+ 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.
94
+
95
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [Ariel Lee's SuperPlatty 30B](https://huggingface.co/ariellee/SuperPlatty-30B).
96
+ <!-- licensing end -->
97
+ <!-- README_AWQ.md-provided-files start -->
98
+ ## Provided files and AWQ parameters
99
+
100
+ 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.
101
+
102
+ Models are released as sharded safetensors files.
103
+
104
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
105
+ | ------ | ---- | -- | ----------- | ------- | ---- |
106
+ | [main](https://huggingface.co/TheBloke/SuperPlatty-30B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 17.53 GB
107
+
108
+ <!-- README_AWQ.md-provided-files end -->
109
+
110
+ <!-- README_AWQ.md-use-from-vllm start -->
111
+ ## Serving this model from vLLM
112
+
113
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
114
+
115
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
116
+
117
+ ```shell
118
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/SuperPlatty-30B-AWQ --quantization awq
119
+ ```
120
+
121
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
122
+
123
+ ```python
124
+ from vllm import LLM, SamplingParams
125
+
126
+ prompts = [
127
+ "Hello, my name is",
128
+ "The president of the United States is",
129
+ "The capital of France is",
130
+ "The future of AI is",
131
+ ]
132
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
133
+
134
+ llm = LLM(model="TheBloke/SuperPlatty-30B-AWQ", quantization="awq")
135
+
136
+ outputs = llm.generate(prompts, sampling_params)
137
+
138
+ # Print the outputs.
139
+ for output in outputs:
140
+ prompt = output.prompt
141
+ generated_text = output.outputs[0].text
142
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
143
+ ```
144
+ <!-- README_AWQ.md-use-from-vllm start -->
145
+
146
+ <!-- README_AWQ.md-use-from-python start -->
147
+ ## How to use this AWQ model from Python code
148
+
149
+ ### Install the necessary packages
150
+
151
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
152
+
153
+ ```shell
154
+ pip3 install autoawq
155
+ ```
156
+
157
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
158
+
159
+ ```shell
160
+ pip3 uninstall -y autoawq
161
+ git clone https://github.com/casper-hansen/AutoAWQ
162
+ cd AutoAWQ
163
+ pip3 install .
164
+ ```
165
+
166
+ ### You can then try the following example code
167
+
168
+ ```python
169
+ from awq import AutoAWQForCausalLM
170
+ from transformers import AutoTokenizer
171
+
172
+ model_name_or_path = "TheBloke/SuperPlatty-30B-AWQ"
173
+
174
+ # Load model
175
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
176
+ trust_remote_code=False, safetensors=True)
177
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
178
+
179
+ prompt = "Tell me about AI"
180
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
181
+
182
+ ### Instruction:
183
+ {prompt}
184
+
185
+ ### Response:
186
+
187
+ '''
188
+
189
+ print("\n\n*** Generate:")
190
+
191
+ tokens = tokenizer(
192
+ prompt_template,
193
+ return_tensors='pt'
194
+ ).input_ids.cuda()
195
+
196
+ # Generate output
197
+ generation_output = model.generate(
198
+ tokens,
199
+ do_sample=True,
200
+ temperature=0.7,
201
+ top_p=0.95,
202
+ top_k=40,
203
+ max_new_tokens=512
204
+ )
205
+
206
+ print("Output: ", tokenizer.decode(generation_output[0]))
207
+
208
+ # Inference can also be done using transformers' pipeline
209
+ from transformers import pipeline
210
+
211
+ print("*** Pipeline:")
212
+ pipe = pipeline(
213
+ "text-generation",
214
+ model=model,
215
+ tokenizer=tokenizer,
216
+ max_new_tokens=512,
217
+ do_sample=True,
218
+ temperature=0.7,
219
+ top_p=0.95,
220
+ top_k=40,
221
+ repetition_penalty=1.1
222
+ )
223
+
224
+ print(pipe(prompt_template)[0]['generated_text'])
225
+ ```
226
+ <!-- README_AWQ.md-use-from-python end -->
227
+
228
+ <!-- README_AWQ.md-compatibility start -->
229
+ ## Compatibility
230
+
231
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
232
+
233
+ [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).
234
+ <!-- README_AWQ.md-compatibility end -->
235
+
236
+ <!-- footer start -->
237
+ <!-- 200823 -->
238
+ ## Discord
239
+
240
+ For further support, and discussions on these models and AI in general, join us at:
241
+
242
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
243
+
244
+ ## Thanks, and how to contribute
245
+
246
+ Thanks to the [chirper.ai](https://chirper.ai) team!
247
+
248
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
249
+
250
+ 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.
251
+
252
+ 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.
253
+
254
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
255
+
256
+ * Patreon: https://patreon.com/TheBlokeAI
257
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
258
+
259
+ **Special thanks to**: Aemon Algiz.
260
+
261
+ **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
262
+
263
+
264
+ Thank you to all my generous patrons and donaters!
265
+
266
+ And thank you again to a16z for their generous grant.
267
+
268
+ <!-- footer end -->
269
+
270
+ # Original model card: Ariel Lee's SuperPlatty 30B
271
+
272
+
273
+ # Information
274
+
275
+ SuperPlatty-30B is a merge of [garage-bAInd/Platypus-30B](https://huggingface.co/lilloukas/Platypus-30B) and [kaiokendev/SuperCOT-LoRA](https://huggingface.co/kaiokendev/SuperCOT-LoRA)
276
+
277
+ | Metric | Value |
278
+ |-----------------------|-------|
279
+ | MMLU (5-shot) | 62.6 |
280
+ | ARC (25-shot) | 66.1 |
281
+ | HellaSwag (10-shot) | 83.9 |
282
+ | TruthfulQA (0-shot) | 54.0 |
283
+ | Avg. | 66.6 |
284
+
285
+ We use state-of-the-art EleutherAI [Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) to run the benchmark tests above.
286
+
287
+ ## Model Details
288
+
289
+ * **Trained by**: Platypus-30B trained by Cole Hunter & Ariel Lee; SuperCOT-LoRA trained by kaiokendev.
290
+ * **Model type:** **SuperPlatty-30B** is an auto-regressive language model based on the LLaMA transformer architecture.
291
+ * **Language(s)**: English
292
+ * **License for base weights**: License for the base LLaMA model's weights is Meta's [non-commercial bespoke license](https://github.com/facebookresearch/llama/blob/main/MODEL_CARD.md).
293
+
294
+ | Hyperparameter | Value |
295
+ |---------------------------|-------|
296
+ | \\(n_\text{parameters}\\) | 33B |
297
+ | \\(d_\text{model}\\) | 6656 |
298
+ | \\(n_\text{layers}\\) | 60 |
299
+ | \\(n_\text{heads}\\) | 52 |
300
+
301
+
302
+ ## Reproducing Evaluation Results
303
+ Install LM Evaluation Harness:
304
+ ```
305
+ git clone https://github.com/EleutherAI/lm-evaluation-harness
306
+ cd lm-evaluation-harness
307
+ pip install -e .
308
+ ```
309
+ Each task was evaluated on a single A100 80GB GPU.
310
+
311
+ ARC:
312
+ ```
313
+ python main.py --model hf-causal-experimental --model_args pretrained=garage-bAIdnd/SuperPlatty-30B --tasks arc_challenge --batch_size 1 --no_cache --write_out --output_path results/SuperPlatty-30B/arc_challenge_25shot.json --device cuda --num_fewshot 25
314
+ ```
315
+
316
+ HellaSwag:
317
+ ```
318
+ python main.py --model hf-causal-experimental --model_args pretrained=garage-bAIdnd/SuperPlatty-30B --tasks hellaswag --batch_size 1 --no_cache --write_out --output_path results/SuperPlatty-30B/hellaswag_10shot.json --device cuda --num_fewshot 10
319
+ ```
320
+
321
+ MMLU:
322
+ ```
323
+ python main.py --model hf-causal-experimental --model_args pretrained=garage-bAIdnd/SuperPlatty-30B --tasks hendrycksTest-* --batch_size 1 --no_cache --write_out --output_path results/SuperPlatty-30B/mmlu_5shot.json --device cuda --num_fewshot 5
324
+ ```
325
+
326
+ TruthfulQA:
327
+ ```
328
+ python main.py --model hf-causal-experimental --model_args pretrained=garage-bAIdnd/SuperPlatty-30B --tasks truthfulqa_mc --batch_size 1 --no_cache --write_out --output_path results/SuperPlatty-30B/truthfulqa_0shot.json --device cuda
329
+ ```
330
+ ## Limitations and bias
331
+
332
+ The base LLaMA model is trained on various data, some of which may contain offensive, harmful, and biased content that can lead to toxic behavior. See Section 5.1 of the LLaMA paper. We have not performed any studies to determine how fine-tuning on the aforementioned datasets affect the model's behavior and toxicity. Do not treat chat responses from this model as a substitute for human judgment or as a source of truth. Please use responsibly.
333
+
334
+ ## Citations
335
+
336
+ ```bibtex
337
+ @article{touvron2023llama,
338
+ title={LLaMA: Open and Efficient Foundation Language Models},
339
+ author={Touvron, Hugo and Lavril, Thibaut and Izacard, Gautier and Martinet, Xavier and Lachaux, Marie-Anne and Lacroix, Timoth{\'e}e and Rozi{\`e}re, Baptiste and Goyal, Naman and Hambro, Eric and Azhar, Faisal and Rodriguez, Aurelien and Joulin, Armand and Grave, Edouard and Lample, Guillaume},
340
+ journal={arXiv preprint arXiv:2302.13971},
341
+ year={2023}
342
+ }
343
+ @article{hu2021lora,
344
+ title={LoRA: Low-Rank Adaptation of Large Language Models},
345
+ author={Hu, Edward J. and Shen, Yelong and Wallis, Phillip and Allen-Zhu, Zeyuan and Li, Yuanzhi and Wang, Shean and Chen, Weizhu},
346
+ journal={CoRR},
347
+ year={2021}
348
+ }
349
+ ```