TheBloke commited on
Commit
95a9d35
1 Parent(s): 243aa67

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +282 -0
README.md ADDED
@@ -0,0 +1,282 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/lmsys/vicuna-13b-v1.5-16k
3
+ inference: false
4
+ license: llama2
5
+ model_creator: lmsys
6
+ model_name: Vicuna 13B v1.5 16K
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 13B v1.5 16K - AWQ
34
+ - Model creator: [lmsys](https://huggingface.co/lmsys)
35
+ - Original model: [Vicuna 13B v1.5 16K](https://huggingface.co/lmsys/vicuna-13b-v1.5-16k)
36
+
37
+ <!-- description start -->
38
+ ## Description
39
+
40
+ This repo contains AWQ model files for [lmsys's Vicuna 13B v1.5 16K](https://huggingface.co/lmsys/vicuna-13b-v1.5-16k).
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 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.
48
+ <!-- description end -->
49
+ <!-- repositories-available start -->
50
+ ## Repositories available
51
+
52
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/vicuna-13B-v1.5-16K-AWQ)
53
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/vicuna-13B-v1.5-16K-GPTQ)
54
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/vicuna-13B-v1.5-16K-GGUF)
55
+ * [lmsys's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/lmsys/vicuna-13b-v1.5-16k)
56
+ <!-- repositories-available end -->
57
+
58
+ <!-- prompt-template start -->
59
+ ## Prompt template: Vicuna
60
+
61
+ ```
62
+ 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:
63
+
64
+ ```
65
+
66
+ <!-- prompt-template end -->
67
+
68
+
69
+ <!-- README_AWQ.md-provided-files start -->
70
+ ## Provided files and AWQ parameters
71
+
72
+ 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.
73
+
74
+ Models are released as sharded safetensors files.
75
+
76
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
77
+ | ------ | ---- | -- | ----------- | ------- | ---- |
78
+ | [main](https://huggingface.co/TheBloke/vicuna-13B-v1.5-16K-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 GB
79
+
80
+ <!-- README_AWQ.md-provided-files end -->
81
+
82
+ <!-- README_AWQ.md-use-from-vllm start -->
83
+ ## Serving this model from vLLM
84
+
85
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
86
+
87
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
88
+
89
+ ```shell
90
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/vicuna-13B-v1.5-16K-AWQ --quantization awq
91
+ ```
92
+
93
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
94
+
95
+ ```python
96
+ from vllm import LLM, SamplingParams
97
+
98
+ prompts = [
99
+ "Hello, my name is",
100
+ "The president of the United States is",
101
+ "The capital of France is",
102
+ "The future of AI is",
103
+ ]
104
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
105
+
106
+ llm = LLM(model="TheBloke/vicuna-13B-v1.5-16K-AWQ", quantization="awq")
107
+
108
+ outputs = llm.generate(prompts, sampling_params)
109
+
110
+ # Print the outputs.
111
+ for output in outputs:
112
+ prompt = output.prompt
113
+ generated_text = output.outputs[0].text
114
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
115
+ ```
116
+ <!-- README_AWQ.md-use-from-vllm start -->
117
+
118
+ <!-- README_AWQ.md-use-from-python start -->
119
+ ## How to use this AWQ model from Python code
120
+
121
+ ### Install the necessary packages
122
+
123
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
124
+
125
+ ```shell
126
+ pip3 install autoawq
127
+ ```
128
+
129
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
130
+
131
+ ```shell
132
+ pip3 uninstall -y autoawq
133
+ git clone https://github.com/casper-hansen/AutoAWQ
134
+ cd AutoAWQ
135
+ pip3 install .
136
+ ```
137
+
138
+ ### You can then try the following example code
139
+
140
+ ```python
141
+ from awq import AutoAWQForCausalLM
142
+ from transformers import AutoTokenizer
143
+
144
+ model_name_or_path = "TheBloke/vicuna-13B-v1.5-16K-AWQ"
145
+
146
+ # Load model
147
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
148
+ trust_remote_code=False, safetensors=True)
149
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
150
+
151
+ prompt = "Tell me about AI"
152
+ 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:
153
+
154
+ '''
155
+
156
+ print("\n\n*** Generate:")
157
+
158
+ tokens = tokenizer(
159
+ prompt_template,
160
+ return_tensors='pt'
161
+ ).input_ids.cuda()
162
+
163
+ # Generate output
164
+ generation_output = model.generate(
165
+ tokens,
166
+ do_sample=True,
167
+ temperature=0.7,
168
+ top_p=0.95,
169
+ top_k=40,
170
+ max_new_tokens=512
171
+ )
172
+
173
+ print("Output: ", tokenizer.decode(generation_output[0]))
174
+
175
+ # Inference can also be done using transformers' pipeline
176
+ from transformers import pipeline
177
+
178
+ print("*** Pipeline:")
179
+ pipe = pipeline(
180
+ "text-generation",
181
+ model=model,
182
+ tokenizer=tokenizer,
183
+ max_new_tokens=512,
184
+ do_sample=True,
185
+ temperature=0.7,
186
+ top_p=0.95,
187
+ top_k=40,
188
+ repetition_penalty=1.1
189
+ )
190
+
191
+ print(pipe(prompt_template)[0]['generated_text'])
192
+ ```
193
+ <!-- README_AWQ.md-use-from-python end -->
194
+
195
+ <!-- README_AWQ.md-compatibility start -->
196
+ ## Compatibility
197
+
198
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
199
+
200
+ [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).
201
+ <!-- README_AWQ.md-compatibility end -->
202
+
203
+ <!-- footer start -->
204
+ <!-- 200823 -->
205
+ ## Discord
206
+
207
+ For further support, and discussions on these models and AI in general, join us at:
208
+
209
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
210
+
211
+ ## Thanks, and how to contribute
212
+
213
+ Thanks to the [chirper.ai](https://chirper.ai) team!
214
+
215
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
216
+
217
+ 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.
218
+
219
+ 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.
220
+
221
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
222
+
223
+ * Patreon: https://patreon.com/TheBlokeAI
224
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
225
+
226
+ **Special thanks to**: Aemon Algiz.
227
+
228
+ **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
229
+
230
+
231
+ Thank you to all my generous patrons and donaters!
232
+
233
+ And thank you again to a16z for their generous grant.
234
+
235
+ <!-- footer end -->
236
+
237
+ # Original model card: lmsys's Vicuna 13B v1.5 16K
238
+
239
+
240
+ # Vicuna Model Card
241
+
242
+ ## Model Details
243
+
244
+ Vicuna is a chat assistant trained by fine-tuning Llama 2 on user-shared conversations collected from ShareGPT.
245
+
246
+ - **Developed by:** [LMSYS](https://lmsys.org/)
247
+ - **Model type:** An auto-regressive language model based on the transformer architecture
248
+ - **License:** Llama 2 Community License Agreement
249
+ - **Finetuned from model:** [Llama 2](https://arxiv.org/abs/2307.09288)
250
+
251
+ ### Model Sources
252
+
253
+ - **Repository:** https://github.com/lm-sys/FastChat
254
+ - **Blog:** https://lmsys.org/blog/2023-03-30-vicuna/
255
+ - **Paper:** https://arxiv.org/abs/2306.05685
256
+ - **Demo:** https://chat.lmsys.org/
257
+
258
+ ## Uses
259
+
260
+ The primary use of Vicuna is research on large language models and chatbots.
261
+ The primary intended users of the model are researchers and hobbyists in natural language processing, machine learning, and artificial intelligence.
262
+
263
+ ## How to Get Started with the Model
264
+
265
+ - Command line interface: https://github.com/lm-sys/FastChat#vicuna-weights
266
+ - APIs (OpenAI API, Huggingface API): https://github.com/lm-sys/FastChat/tree/main#api
267
+
268
+ ## Training Details
269
+
270
+ Vicuna v1.5 (16k) is fine-tuned from Llama 2 with supervised instruction fine-tuning and linear RoPE scaling.
271
+ The training data is around 125K conversations collected from ShareGPT.com. These conversations are packed into sequences that contain 16K tokens each.
272
+ See more details in the "Training Details of Vicuna Models" section in the appendix of this [paper](https://arxiv.org/pdf/2306.05685.pdf).
273
+
274
+ ## Evaluation
275
+
276
+ ![Evaluation Results](https://github.com/lm-sys/lm-sys.github.io/blob/main/public/images/webdata/vicuna_v1.5_eval.png?raw=true)
277
+
278
+ 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).
279
+
280
+ ## Difference between different versions of Vicuna
281
+
282
+ See [vicuna_weights_version.md](https://github.com/lm-sys/FastChat/blob/main/docs/vicuna_weights_version.md)