TheBloke commited on
Commit
fcd6d8f
·
1 Parent(s): 4b61659

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: openbmb/UltraRM-13b
3
+ inference: false
4
+ license: mit
5
+ model_creator: OpenBMB
6
+ model_name: UltraRM 13B
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
+ # UltraRM 13B - AWQ
32
+ - Model creator: [OpenBMB](https://huggingface.co/openbmb)
33
+ - Original model: [UltraRM 13B](https://huggingface.co/openbmb/UltraRM-13b)
34
+
35
+ <!-- description start -->
36
+ ## Description
37
+
38
+ This repo contains AWQ model files for [OpenBMB's UltraRM 13B](https://huggingface.co/openbmb/UltraRM-13b).
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/UltraRM-13B-AWQ)
55
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/UltraRM-13B-GPTQ)
56
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/UltraRM-13B-GGUF)
57
+ * [OpenBMB's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/openbmb/UltraRM-13b)
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 `mit`, 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: [OpenBMB's UltraRM 13B](https://huggingface.co/openbmb/UltraRM-13b).
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/UltraRM-13B-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 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
+ Note: at the time of writing, vLLM has not yet done a new release with AWQ support.
97
+
98
+ If you try the vLLM examples below and get an error about `quantization` being unrecognised, or other AWQ-related issues, please install vLLM from Github source.
99
+
100
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
101
+
102
+ ```shell
103
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/UltraRM-13B-AWQ --quantization awq --dtype half
104
+ ```
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/UltraRM-13B-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/UltraRM-13B-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/UltraRM-13B-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**: Pierre Kircher, Stanislav Ovsiannikov, Michael Levine, Eugene Pentland, Andrey, 준교 김, Randy H, Fred von Graf, Artur Olbinski, Caitlyn Gatomon, terasurfer, Jeff Scroggin, James Bentley, Vadim, Gabriel Puliatti, Harry Royden McLaughlin, Sean Connelly, Dan Guido, Edmond Seymore, Alicia Loh, subjectnull, AzureBlack, Manuel Alberto Morcote, Thomas Belote, Lone Striker, Chris Smitley, Vitor Caleffi, Johann-Peter Hartmann, Clay Pascal, biorpg, Brandon Frisco, sidney chen, transmissions 11, Pedro Madruga, jinyuan sun, Ajan Kanaga, Emad Mostaque, Trenton Dambrowitz, Jonathan Leane, Iucharbius, usrbinkat, vamX, George Stoitzev, Luke Pendergrass, theTransient, Olakabola, Swaroop Kallakuri, Cap'n Zoog, Brandon Phillips, Michael Dempsey, Nikolai Manek, danny, Matthew Berman, Gabriel Tamborski, alfie_i, Raymond Fosdick, Tom X Nguyen, Raven Klaugh, LangChain4j, Magnesian, Illia Dulskyi, David Ziegler, Mano Prime, Luis Javier Navarrete Lozano, Erik Bjäreholt, 阿明, Nathan Dryer, Alex, Rainer Wilmers, zynix, TL, Joseph William Delisle, John Villwock, Nathan LeClaire, Willem Michiel, Joguhyik, GodLy, OG, Alps Aficionado, Jeffrey Morgan, ReadyPlayerEmma, Tiffany J. Kim, Sebastain Graf, Spencer Kim, Michael Davis, webtim, Talal Aujan, knownsqashed, John Detwiler, Imad Khwaja, Deo Leter, Jerry Meng, Elijah Stavena, Rooh Singh, Pieter, SuperWojo, Alexandros Triantafyllidis, Stephen Murray, Ai Maven, ya boyyy, Enrico Ros, Ken Nordquist, Deep Realms, Nicholas, Spiking Neurons AB, Elle, Will Dee, Jack West, RoA, Luke @flexchar, Viktor Bowallius, Derek Yates, Subspace Studios, jjj, Toran Billups, Asp the Wyvern, Fen Risland, Ilya, NimbleBox.ai, Chadd, Nitin Borwankar, Emre, Mandus, Leonard Tan, Kalila, K, Trailburnt, S_X, Cory Kujawski
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: OpenBMB's UltraRM 13B
270
+
271
+
272
+ # News
273
+
274
+ - [2023/09/26]: UltraRM unleashes the power of [UltraLM-13B-v2.0](https://huggingface.co/openbmb/UltraLM-13b-v2.0) and [UltraLM-13B](https://huggingface.co/openbmb/UltraLM-13b)! A simple best-of-16 sampling achieves **92.30%** (UltraLM2, 🥇 in 13B results) and **91.54%** (UltraLM, 🥇 in LLaMA-1 results) win rates against text-davinci-003 on [AlpacaEval](https://tatsu-lab.github.io/alpaca_eval/) benchmark!
275
+ - [2023/09/26]: We release the [UltraFeedback](https://huggingface.co/datasets/openbmb/UltraFeedback) dataset, along with UltraFeedback-powered reward model [UltraRM](https://huggingface.co/datasets/openbmb/UltraFeedback) and critique model [UltraCM](https://huggingface.co/datasets/openbmb/UltraCM-13b)! Both built **new SOTAs** over open-source models!
276
+
277
+ # Links
278
+
279
+ - 🤗 [UltraFeedback](https://huggingface.co/datasets/openbmb/UltraFeedback)
280
+ - 🤗 [UltraRM](https://huggingface.co/datasets/openbmb/UltraRM-13b)
281
+ - 🤗 [UltraCM](https://huggingface.co/datasets/openbmb/UltraCM-13b)
282
+
283
+ # UltraRM
284
+
285
+ We train and release a reward model UltraRM based on UltraFeedback to further facilitate alignment research. UltraRM is initialized by LLaMA2-13B.
286
+
287
+ Specifically, we train two versions of reward models, where UltraRM-UF is merely fine-tuned on UltraFeedback and UltraRM is fine-tuned on a mixture of UltraFeedback and an equal-size sample from three open-source datasets including [Anthropic HH-RLHF](https://huggingface.co/datasets/Anthropic/hh-rlhf), [Standford SHP](https://huggingface.co/datasets/stanfordnlp/SHP), and [Summarization](https://huggingface.co/datasets/openai/summarize_from_feedback).
288
+
289
+ ## Reward Modeling
290
+
291
+ On four public preference test sets, our UltraRM achieves SOTA over other open-source reward models.
292
+
293
+ ## Usage