TheBloke commited on
Commit
ef4e99c
1 Parent(s): 9bcf545

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +293 -0
README.md ADDED
@@ -0,0 +1,293 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/lmsys/vicuna-33b-v1.3
3
+ inference: false
4
+ license: other
5
+ model_creator: Large Model Systems Organization
6
+ model_name: Vicuna 33B V1.3
7
+ model_type: llama
8
+ prompt_template: 'A chat between a curious user and an artificial intelligence assistant.
9
+ The assistant gives helpful, detailed, and polite answers to the user''s questions.
10
+ USER: {prompt} ASSISTANT:
11
+
12
+ '
13
+ quantized_by: TheBloke
14
+ ---
15
+
16
+ <!-- header start -->
17
+ <!-- 200823 -->
18
+ <div style="width: auto; margin-left: auto; margin-right: auto">
19
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
20
+ </div>
21
+ <div style="display: flex; justify-content: space-between; width: 100%;">
22
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
23
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
24
+ </div>
25
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
26
+ <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>
27
+ </div>
28
+ </div>
29
+ <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>
30
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
31
+ <!-- header end -->
32
+
33
+ # Vicuna 33B V1.3 - AWQ
34
+ - Model creator: [Large Model Systems Organization](https://huggingface.co/lmsys)
35
+ - Original model: [Vicuna 33B V1.3](https://huggingface.co/lmsys/vicuna-33b-v1.3)
36
+
37
+ <!-- description start -->
38
+ ## Description
39
+
40
+ This repo contains AWQ model files for [LmSys' Vicuna 33B 1.3](https://huggingface.co/lmsys/vicuna-33b-v1.3).
41
+
42
+
43
+ ### About AWQ
44
+
45
+ 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.
46
+
47
+ 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.
48
+
49
+ 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).
50
+
51
+ 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.
52
+ <!-- description end -->
53
+ <!-- repositories-available start -->
54
+ ## Repositories available
55
+
56
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/vicuna-33B-AWQ)
57
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/vicuna-33B-GPTQ)
58
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/vicuna-33B-GGUF)
59
+ * [Large Model Systems Organization's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/lmsys/vicuna-33b-v1.3)
60
+ <!-- repositories-available end -->
61
+
62
+ <!-- prompt-template start -->
63
+ ## Prompt template: Vicuna
64
+
65
+ ```
66
+ A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: {prompt} ASSISTANT:
67
+
68
+ ```
69
+
70
+ <!-- prompt-template end -->
71
+
72
+
73
+ <!-- README_AWQ.md-provided-files start -->
74
+ ## Provided files, and AWQ parameters
75
+
76
+ 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.
77
+
78
+ Models are released as sharded safetensors files.
79
+
80
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
81
+ | ------ | ---- | -- | ----------- | ------- | ---- |
82
+ | [main](https://huggingface.co/TheBloke/vicuna-33B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 17.53 GB
83
+
84
+ <!-- README_AWQ.md-provided-files end -->
85
+
86
+ <!-- README_AWQ.md-use-from-vllm start -->
87
+ ## Serving this model from vLLM
88
+
89
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
90
+
91
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
92
+
93
+ ```shell
94
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/vicuna-33B-AWQ --quantization awq --dtype half
95
+ ```
96
+
97
+ Note: at the time of writing, vLLM has not yet done a new release with support for the `quantization` parameter.
98
+
99
+ If you try the code below and get an error about `quantization` being unrecognised, please install vLLM from Github source.
100
+
101
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
102
+
103
+ ```python
104
+ from vllm import LLM, SamplingParams
105
+
106
+ prompts = [
107
+ "Hello, my name is",
108
+ "The president of the United States is",
109
+ "The capital of France is",
110
+ "The future of AI is",
111
+ ]
112
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
113
+
114
+ llm = LLM(model="TheBloke/vicuna-33B-AWQ", quantization="awq", dtype="half")
115
+
116
+ outputs = llm.generate(prompts, sampling_params)
117
+
118
+ # Print the outputs.
119
+ for output in outputs:
120
+ prompt = output.prompt
121
+ generated_text = output.outputs[0].text
122
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
123
+ ```
124
+ <!-- README_AWQ.md-use-from-vllm start -->
125
+
126
+ <!-- README_AWQ.md-use-from-python start -->
127
+ ## How to use this AWQ model from Python code
128
+
129
+ ### Install the necessary packages
130
+
131
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
132
+
133
+ ```shell
134
+ pip3 install autoawq
135
+ ```
136
+
137
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
138
+
139
+ ```shell
140
+ pip3 uninstall -y autoawq
141
+ git clone https://github.com/casper-hansen/AutoAWQ
142
+ cd AutoAWQ
143
+ pip3 install .
144
+ ```
145
+
146
+ ### You can then try the following example code
147
+
148
+ ```python
149
+ from awq import AutoAWQForCausalLM
150
+ from transformers import AutoTokenizer
151
+
152
+ model_name_or_path = "TheBloke/vicuna-33B-AWQ"
153
+
154
+ # Load model
155
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
156
+ trust_remote_code=False, safetensors=True)
157
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
158
+
159
+ prompt = "Tell me about AI"
160
+ prompt_template=f'''A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: {prompt} ASSISTANT:
161
+
162
+ '''
163
+
164
+ print("\n\n*** Generate:")
165
+
166
+ tokens = tokenizer(
167
+ prompt_template,
168
+ return_tensors='pt'
169
+ ).input_ids.cuda()
170
+
171
+ # Generate output
172
+ generation_output = model.generate(
173
+ tokens,
174
+ do_sample=True,
175
+ temperature=0.7,
176
+ top_p=0.95,
177
+ top_k=40,
178
+ max_new_tokens=512
179
+ )
180
+
181
+ print("Output: ", tokenizer.decode(generation_output[0]))
182
+
183
+ """
184
+ # Inference should be possible with transformers pipeline as well in future
185
+ # But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
186
+ from transformers import pipeline
187
+
188
+ print("*** Pipeline:")
189
+ pipe = pipeline(
190
+ "text-generation",
191
+ model=model,
192
+ tokenizer=tokenizer,
193
+ max_new_tokens=512,
194
+ do_sample=True,
195
+ temperature=0.7,
196
+ top_p=0.95,
197
+ top_k=40,
198
+ repetition_penalty=1.1
199
+ )
200
+
201
+ print(pipe(prompt_template)[0]['generated_text'])
202
+ """
203
+ ```
204
+ <!-- README_AWQ.md-use-from-python end -->
205
+
206
+ <!-- README_AWQ.md-compatibility start -->
207
+ ## Compatibility
208
+
209
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
210
+
211
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) 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.
212
+
213
+ At the time of writing (25th September) TGI's PR appears not to work with 70B models, but this is likely to be fixed quickly.
214
+
215
+ <!-- README_AWQ.md-compatibility end -->
216
+
217
+ <!-- footer start -->
218
+ <!-- 200823 -->
219
+ ## Discord
220
+
221
+ For further support, and discussions on these models and AI in general, join us at:
222
+
223
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
224
+
225
+ ## Thanks, and how to contribute
226
+
227
+ Thanks to the [chirper.ai](https://chirper.ai) team!
228
+
229
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
230
+
231
+ 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.
232
+
233
+ 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.
234
+
235
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
236
+
237
+ * Patreon: https://patreon.com/TheBlokeAI
238
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
239
+
240
+ **Special thanks to**: Aemon Algiz.
241
+
242
+ **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
243
+
244
+
245
+ Thank you to all my generous patrons and donaters!
246
+
247
+ And thank you again to a16z for their generous grant.
248
+
249
+ <!-- footer end -->
250
+
251
+ # Original model card: LmSys' Vicuna 33B 1.3
252
+
253
+
254
+ # Vicuna Model Card
255
+
256
+ ## Model Details
257
+
258
+ Vicuna is a chat assistant trained by fine-tuning LLaMA on user-shared conversations collected from ShareGPT.
259
+
260
+ - **Developed by:** [LMSYS](https://lmsys.org/)
261
+ - **Model type:** An auto-regressive language model based on the transformer architecture.
262
+ - **License:** Non-commercial license
263
+ - **Finetuned from model:** [LLaMA](https://arxiv.org/abs/2302.13971).
264
+
265
+ ### Model Sources
266
+
267
+ - **Repository:** https://github.com/lm-sys/FastChat
268
+ - **Blog:** https://lmsys.org/blog/2023-03-30-vicuna/
269
+ - **Paper:** https://arxiv.org/abs/2306.05685
270
+ - **Demo:** https://chat.lmsys.org/
271
+
272
+ ## Uses
273
+
274
+ The primary use of Vicuna is research on large language models and chatbots.
275
+ The primary intended users of the model are researchers and hobbyists in natural language processing, machine learning, and artificial intelligence.
276
+
277
+ ## How to Get Started with the Model
278
+
279
+ - Command line interface: https://github.com/lm-sys/FastChat#vicuna-weights.
280
+ - APIs (OpenAI API, Huggingface API): https://github.com/lm-sys/FastChat/tree/main#api.
281
+
282
+ ## Training Details
283
+
284
+ Vicuna v1.3 is fine-tuned from LLaMA with supervised instruction fine-tuning.
285
+ The training data is around 125K conversations collected from ShareGPT.com.
286
+ See more details in the "Training Details of Vicuna Models" section in the appendix of this [paper](https://arxiv.org/pdf/2306.05685.pdf).
287
+
288
+ ## Evaluation
289
+
290
+ Vicuna is evaluated with standard benchmarks, human preference, and LLM-as-a-judge. See more details in this [paper](https://arxiv.org/pdf/2306.05685.pdf) and [leaderboard](https://huggingface.co/spaces/lmsys/chatbot-arena-leaderboard).
291
+
292
+ ## Difference between different versions of Vicuna
293
+ See [vicuna_weights_version.md](https://github.com/lm-sys/FastChat/blob/main/docs/vicuna_weights_version.md)