TheBloke commited on
Commit
a50100a
1 Parent(s): 071fc33

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +370 -0
README.md ADDED
@@ -0,0 +1,370 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/Riiid/sheep-duck-llama-2
3
+ inference: false
4
+ language:
5
+ - en
6
+ library_name: transformers
7
+ license: llama2
8
+ model_creator: Riiid
9
+ model_name: Sheep Duck Llama 2
10
+ model_type: llama
11
+ pipeline_tag: text-generation
12
+ prompt_template: '### System:
13
+
14
+ {system_message}
15
+
16
+
17
+ ### User:
18
+
19
+ {prompt}
20
+
21
+
22
+ ### Assistant:
23
+
24
+ '
25
+ quantized_by: TheBloke
26
+ tags:
27
+ - Riiid
28
+ - llama-2
29
+ thumbnail: https://cdn-uploads.huggingface.co/production/uploads/62fb1ef7e8c9c532aa7d19e4/NswB5XPkkOljeRh1xbMmR.png
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
+ # Sheep Duck Llama 2 - AWQ
50
+ - Model creator: [Riiid](https://huggingface.co/Riiid)
51
+ - Original model: [Sheep Duck Llama 2](https://huggingface.co/Riiid/sheep-duck-llama-2)
52
+
53
+ <!-- description start -->
54
+ ## Description
55
+
56
+ This repo contains AWQ model files for [Riiid's Sheep Duck Llama 2](https://huggingface.co/Riiid/sheep-duck-llama-2).
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/Sheep-Duck-Llama-2-70B-AWQ)
69
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Sheep-Duck-Llama-2-70B-GPTQ)
70
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Sheep-Duck-Llama-2-70B-GGUF)
71
+ * [Riiid's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Riiid/sheep-duck-llama-2)
72
+ <!-- repositories-available end -->
73
+
74
+ <!-- prompt-template start -->
75
+ ## Prompt template: Orca-Hashes
76
+
77
+ ```
78
+ ### System:
79
+ {system_message}
80
+
81
+ ### User:
82
+ {prompt}
83
+
84
+ ### Assistant:
85
+
86
+ ```
87
+
88
+ <!-- prompt-template end -->
89
+
90
+
91
+ <!-- README_AWQ.md-provided-files start -->
92
+ ## Provided files and AWQ parameters
93
+
94
+ 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.
95
+
96
+ Models are released as sharded safetensors files.
97
+
98
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
99
+ | ------ | ---- | -- | ----------- | ------- | ---- |
100
+ | [main](https://huggingface.co/TheBloke/Sheep-Duck-Llama-2-70B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 36.61 GB
101
+
102
+ <!-- README_AWQ.md-provided-files end -->
103
+
104
+ <!-- README_AWQ.md-use-from-vllm start -->
105
+ ## Serving this model from vLLM
106
+
107
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
108
+
109
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
110
+
111
+ ```shell
112
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/Sheep-Duck-Llama-2-70B-AWQ --quantization awq
113
+ ```
114
+
115
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
116
+
117
+ ```python
118
+ from vllm import LLM, SamplingParams
119
+
120
+ prompts = [
121
+ "Hello, my name is",
122
+ "The president of the United States is",
123
+ "The capital of France is",
124
+ "The future of AI is",
125
+ ]
126
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
127
+
128
+ llm = LLM(model="TheBloke/Sheep-Duck-Llama-2-70B-AWQ", quantization="awq")
129
+
130
+ outputs = llm.generate(prompts, sampling_params)
131
+
132
+ # Print the outputs.
133
+ for output in outputs:
134
+ prompt = output.prompt
135
+ generated_text = output.outputs[0].text
136
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
137
+ ```
138
+ <!-- README_AWQ.md-use-from-vllm start -->
139
+
140
+ <!-- README_AWQ.md-use-from-python start -->
141
+ ## How to use this AWQ model from Python code
142
+
143
+ ### Install the necessary packages
144
+
145
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
146
+
147
+ ```shell
148
+ pip3 install autoawq
149
+ ```
150
+
151
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
152
+
153
+ ```shell
154
+ pip3 uninstall -y autoawq
155
+ git clone https://github.com/casper-hansen/AutoAWQ
156
+ cd AutoAWQ
157
+ pip3 install .
158
+ ```
159
+
160
+ ### You can then try the following example code
161
+
162
+ ```python
163
+ from awq import AutoAWQForCausalLM
164
+ from transformers import AutoTokenizer
165
+
166
+ model_name_or_path = "TheBloke/Sheep-Duck-Llama-2-70B-AWQ"
167
+
168
+ # Load model
169
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
170
+ trust_remote_code=False, safetensors=True)
171
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
172
+
173
+ prompt = "Tell me about AI"
174
+ prompt_template=f'''### System:
175
+ {system_message}
176
+
177
+ ### User:
178
+ {prompt}
179
+
180
+ ### Assistant:
181
+
182
+ '''
183
+
184
+ print("\n\n*** Generate:")
185
+
186
+ tokens = tokenizer(
187
+ prompt_template,
188
+ return_tensors='pt'
189
+ ).input_ids.cuda()
190
+
191
+ # Generate output
192
+ generation_output = model.generate(
193
+ tokens,
194
+ do_sample=True,
195
+ temperature=0.7,
196
+ top_p=0.95,
197
+ top_k=40,
198
+ max_new_tokens=512
199
+ )
200
+
201
+ print("Output: ", tokenizer.decode(generation_output[0]))
202
+
203
+ # Inference can also be done using transformers' pipeline
204
+ from transformers import pipeline
205
+
206
+ print("*** Pipeline:")
207
+ pipe = pipeline(
208
+ "text-generation",
209
+ model=model,
210
+ tokenizer=tokenizer,
211
+ max_new_tokens=512,
212
+ do_sample=True,
213
+ temperature=0.7,
214
+ top_p=0.95,
215
+ top_k=40,
216
+ repetition_penalty=1.1
217
+ )
218
+
219
+ print(pipe(prompt_template)[0]['generated_text'])
220
+ ```
221
+ <!-- README_AWQ.md-use-from-python end -->
222
+
223
+ <!-- README_AWQ.md-compatibility start -->
224
+ ## Compatibility
225
+
226
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
227
+
228
+ [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).
229
+ <!-- README_AWQ.md-compatibility end -->
230
+
231
+ <!-- footer start -->
232
+ <!-- 200823 -->
233
+ ## Discord
234
+
235
+ For further support, and discussions on these models and AI in general, join us at:
236
+
237
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
238
+
239
+ ## Thanks, and how to contribute
240
+
241
+ Thanks to the [chirper.ai](https://chirper.ai) team!
242
+
243
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
244
+
245
+ 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.
246
+
247
+ 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.
248
+
249
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
250
+
251
+ * Patreon: https://patreon.com/TheBlokeAI
252
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
253
+
254
+ **Special thanks to**: Aemon Algiz.
255
+
256
+ **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
257
+
258
+
259
+ Thank you to all my generous patrons and donaters!
260
+
261
+ And thank you again to a16z for their generous grant.
262
+
263
+ <!-- footer end -->
264
+
265
+ # Original model card: Riiid's Sheep Duck Llama 2
266
+
267
+
268
+ # sheep-duck-llama-2
269
+
270
+ <img src = "https://cdn-uploads.huggingface.co/production/uploads/62fb1ef7e8c9c532aa7d19e4/NswB5XPkkOljeRh1xbMmR.png" width="30%" height="30%">
271
+
272
+ This is a finetuned model from llama-2-70b.
273
+
274
+ ## Model Details
275
+
276
+ * **Developed by**: [Riiid](https://riiid.com/)
277
+ * **Backbone Model**: [LLaMA-2](https://github.com/facebookresearch/llama/tree/main)
278
+ * **Library**: [HuggingFace Transformers](https://github.com/huggingface/transformers)
279
+
280
+
281
+ ## Dataset Details
282
+
283
+ ### Used Datasets
284
+ - Orca-style dataset
285
+ - Alpaca-style dataset
286
+
287
+ ### Prompt Template
288
+ ```
289
+ ### System:
290
+ {System}
291
+
292
+ ### User:
293
+ {User}
294
+
295
+ ### Assistant:
296
+ {Assistant}
297
+ ```
298
+
299
+ ## Evaluation
300
+
301
+ | Metric | Value |
302
+ |-----------------------|-------|
303
+ | ARC (25-shot) | 72.44 |
304
+ | HellaSwag (10-shot) | 87.79 |
305
+ | MMLU (5-shot) | 70.74 |
306
+ | TruthfulQA (0-shot) | 63.71 |
307
+ | Avg. | 73.67 |
308
+
309
+
310
+ ## Limitations & Biases:
311
+
312
+ Llama2 and fine-tuned variants are a new technology that carries risks with use. Testing conducted to date has been in English, and has not covered, nor could it cover all scenarios. For these reasons, as with all LLMs, Llama 2 and any fine-tuned varient's potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses to user prompts. Therefore, before deploying any applications of Llama 2 variants, developers should perform safety testing and tuning tailored to their specific applications of the model.
313
+
314
+ Please see the Responsible Use Guide available at https://ai.meta.com/llama/responsible-use-guide/
315
+
316
+ ## License Disclaimer:
317
+ This model is bound by the license & usage restrictions of the original Llama-2 model. And comes with no warranty or gurantees of any kind.
318
+
319
+ ## Contact Us
320
+
321
+ - [Riiid](https://riiid.com/)
322
+
323
+ ## Citiation:
324
+
325
+ Please kindly cite using the following BibTeX:
326
+
327
+ ```bibtex
328
+ @article{platypus2023,
329
+ title={Platypus: Quick, Cheap, and Powerful Refinement of LLMs},
330
+ author={Ariel N. Lee and Cole J. Hunter and Nataniel Ruiz},
331
+ booktitle={arXiv preprint arxiv:2308.07317},
332
+ year={2023}
333
+ }
334
+ ```
335
+
336
+ ```
337
+ @misc{mukherjee2023orca,
338
+ title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
339
+ author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
340
+ year={2023},
341
+ eprint={2306.02707},
342
+ archivePrefix={arXiv},
343
+ primaryClass={cs.CL}
344
+ }
345
+ ```
346
+
347
+ ```
348
+ @misc{Orca-best,
349
+ title = {Orca-best: A filtered version of orca gpt4 dataset.},
350
+ author = {Shahul Es},
351
+ year = {2023},
352
+ publisher = {HuggingFace},
353
+ journal = {HuggingFace repository},
354
+ howpublished = {\url{https://huggingface.co/datasets/shahules786/orca-best/},
355
+ }
356
+ ```
357
+
358
+ ```
359
+ @software{touvron2023llama2,
360
+ title={Llama 2: Open Foundation and Fine-Tuned Chat Models},
361
+ author={Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava,
362
+ Shruti Bhosale, Dan Bikel, Lukas Blecher, Cristian Canton Ferrer, Moya Chen, Guillem Cucurull, David Esiobu, Jude Fernandes, Jeremy Fu, Wenyin Fu, Brian Fuller,
363
+ Cynthia Gao, Vedanuj Goswami, Naman Goyal, Anthony Hartshorn, Saghar Hosseini, Rui Hou, Hakan Inan, Marcin Kardas, Viktor Kerkez Madian Khabsa, Isabel Kloumann,
364
+ Artem Korenev, Punit Singh Koura, Marie-Anne Lachaux, Thibaut Lavril, Jenya Lee, Diana Liskovich, Yinghai Lu, Yuning Mao, Xavier Martinet, Todor Mihaylov,
365
+ Pushkar Mishra, Igor Molybog, Yixin Nie, Andrew Poulton, Jeremy Reizenstein, Rashi Rungta, Kalyan Saladi, Alan Schelten, Ruan Silva, Eric Michael Smith,
366
+ Ranjan Subramanian, Xiaoqing Ellen Tan, Binh Tang, Ross Taylor, Adina Williams, Jian Xiang Kuan, Puxin Xu , Zheng Yan, Iliyan Zarov, Yuchen Zhang, Angela Fan,
367
+ Melanie Kambadur, Sharan Narang, Aurelien Rodriguez, Robert Stojnic, Sergey Edunov, Thomas Scialom},
368
+ year={2023}
369
+ }
370
+ ```