TheBloke commited on
Commit
519b7b3
1 Parent(s): d5e025c

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +277 -0
README.md ADDED
@@ -0,0 +1,277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/jordiclive/Llama-2-70b-oasst-1-200
3
+ datasets:
4
+ - OpenAssistant/oasst1
5
+ inference: false
6
+ language:
7
+ - en
8
+ - de
9
+ - es
10
+ - fr
11
+ license: apache-2.0
12
+ model_creator: Jordan Clive
13
+ model_name: Open-Assistant Llama2 70B SFT OASST
14
+ model_type: llama
15
+ prompt_template: '<|prompter|>{prompt}<|endoftext|><|assistant|>
16
+
17
+ '
18
+ quantized_by: TheBloke
19
+ tags:
20
+ - sft
21
+ ---
22
+
23
+ <!-- header start -->
24
+ <!-- 200823 -->
25
+ <div style="width: auto; margin-left: auto; margin-right: auto">
26
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
27
+ </div>
28
+ <div style="display: flex; justify-content: space-between; width: 100%;">
29
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
30
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
31
+ </div>
32
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
33
+ <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>
34
+ </div>
35
+ </div>
36
+ <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>
37
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
38
+ <!-- header end -->
39
+
40
+ # Open-Assistant Llama2 70B SFT OASST - AWQ
41
+ - Model creator: [Jordan Clive](https://huggingface.co/jordiclive)
42
+ - Original model: [Open-Assistant Llama2 70B SFT OASST](https://huggingface.co/jordiclive/Llama-2-70b-oasst-1-200)
43
+
44
+ <!-- description start -->
45
+ ## Description
46
+
47
+ This repo contains AWQ model files for [Jordan Clive's Open-Assistant Llama2 70B SFT OASST](https://huggingface.co/jordiclive/Llama-2-70b-oasst-1-200).
48
+
49
+
50
+ ### About AWQ
51
+
52
+ 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.
53
+
54
+ 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.
55
+ <!-- description end -->
56
+ <!-- repositories-available start -->
57
+ ## Repositories available
58
+
59
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Llama-2-70B-OASST-1-200-AWQ)
60
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Llama-2-70B-OASST-1-200-GPTQ)
61
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Llama-2-70B-OASST-1-200-GGUF)
62
+ * [Jordan Clive's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/jordiclive/Llama-2-70b-oasst-1-200)
63
+ <!-- repositories-available end -->
64
+
65
+ <!-- prompt-template start -->
66
+ ## Prompt template: OpenAssistant
67
+
68
+ ```
69
+ <|prompter|>{prompt}<|endoftext|><|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 `apache-2.0`, 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: [Jordan Clive's Open-Assistant Llama2 70B SFT OASST](https://huggingface.co/jordiclive/Llama-2-70b-oasst-1-200).
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-OASST-1-200-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-OASST-1-200-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-OASST-1-200-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-OASST-1-200-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'''<|prompter|>{prompt}<|endoftext|><|assistant|>
167
+
168
+ '''
169
+
170
+ print("\n\n*** Generate:")
171
+
172
+ tokens = tokenizer(
173
+ prompt_template,
174
+ return_tensors='pt'
175
+ ).input_ids.cuda()
176
+
177
+ # Generate output
178
+ generation_output = model.generate(
179
+ tokens,
180
+ do_sample=True,
181
+ temperature=0.7,
182
+ top_p=0.95,
183
+ top_k=40,
184
+ max_new_tokens=512
185
+ )
186
+
187
+ print("Output: ", tokenizer.decode(generation_output[0]))
188
+
189
+ # Inference can also be done using transformers' pipeline
190
+ from transformers import pipeline
191
+
192
+ print("*** Pipeline:")
193
+ pipe = pipeline(
194
+ "text-generation",
195
+ model=model,
196
+ tokenizer=tokenizer,
197
+ max_new_tokens=512,
198
+ do_sample=True,
199
+ temperature=0.7,
200
+ top_p=0.95,
201
+ top_k=40,
202
+ repetition_penalty=1.1
203
+ )
204
+
205
+ print(pipe(prompt_template)[0]['generated_text'])
206
+ ```
207
+ <!-- README_AWQ.md-use-from-python end -->
208
+
209
+ <!-- README_AWQ.md-compatibility start -->
210
+ ## Compatibility
211
+
212
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
213
+
214
+ [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).
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: Jordan Clive's Open-Assistant Llama2 70B SFT OASST
252
+
253
+
254
+ # Open-Assistant Llama2 70B SFT OASST
255
+
256
+ This model is a fine-tuning of [Llama2 70B](https://huggingface.co/meta-llama/Llama-2-70b-hf) LLM.
257
+ It was trained on a mixture of OASST top-1 threads.
258
+ ## Model Details
259
+
260
+ - **Finetuned from:** [Llama2 70B](https://huggingface.co/meta-llama/Llama-2-70b-hf)
261
+ - **Model type:** Causal decoder-only transformer language model
262
+ - **Language:** English, German, Spanish, French (and limited capabilities in Italian, Portuguese, Polish, Dutch, Romanian, Czech, Swedish);
263
+ - **License:** Apache 2.0
264
+ - **Contact:** [Open-Assistant Discord](https://ykilcher.com/open-assistant-discord)
265
+
266
+ ## Prompting
267
+
268
+ Two special tokens are used to mark the beginning of user and assistant turns:
269
+ `<|prompter|>` and `<|assistant|>`. Each turn ends with a `</s>` token.
270
+
271
+ Input prompt example:
272
+ ```
273
+ <|prompter|>What is a meme, and what's the history behind this word?</s><|assistant|>
274
+ ```
275
+ The input ends with the `<|assistant|>` token to signal that the model should
276
+ start generating the assistant reply.
277
+