TheBloke commited on
Commit
1058023
1 Parent(s): eddd089

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +270 -0
README.md ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: AIDC-ai-business/Marcoroni-70B-v1
3
+ inference: false
4
+ license: cc-by-nc-4.0
5
+ model_creator: AIDC-ai-business
6
+ model_name: Marcoroni 70B v1
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
+ # Marcoroni 70B v1 - AWQ
32
+ - Model creator: [AIDC-ai-business](https://huggingface.co/AIDC-ai-business)
33
+ - Original model: [Marcoroni 70B v1](https://huggingface.co/AIDC-ai-business/Marcoroni-70B-v1)
34
+
35
+ <!-- description start -->
36
+ ## Description
37
+
38
+ This repo contains AWQ model files for [AIDC-ai-business's Marcoroni 70B v1](https://huggingface.co/AIDC-ai-business/Marcoroni-70B-v1).
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 Llama AWQ models for high-throughput concurrent inference in multi-user server scenarios.
46
+
47
+ As of September 25th 2023, preliminary Llama-only AWQ support has also been added to [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference).
48
+
49
+ Note that, at the time of writing, overall throughput is still lower than running vLLM or TGI 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.
50
+ <!-- description end -->
51
+ <!-- repositories-available start -->
52
+ ## Repositories available
53
+
54
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Marcoroni-70B-v1-AWQ)
55
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Marcoroni-70B-v1-GPTQ)
56
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Marcoroni-70B-v1-GGUF)
57
+ * [AIDC-ai-business's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/AIDC-ai-business/Marcoroni-70B-v1)
58
+ <!-- repositories-available end -->
59
+
60
+ <!-- prompt-template start -->
61
+ ## Prompt template: Unknown
62
+
63
+ ```
64
+ {prompt}
65
+
66
+ ```
67
+
68
+ <!-- prompt-template end -->
69
+ <!-- licensing start -->
70
+ ## Licensing
71
+
72
+ The creator of the source model has listed its license as `cc-by-nc-4.0`, and this quantization has therefore used that same license.
73
+
74
+ 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.
75
+
76
+ In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [AIDC-ai-business's Marcoroni 70B v1](https://huggingface.co/AIDC-ai-business/Marcoroni-70B-v1).
77
+ <!-- licensing end -->
78
+ <!-- README_AWQ.md-provided-files start -->
79
+ ## Provided files, and AWQ parameters
80
+
81
+ 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.
82
+
83
+ Models are released as sharded safetensors files.
84
+
85
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
86
+ | ------ | ---- | -- | ----------- | ------- | ---- |
87
+ | [main](https://huggingface.co/TheBloke/Marcoroni-70B-v1-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 36.61 GB
88
+
89
+ <!-- README_AWQ.md-provided-files end -->
90
+
91
+ <!-- README_AWQ.md-use-from-vllm start -->
92
+ ## Serving this model from vLLM
93
+
94
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
95
+
96
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
97
+
98
+ ```shell
99
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/Marcoroni-70B-v1-AWQ --quantization awq --dtype half
100
+ ```
101
+
102
+ Note: at the time of writing, vLLM has not yet done a new release with support for the `quantization` parameter.
103
+
104
+ If you try the code below and get an error about `quantization` being unrecognised, please install vLLM from Github source.
105
+
106
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
107
+
108
+ ```python
109
+ from vllm import LLM, SamplingParams
110
+
111
+ prompts = [
112
+ "Hello, my name is",
113
+ "The president of the United States is",
114
+ "The capital of France is",
115
+ "The future of AI is",
116
+ ]
117
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
118
+
119
+ llm = LLM(model="TheBloke/Marcoroni-70B-v1-AWQ", quantization="awq", dtype="half")
120
+
121
+ outputs = llm.generate(prompts, sampling_params)
122
+
123
+ # Print the outputs.
124
+ for output in outputs:
125
+ prompt = output.prompt
126
+ generated_text = output.outputs[0].text
127
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
128
+ ```
129
+ <!-- README_AWQ.md-use-from-vllm start -->
130
+
131
+ <!-- README_AWQ.md-use-from-python start -->
132
+ ## Serving this model from TGI
133
+
134
+ TGI merged support for AWQ on September 25th, 2023. At the time of writing you need to use the `:latest` Docker container: `ghcr.io/huggingface/text-generation-inference:latest`
135
+
136
+ Add the parameter `--quantize awq` for AWQ support.
137
+
138
+ Example parameters:
139
+ ```shell
140
+ --model-id TheBloke/Marcoroni-70B-v1-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
141
+ ```
142
+
143
+ ## How to use this AWQ model from Python code
144
+
145
+ ### Install the necessary packages
146
+
147
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
148
+
149
+ ```shell
150
+ pip3 install autoawq
151
+ ```
152
+
153
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
154
+
155
+ ```shell
156
+ pip3 uninstall -y autoawq
157
+ git clone https://github.com/casper-hansen/AutoAWQ
158
+ cd AutoAWQ
159
+ pip3 install .
160
+ ```
161
+
162
+ ### You can then try the following example code
163
+
164
+ ```python
165
+ from awq import AutoAWQForCausalLM
166
+ from transformers import AutoTokenizer
167
+
168
+ model_name_or_path = "TheBloke/Marcoroni-70B-v1-AWQ"
169
+
170
+ # Load model
171
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
172
+ trust_remote_code=False, safetensors=True)
173
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
174
+
175
+ prompt = "Tell me about AI"
176
+ prompt_template=f'''{prompt}
177
+
178
+ '''
179
+
180
+ print("\n\n*** Generate:")
181
+
182
+ tokens = tokenizer(
183
+ prompt_template,
184
+ return_tensors='pt'
185
+ ).input_ids.cuda()
186
+
187
+ # Generate output
188
+ generation_output = model.generate(
189
+ tokens,
190
+ do_sample=True,
191
+ temperature=0.7,
192
+ top_p=0.95,
193
+ top_k=40,
194
+ max_new_tokens=512
195
+ )
196
+
197
+ print("Output: ", tokenizer.decode(generation_output[0]))
198
+
199
+ """
200
+ # Inference should be possible with transformers pipeline as well in future
201
+ # But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
202
+ from transformers import pipeline
203
+
204
+ print("*** Pipeline:")
205
+ pipe = pipeline(
206
+ "text-generation",
207
+ model=model,
208
+ tokenizer=tokenizer,
209
+ max_new_tokens=512,
210
+ do_sample=True,
211
+ temperature=0.7,
212
+ top_p=0.95,
213
+ top_k=40,
214
+ repetition_penalty=1.1
215
+ )
216
+
217
+ print(pipe(prompt_template)[0]['generated_text'])
218
+ """
219
+ ```
220
+ <!-- README_AWQ.md-use-from-python end -->
221
+
222
+ <!-- README_AWQ.md-compatibility start -->
223
+ ## Compatibility
224
+
225
+ The files provided are tested to work with:
226
+
227
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ)
228
+ - [vLLM](https://github.com/vllm-project/vllm)
229
+ - [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
230
+
231
+ TGI merged AWQ support on September 25th, 2023: [TGI PR #1054](https://github.com/huggingface/text-generation-inference/pull/1054). Use the `:latest` Docker container until the next TGI release is made.
232
+
233
+ <!-- README_AWQ.md-compatibility end -->
234
+
235
+ <!-- footer start -->
236
+ <!-- 200823 -->
237
+ ## Discord
238
+
239
+ For further support, and discussions on these models and AI in general, join us at:
240
+
241
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
242
+
243
+ ## Thanks, and how to contribute
244
+
245
+ Thanks to the [chirper.ai](https://chirper.ai) team!
246
+
247
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
248
+
249
+ 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.
250
+
251
+ 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.
252
+
253
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
254
+
255
+ * Patreon: https://patreon.com/TheBlokeAI
256
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
257
+
258
+ **Special thanks to**: Aemon Algiz.
259
+
260
+ **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
261
+
262
+
263
+ Thank you to all my generous patrons and donaters!
264
+
265
+ And thank you again to a16z for their generous grant.
266
+
267
+ <!-- footer end -->
268
+
269
+ # Original model card: AIDC-ai-business's Marcoroni 70B v1
270
+