TheBloke commited on
Commit
aed516c
1 Parent(s): b255b6b

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +331 -0
README.md ADDED
@@ -0,0 +1,331 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/Mikael110/llama-2-70b-guanaco-qlora
3
+ inference: false
4
+ language:
5
+ - en
6
+ license: other
7
+ model_creator: Mikael110
8
+ model_name: Llama2 70B Guanaco QLoRA
9
+ model_type: llama
10
+ pipeline_tag: text-classification
11
+ prompt_template: '### Human: {prompt}
12
+
13
+ ### Assistant:
14
+
15
+ '
16
+ quantized_by: TheBloke
17
+ tags:
18
+ - llama-2
19
+ ---
20
+
21
+ <!-- header start -->
22
+ <!-- 200823 -->
23
+ <div style="width: auto; margin-left: auto; margin-right: auto">
24
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
25
+ </div>
26
+ <div style="display: flex; justify-content: space-between; width: 100%;">
27
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
28
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
29
+ </div>
30
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
31
+ <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>
32
+ </div>
33
+ </div>
34
+ <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>
35
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
36
+ <!-- header end -->
37
+
38
+ # Llama2 70B Guanaco QLoRA - AWQ
39
+ - Model creator: [Mikael110](https://huggingface.co/Mikael110)
40
+ - Original model: [Llama2 70B Guanaco QLoRA](https://huggingface.co/Mikael110/llama-2-70b-guanaco-qlora)
41
+
42
+ <!-- description start -->
43
+ ## Description
44
+
45
+ This repo contains AWQ model files for [Mikael110's Llama2 70b Guanaco QLoRA](https://huggingface.co/Mikael110/llama-2-70b-guanaco-qlora).
46
+
47
+
48
+ ### About AWQ
49
+
50
+ 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.
51
+
52
+ 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.
53
+ <!-- description end -->
54
+ <!-- repositories-available start -->
55
+ ## Repositories available
56
+
57
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/llama-2-70b-Guanaco-QLoRA-AWQ)
58
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/llama-2-70b-Guanaco-QLoRA-GPTQ)
59
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/llama-2-70b-Guanaco-QLoRA-GGUF)
60
+ * [Unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/TheBloke/llama-2-70b-Guanaco-QLoRA-fp16)
61
+ * [Mikael110's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Mikael110/llama-2-70b-guanaco-qlora)
62
+ <!-- repositories-available end -->
63
+
64
+ <!-- prompt-template start -->
65
+ ## Prompt template: Guanaco
66
+
67
+ ```
68
+ ### Human: {prompt}
69
+ ### Assistant:
70
+
71
+ ```
72
+
73
+ <!-- prompt-template end -->
74
+ <!-- licensing start -->
75
+ ## Licensing
76
+
77
+ The creator of the source model has listed its license as `other`, and this quantization has therefore used that same license.
78
+
79
+ 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.
80
+
81
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [Mikael110's Llama2 70b Guanaco QLoRA](https://huggingface.co/Mikael110/llama-2-70b-guanaco-qlora).
82
+ <!-- licensing end -->
83
+ <!-- README_AWQ.md-provided-files start -->
84
+ ## Provided files and AWQ parameters
85
+
86
+ 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.
87
+
88
+ Models are released as sharded safetensors files.
89
+
90
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
91
+ | ------ | ---- | -- | ----------- | ------- | ---- |
92
+ | [main](https://huggingface.co/TheBloke/llama-2-70b-Guanaco-QLoRA-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 36.61 GB
93
+
94
+ <!-- README_AWQ.md-provided-files end -->
95
+
96
+ <!-- README_AWQ.md-use-from-vllm start -->
97
+ ## Serving this model from vLLM
98
+
99
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
100
+
101
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
102
+
103
+ ```shell
104
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/llama-2-70b-Guanaco-QLoRA-AWQ --quantization awq
105
+ ```
106
+
107
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
108
+
109
+ ```python
110
+ from vllm import LLM, SamplingParams
111
+
112
+ prompts = [
113
+ "Hello, my name is",
114
+ "The president of the United States is",
115
+ "The capital of France is",
116
+ "The future of AI is",
117
+ ]
118
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
119
+
120
+ llm = LLM(model="TheBloke/llama-2-70b-Guanaco-QLoRA-AWQ", quantization="awq")
121
+
122
+ outputs = llm.generate(prompts, sampling_params)
123
+
124
+ # Print the outputs.
125
+ for output in outputs:
126
+ prompt = output.prompt
127
+ generated_text = output.outputs[0].text
128
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
129
+ ```
130
+ <!-- README_AWQ.md-use-from-vllm start -->
131
+
132
+ <!-- README_AWQ.md-use-from-python start -->
133
+ ## How to use this AWQ model from Python code
134
+
135
+ ### Install the necessary packages
136
+
137
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
138
+
139
+ ```shell
140
+ pip3 install autoawq
141
+ ```
142
+
143
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
144
+
145
+ ```shell
146
+ pip3 uninstall -y autoawq
147
+ git clone https://github.com/casper-hansen/AutoAWQ
148
+ cd AutoAWQ
149
+ pip3 install .
150
+ ```
151
+
152
+ ### You can then try the following example code
153
+
154
+ ```python
155
+ from awq import AutoAWQForCausalLM
156
+ from transformers import AutoTokenizer
157
+
158
+ model_name_or_path = "TheBloke/llama-2-70b-Guanaco-QLoRA-AWQ"
159
+
160
+ # Load model
161
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
162
+ trust_remote_code=False, safetensors=True)
163
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
164
+
165
+ prompt = "Tell me about AI"
166
+ prompt_template=f'''### Human: {prompt}
167
+ ### Assistant:
168
+
169
+ '''
170
+
171
+ print("\n\n*** Generate:")
172
+
173
+ tokens = tokenizer(
174
+ prompt_template,
175
+ return_tensors='pt'
176
+ ).input_ids.cuda()
177
+
178
+ # Generate output
179
+ generation_output = model.generate(
180
+ tokens,
181
+ do_sample=True,
182
+ temperature=0.7,
183
+ top_p=0.95,
184
+ top_k=40,
185
+ max_new_tokens=512
186
+ )
187
+
188
+ print("Output: ", tokenizer.decode(generation_output[0]))
189
+
190
+ # Inference can also be done using transformers' pipeline
191
+ from transformers import pipeline
192
+
193
+ print("*** Pipeline:")
194
+ pipe = pipeline(
195
+ "text-generation",
196
+ model=model,
197
+ tokenizer=tokenizer,
198
+ max_new_tokens=512,
199
+ do_sample=True,
200
+ temperature=0.7,
201
+ top_p=0.95,
202
+ top_k=40,
203
+ repetition_penalty=1.1
204
+ )
205
+
206
+ print(pipe(prompt_template)[0]['generated_text'])
207
+ ```
208
+ <!-- README_AWQ.md-use-from-python end -->
209
+
210
+ <!-- README_AWQ.md-compatibility start -->
211
+ ## Compatibility
212
+
213
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
214
+
215
+ [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).
216
+ <!-- README_AWQ.md-compatibility end -->
217
+
218
+ <!-- footer start -->
219
+ <!-- 200823 -->
220
+ ## Discord
221
+
222
+ For further support, and discussions on these models and AI in general, join us at:
223
+
224
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
225
+
226
+ ## Thanks, and how to contribute
227
+
228
+ Thanks to the [chirper.ai](https://chirper.ai) team!
229
+
230
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
231
+
232
+ 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.
233
+
234
+ 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.
235
+
236
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
237
+
238
+ * Patreon: https://patreon.com/TheBlokeAI
239
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
240
+
241
+ **Special thanks to**: Aemon Algiz.
242
+
243
+ **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
244
+
245
+
246
+ Thank you to all my generous patrons and donaters!
247
+
248
+ And thank you again to a16z for their generous grant.
249
+
250
+ <!-- footer end -->
251
+
252
+ # Original model card: Mikael110's Llama2 70b Guanaco QLoRA
253
+
254
+
255
+ <!-- header start -->
256
+ <div style="width: 100%;">
257
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
258
+ </div>
259
+ <div style="display: flex; justify-content: space-between; width: 100%;">
260
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
261
+ <p><a href="https://discord.gg/theblokeai">Chat & support: my new Discord server</a></p>
262
+ </div>
263
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
264
+ <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
265
+ </div>
266
+ </div>
267
+ <!-- header end -->
268
+
269
+ # Llama2 70b Guanaco QLoRA - fp16
270
+ - Model creator: [Mikael110](https://huggingface.co/Mikael110)
271
+ - Original model: [Llama2 70b Guanaco QLoRA](https://huggingface.co/Mikael110/llama-2-70b-guanaco-qlora)
272
+
273
+ # Mikael110's Llama2 70b Guanaco QLoRA fp16
274
+
275
+ These files are pytorch format fp16 model files for [Mikael110's Llama2 70b Guanaco QLoRA](https://huggingface.co/Mikael110/llama-2-70b-guanaco-qlora).
276
+
277
+ It is the result of merging and/or converting the source repository to float16.
278
+
279
+ ## Repositories available
280
+
281
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/llama-2-70b-Guanaco-QLoRA-GPTQ)
282
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/llama-2-70b-Guanaco-QLoRA-GGML)
283
+ * [Merged fp16 model, for GPU inference and further conversions](https://huggingface.co/TheBloke/llama-2-70b-Guanaco-QLoRA-fp16)
284
+ * [Mikael110's original QLoRA adapter](https://huggingface.co/Mikael110/llama-2-70b-guanaco-qlora)
285
+
286
+ ## Prompt template: Guanaco
287
+
288
+ ```
289
+ ### Human: {prompt}
290
+ ### Assistant:
291
+ ```
292
+
293
+ <!-- footer start -->
294
+ ## Discord
295
+
296
+ For further support, and discussions on these models and AI in general, join us at:
297
+
298
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
299
+
300
+ ## Thanks, and how to contribute.
301
+
302
+ Thanks to the [chirper.ai](https://chirper.ai) team!
303
+
304
+ 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.
305
+
306
+ 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.
307
+
308
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
309
+
310
+ * Patreon: https://patreon.com/TheBlokeAI
311
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
312
+
313
+ **Special thanks to**: Luke from CarbonQuill, Aemon Algiz.
314
+
315
+ **Patreon special mentions**: Slarti, Chadd, John Detwiler, Pieter, zynix, K, Mano Prime, ReadyPlayerEmma, Ai Maven, Leonard Tan, Edmond Seymore, Joseph William Delisle, Luke @flexchar, Fred von Graf, Viktor Bowallius, Rishabh Srivastava, Nikolai Manek, Matthew Berman, Johann-Peter Hartmann, ya boyyy, Greatston Gnanesh, Femi Adebogun, Talal Aujan, Jonathan Leane, terasurfer, David Flickinger, William Sang, Ajan Kanaga, Vadim, Artur Olbinski, Raven Klaugh, Michael Levine, Oscar Rangel, Randy H, Cory Kujawski, RoA, Dave, Alex, Alexandros Triantafyllidis, Fen Risland, Eugene Pentland, vamX, Elle, Nathan LeClaire, Khalefa Al-Ahmad, Rainer Wilmers, subjectnull, Junyu Yang, Daniel P. Andersen, SuperWojo, LangChain4j, Mandus, Kalila, Illia Dulskyi, Trenton Dambrowitz, Asp the Wyvern, Derek Yates, Jeffrey Morgan, Deep Realms, Imad Khwaja, Pyrater, Preetika Verma, biorpg, Gabriel Tamborski, Stephen Murray, Spiking Neurons AB, Iucharbius, Chris Smitley, Willem Michiel, Luke Pendergrass, Sebastain Graf, senxiiz, Will Dee, Space Cruiser, Karl Bernard, Clay Pascal, Lone Striker, transmissions 11, webtim, WelcomeToTheClub, Sam, theTransient, Pierre Kircher, chris gileta, John Villwock, Sean Connelly, Willian Hasse
316
+
317
+
318
+ Thank you to all my generous patrons and donaters!
319
+
320
+ <!-- footer end -->
321
+
322
+ # Original model card: Mikael110's Llama2 70b Guanaco QLoRA
323
+
324
+ This is a Llama-2 version of [Guanaco](https://huggingface.co/timdettmers/guanaco-65b). It was finetuned from the base [Llama-70b](https://huggingface.co/meta-llama/Llama-2-70b-hf) model using the official training scripts found in the [QLoRA repo](https://github.com/artidoro/qlora). I wanted it to be as faithful as possible and therefore changed nothing in the training script beyond the model it was pointing to. The model prompt is therefore also the same as the original Guanaco model.
325
+
326
+ This repo contains the QLoRA adapter.
327
+
328
+ A 7b version of the adapter can be found [here](https://huggingface.co/Mikael110/llama-2-7b-guanaco-qlora).
329
+ A 13b version of the adapter can be found [here](https://huggingface.co/Mikael110/llama-2-13b-guanaco-qlora).
330
+
331
+ **Legal Disclaimer: This model is bound by the usage restrictions of the original Llama-2 model. And comes with no warranty or gurantees of any kind.**