TheBloke commited on
Commit
fd7dbaa
1 Parent(s): a0225c2

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +296 -0
README.md ADDED
@@ -0,0 +1,296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/posicube/Llama2-chat-AYT-13B
3
+ inference: false
4
+ license: llama2
5
+ model_creator: posicube
6
+ model_name: Llama2 Chat AYT 13B
7
+ model_type: llama
8
+ prompt_template: '{prompt}
9
+
10
+ '
11
+ quantized_by: TheBloke
12
+ ---
13
+
14
+ <!-- header start -->
15
+ <!-- 200823 -->
16
+ <div style="width: auto; margin-left: auto; margin-right: auto">
17
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
18
+ </div>
19
+ <div style="display: flex; justify-content: space-between; width: 100%;">
20
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
21
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
22
+ </div>
23
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
24
+ <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>
25
+ </div>
26
+ </div>
27
+ <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>
28
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
29
+ <!-- header end -->
30
+
31
+ # Llama2 Chat AYT 13B - AWQ
32
+ - Model creator: [posicube](https://huggingface.co/posicube)
33
+ - Original model: [Llama2 Chat AYT 13B](https://huggingface.co/posicube/Llama2-chat-AYT-13B)
34
+
35
+ <!-- description start -->
36
+ ## Description
37
+
38
+ This repo contains AWQ model files for [posicube's Llama2 Chat AYT 13B](https://huggingface.co/posicube/Llama2-chat-AYT-13B).
39
+
40
+
41
+ ### About AWQ
42
+
43
+ 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.
44
+
45
+ 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.
46
+ <!-- description end -->
47
+ <!-- repositories-available start -->
48
+ ## Repositories available
49
+
50
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Llama2-Chat-AYT-13B-AWQ)
51
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Llama2-Chat-AYT-13B-GPTQ)
52
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Llama2-Chat-AYT-13B-GGUF)
53
+ * [posicube's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/posicube/Llama2-chat-AYT-13B)
54
+ <!-- repositories-available end -->
55
+
56
+ <!-- prompt-template start -->
57
+ ## Prompt template: Unknown
58
+
59
+ ```
60
+ {prompt}
61
+
62
+ ```
63
+
64
+ <!-- prompt-template end -->
65
+
66
+
67
+ <!-- README_AWQ.md-provided-files start -->
68
+ ## Provided files and AWQ parameters
69
+
70
+ 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.
71
+
72
+ Models are released as sharded safetensors files.
73
+
74
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
75
+ | ------ | ---- | -- | ----------- | ------- | ---- |
76
+ | [main](https://huggingface.co/TheBloke/Llama2-Chat-AYT-13B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 GB
77
+
78
+ <!-- README_AWQ.md-provided-files end -->
79
+
80
+ <!-- README_AWQ.md-use-from-vllm start -->
81
+ ## Serving this model from vLLM
82
+
83
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
84
+
85
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
86
+
87
+ ```shell
88
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/Llama2-Chat-AYT-13B-AWQ --quantization awq
89
+ ```
90
+
91
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
92
+
93
+ ```python
94
+ from vllm import LLM, SamplingParams
95
+
96
+ prompts = [
97
+ "Hello, my name is",
98
+ "The president of the United States is",
99
+ "The capital of France is",
100
+ "The future of AI is",
101
+ ]
102
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
103
+
104
+ llm = LLM(model="TheBloke/Llama2-Chat-AYT-13B-AWQ", quantization="awq")
105
+
106
+ outputs = llm.generate(prompts, sampling_params)
107
+
108
+ # Print the outputs.
109
+ for output in outputs:
110
+ prompt = output.prompt
111
+ generated_text = output.outputs[0].text
112
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
113
+ ```
114
+ <!-- README_AWQ.md-use-from-vllm start -->
115
+
116
+ <!-- README_AWQ.md-use-from-python start -->
117
+ ## How to use this AWQ model from Python code
118
+
119
+ ### Install the necessary packages
120
+
121
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
122
+
123
+ ```shell
124
+ pip3 install autoawq
125
+ ```
126
+
127
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
128
+
129
+ ```shell
130
+ pip3 uninstall -y autoawq
131
+ git clone https://github.com/casper-hansen/AutoAWQ
132
+ cd AutoAWQ
133
+ pip3 install .
134
+ ```
135
+
136
+ ### You can then try the following example code
137
+
138
+ ```python
139
+ from awq import AutoAWQForCausalLM
140
+ from transformers import AutoTokenizer
141
+
142
+ model_name_or_path = "TheBloke/Llama2-Chat-AYT-13B-AWQ"
143
+
144
+ # Load model
145
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
146
+ trust_remote_code=False, safetensors=True)
147
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
148
+
149
+ prompt = "Tell me about AI"
150
+ prompt_template=f'''{prompt}
151
+
152
+ '''
153
+
154
+ print("\n\n*** Generate:")
155
+
156
+ tokens = tokenizer(
157
+ prompt_template,
158
+ return_tensors='pt'
159
+ ).input_ids.cuda()
160
+
161
+ # Generate output
162
+ generation_output = model.generate(
163
+ tokens,
164
+ do_sample=True,
165
+ temperature=0.7,
166
+ top_p=0.95,
167
+ top_k=40,
168
+ max_new_tokens=512
169
+ )
170
+
171
+ print("Output: ", tokenizer.decode(generation_output[0]))
172
+
173
+ # Inference can also be done using transformers' pipeline
174
+ from transformers import pipeline
175
+
176
+ print("*** Pipeline:")
177
+ pipe = pipeline(
178
+ "text-generation",
179
+ model=model,
180
+ tokenizer=tokenizer,
181
+ max_new_tokens=512,
182
+ do_sample=True,
183
+ temperature=0.7,
184
+ top_p=0.95,
185
+ top_k=40,
186
+ repetition_penalty=1.1
187
+ )
188
+
189
+ print(pipe(prompt_template)[0]['generated_text'])
190
+ ```
191
+ <!-- README_AWQ.md-use-from-python end -->
192
+
193
+ <!-- README_AWQ.md-compatibility start -->
194
+ ## Compatibility
195
+
196
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
197
+
198
+ [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).
199
+ <!-- README_AWQ.md-compatibility end -->
200
+
201
+ <!-- footer start -->
202
+ <!-- 200823 -->
203
+ ## Discord
204
+
205
+ For further support, and discussions on these models and AI in general, join us at:
206
+
207
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
208
+
209
+ ## Thanks, and how to contribute
210
+
211
+ Thanks to the [chirper.ai](https://chirper.ai) team!
212
+
213
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
214
+
215
+ 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.
216
+
217
+ 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.
218
+
219
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
220
+
221
+ * Patreon: https://patreon.com/TheBlokeAI
222
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
223
+
224
+ **Special thanks to**: Aemon Algiz.
225
+
226
+ **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
227
+
228
+
229
+ Thank you to all my generous patrons and donaters!
230
+
231
+ And thank you again to a16z for their generous grant.
232
+
233
+ <!-- footer end -->
234
+
235
+ # Original model card: posicube's Llama2 Chat AYT 13B
236
+
237
+
238
+ This is a model diverged from Llama-2-13b-chat-hf. We hypotheize that if we find a method to ensemble the top rankers in each benchmark effectively, its performance maximizes as well. Following this intuition, we ensembled the top models in each benchmarks(ARC, MMLU and TruthFulQA) to create our model.
239
+
240
+ # Model Details
241
+ - **Developed by**: Posicube Inc.
242
+ - **Backbone Model**: LLaMA-2-13b-chat
243
+ - **Library**: HuggingFace Transformers
244
+ - **Used Dataset Details**
245
+ Orca-style datasets, Alpaca-style datasets
246
+
247
+
248
+ # Evaluation
249
+ We achieved the top ranker among 13B models at Sep-13rd 2023.
250
+
251
+ | Metric |Scores on Leaderboard| Our results |
252
+ |---------------------|---------------------|-------------|
253
+ | ARC (25-shot) | 63.31 | 63.57 |
254
+ | HellaSwag (10-shot) | 83.53 | 83.77 |
255
+ | MMLU (5-shot) | 59.67 | 59.69 |
256
+ | TruthfulQA (0-shot) | 55.8 | 55.48 |
257
+ | Avg. | 65.58 | 65.63 |
258
+
259
+ # Limitations & Biases:
260
+ 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.
261
+
262
+ Please see the Responsible Use Guide available at https://ai.meta.com/llama/responsible-use-guide/
263
+
264
+ # License Disclaimer:
265
+ 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.
266
+
267
+ # Contact Us
268
+ [Posicube](https://www.posicube.com/)
269
+
270
+ # Citiation:
271
+ Please kindly cite using the following BibTeX:
272
+
273
+ ```bibtex
274
+ @misc{mukherjee2023orca,
275
+ title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
276
+ author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
277
+ year={2023},
278
+ eprint={2306.02707},
279
+ archivePrefix={arXiv},
280
+ primaryClass={cs.CL}
281
+ }
282
+ ```
283
+
284
+ ```bibtex
285
+ @software{touvron2023llama2,
286
+ title={Llama 2: Open Foundation and Fine-Tuned Chat Models},
287
+ author={Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava,
288
+ Shruti Bhosale, Dan Bikel, Lukas Blecher, Cristian Canton Ferrer, Moya Chen, Guillem Cucurull, David Esiobu, Jude Fernandes, Jeremy Fu, Wenyin Fu, Brian Fuller,
289
+ Cynthia Gao, Vedanuj Goswami, Naman Goyal, Anthony Hartshorn, Saghar Hosseini, Rui Hou, Hakan Inan, Marcin Kardas, Viktor Kerkez Madian Khabsa, Isabel Kloumann,
290
+ Artem Korenev, Punit Singh Koura, Marie-Anne Lachaux, Thibaut Lavril, Jenya Lee, Diana Liskovich, Yinghai Lu, Yuning Mao, Xavier Martinet, Todor Mihaylov,
291
+ Pushkar Mishra, Igor Molybog, Yixin Nie, Andrew Poulton, Jeremy Reizenstein, Rashi Rungta, Kalyan Saladi, Alan Schelten, Ruan Silva, Eric Michael Smith,
292
+ Ranjan Subramanian, Xiaoqing Ellen Tan, Binh Tang, Ross Taylor, Adina Williams, Jian Xiang Kuan, Puxin Xu , Zheng Yan, Iliyan Zarov, Yuchen Zhang, Angela Fan,
293
+ Melanie Kambadur, Sharan Narang, Aurelien Rodriguez, Robert Stojnic, Sergey Edunov, Thomas Scialom},
294
+ year={2023}
295
+ }
296
+ ```