TheBloke commited on
Commit
5c5f041
·
1 Parent(s): 24d19d0

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +334 -0
README.md ADDED
@@ -0,0 +1,334 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: https://huggingface.co/openchat/openchat_v3.2_super
3
+ inference: false
4
+ license: llama2
5
+ model_creator: OpenChat
6
+ model_name: OpenChat v3.2 Super
7
+ model_type: llama
8
+ prompt_template: 'GPT4 User: {prompt}<|end_of_turn|>GPT4 Assistant:
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
+ # OpenChat v3.2 Super - AWQ
32
+ - Model creator: [OpenChat](https://huggingface.co/openchat)
33
+ - Original model: [OpenChat v3.2 Super](https://huggingface.co/openchat/openchat_v3.2_super)
34
+
35
+ <!-- description start -->
36
+ ## Description
37
+
38
+ This repo contains AWQ model files for [OpenChat's OpenChat v3.2 Super](https://huggingface.co/openchat/openchat_v3.2_super).
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 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.
46
+ <!-- description end -->
47
+ <!-- repositories-available start -->
48
+ ## Repositories available
49
+
50
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/openchat_v3.2_super-AWQ)
51
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/openchat_v3.2_super-GPTQ)
52
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/openchat_v3.2_super-GGUF)
53
+ * [OpenChat's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/openchat/openchat_v3.2_super)
54
+ <!-- repositories-available end -->
55
+
56
+ <!-- prompt-template start -->
57
+ ## Prompt template: OpenChat
58
+
59
+ ```
60
+ GPT4 User: {prompt}<|end_of_turn|>GPT4 Assistant:
61
+
62
+ ```
63
+
64
+ <!-- prompt-template end -->
65
+
66
+
67
+ <!-- README_AWQ.md-provided-files start -->
68
+ ## Provided files and AWQ parameters
69
+
70
+ 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.
71
+
72
+ Models are released as sharded safetensors files.
73
+
74
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
75
+ | ------ | ---- | -- | ----------- | ------- | ---- |
76
+ | [main](https://huggingface.co/TheBloke/openchat_v3.2_super-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.25 GB
77
+
78
+ <!-- README_AWQ.md-provided-files end -->
79
+
80
+ <!-- README_AWQ.md-use-from-vllm start -->
81
+ ## Serving this model from vLLM
82
+
83
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
84
+
85
+ - When using vLLM as a server, pass the `--quantization awq` parameter, for example:
86
+
87
+ ```shell
88
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/openchat_v3.2_super-AWQ --quantization awq
89
+ ```
90
+
91
+ When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
92
+
93
+ ```python
94
+ from vllm import LLM, SamplingParams
95
+
96
+ prompts = [
97
+ "Hello, my name is",
98
+ "The president of the United States is",
99
+ "The capital of France is",
100
+ "The future of AI is",
101
+ ]
102
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
103
+
104
+ llm = LLM(model="TheBloke/openchat_v3.2_super-AWQ", quantization="awq")
105
+
106
+ outputs = llm.generate(prompts, sampling_params)
107
+
108
+ # Print the outputs.
109
+ for output in outputs:
110
+ prompt = output.prompt
111
+ generated_text = output.outputs[0].text
112
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
113
+ ```
114
+ <!-- README_AWQ.md-use-from-vllm start -->
115
+
116
+ <!-- README_AWQ.md-use-from-python start -->
117
+ ## How to use this AWQ model from Python code
118
+
119
+ ### Install the necessary packages
120
+
121
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.0.2 or later
122
+
123
+ ```shell
124
+ pip3 install autoawq
125
+ ```
126
+
127
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
128
+
129
+ ```shell
130
+ pip3 uninstall -y autoawq
131
+ git clone https://github.com/casper-hansen/AutoAWQ
132
+ cd AutoAWQ
133
+ pip3 install .
134
+ ```
135
+
136
+ ### You can then try the following example code
137
+
138
+ ```python
139
+ from awq import AutoAWQForCausalLM
140
+ from transformers import AutoTokenizer
141
+
142
+ model_name_or_path = "TheBloke/openchat_v3.2_super-AWQ"
143
+
144
+ # Load model
145
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
146
+ trust_remote_code=False, safetensors=True)
147
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
148
+
149
+ prompt = "Tell me about AI"
150
+ prompt_template=f'''GPT4 User: {prompt}<|end_of_turn|>GPT4 Assistant:
151
+
152
+ '''
153
+
154
+ print("\n\n*** Generate:")
155
+
156
+ tokens = tokenizer(
157
+ prompt_template,
158
+ return_tensors='pt'
159
+ ).input_ids.cuda()
160
+
161
+ # Generate output
162
+ generation_output = model.generate(
163
+ tokens,
164
+ do_sample=True,
165
+ temperature=0.7,
166
+ top_p=0.95,
167
+ top_k=40,
168
+ max_new_tokens=512
169
+ )
170
+
171
+ print("Output: ", tokenizer.decode(generation_output[0]))
172
+
173
+ # Inference can also be done using transformers' pipeline
174
+ from transformers import pipeline
175
+
176
+ print("*** Pipeline:")
177
+ pipe = pipeline(
178
+ "text-generation",
179
+ model=model,
180
+ tokenizer=tokenizer,
181
+ max_new_tokens=512,
182
+ do_sample=True,
183
+ temperature=0.7,
184
+ top_p=0.95,
185
+ top_k=40,
186
+ repetition_penalty=1.1
187
+ )
188
+
189
+ print(pipe(prompt_template)[0]['generated_text'])
190
+ ```
191
+ <!-- README_AWQ.md-use-from-python end -->
192
+
193
+ <!-- README_AWQ.md-compatibility start -->
194
+ ## Compatibility
195
+
196
+ The files provided are tested to work with [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), and [vLLM](https://github.com/vllm-project/vllm).
197
+
198
+ [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).
199
+ <!-- README_AWQ.md-compatibility end -->
200
+
201
+ <!-- footer start -->
202
+ <!-- 200823 -->
203
+ ## Discord
204
+
205
+ For further support, and discussions on these models and AI in general, join us at:
206
+
207
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
208
+
209
+ ## Thanks, and how to contribute
210
+
211
+ Thanks to the [chirper.ai](https://chirper.ai) team!
212
+
213
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
214
+
215
+ 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.
216
+
217
+ 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.
218
+
219
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
220
+
221
+ * Patreon: https://patreon.com/TheBlokeAI
222
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
223
+
224
+ **Special thanks to**: Aemon Algiz.
225
+
226
+ **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
227
+
228
+
229
+ Thank you to all my generous patrons and donaters!
230
+
231
+ And thank you again to a16z for their generous grant.
232
+
233
+ <!-- footer end -->
234
+
235
+ # Original model card: OpenChat's OpenChat v3.2 Super
236
+
237
+
238
+ # OpenChat: Advancing Open-source Language Models with Imperfect Data</h1>
239
+
240
+ <div align="center">
241
+ <img src="https://raw.githubusercontent.com/imoneoi/openchat/master/assets/logo_new.png" style="width: 65%">
242
+ </div>
243
+
244
+ OpenChat is a collection of open-source language models, optimized and fine-tuned with a strategy inspired by offline reinforcement learning. We use approximately 80k ShareGPT conversations, a conditioning strategy, and weighted loss to deliver outstanding performance, despite our simple approach. Our ultimate goal is to develop a high-performance, commercially available, open-source large language model, and we are continuously making strides towards this vision.
245
+
246
+ **🤖 Ranked #1 among all open-source models on [AgentBench](https://github.com/THUDM/AgentBench)**
247
+
248
+ **🔥 Ranked #1 among 13B open-source models | 89.5% win-rate on [AlpacaEval](https://tatsu-lab.github.io/alpaca_eval/) | 7.19 score on [MT-bench](https://chat.lmsys.org/?leaderboard)**
249
+
250
+ **🕒 Exceptionally efficient padding-free fine-tuning, only requires 15 hours on 8xA100 80G**
251
+
252
+ **💲 FREE for commercial use under [Llama 2 Community License](https://ai.meta.com/resources/models-and-libraries/llama-downloads/)**
253
+
254
+ [![DOI](https://zenodo.org/badge/645397533.svg)](https://zenodo.org/badge/latestdoi/645397533)
255
+
256
+ ## <a id="models"></a> Usage
257
+
258
+ To use these models, we highly recommend installing the OpenChat package by following the [installation guide](https://github.com/imoneoi/openchat/#installation) and using the OpenChat OpenAI-compatible API server by running the serving command from the table below. The server is optimized for high-throughput deployment using [vLLM](https://github.com/vllm-project/vllm) and can run on a GPU with at least 48GB RAM or two consumer GPUs with tensor parallelism. To enable tensor parallelism, append `--tensor-parallel-size 2` to the serving command.
259
+
260
+ When started, the server listens at `localhost:18888` for requests and is compatible with the [OpenAI ChatCompletion API specifications](https://platform.openai.com/docs/api-reference/chat). See the example request below for reference. Additionally, you can access the [OpenChat Web UI](#web-ui) for a user-friendly experience.
261
+
262
+ To deploy the server as an online service, use `--api-keys sk-KEY1 sk-KEY2 ...` to specify allowed API keys and `--disable-log-requests --disable-log-stats --log-file openchat.log` for logging only to a file. We recommend using a [HTTPS gateway](https://fastapi.tiangolo.com/es/deployment/concepts/#security-https) in front of the server for security purposes.
263
+
264
+ <details>
265
+ <summary>Example request (click to expand)</summary>
266
+
267
+ ```bash
268
+ curl http://localhost:18888/v1/chat/completions \
269
+ -H "Content-Type: application/json" \
270
+ -d '{
271
+ "model": "openchat_v3.2",
272
+ "messages": [{"role": "user", "content": "You are a large language model named OpenChat. Write a poem to describe yourself"}]
273
+ }'
274
+ ```
275
+
276
+ </details>
277
+
278
+ | Model | Size | Context | Weights | Serving |
279
+ |--------------|------|---------|--------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
280
+ | OpenChat 3.2 SUPER | 13B | 4096 | [Huggingface](https://huggingface.co/openchat/openchat_v3.2_super) | `python -m ochat.serving.openai_api_server --model-type openchat_v3.2 --model openchat/openchat_v3.2_super --engine-use-ray --worker-use-ray --max-num-batched-tokens 5120` |
281
+
282
+ For inference with Huggingface Transformers (slow and not recommended), follow the conversation template provided below:
283
+
284
+ <details>
285
+ <summary>Conversation templates (click to expand)</summary>
286
+
287
+ ```python
288
+ # Single-turn V3.2 (SUPER)
289
+ tokenize("GPT4 User: Hello<|end_of_turn|>GPT4 Assistant:")
290
+ # Result: [1, 402, 7982, 29946, 4911, 29901, 15043, 32000, 402, 7982, 29946, 4007, 22137, 29901]
291
+
292
+ # Multi-turn V3.2 (SUPER)
293
+ tokenize("GPT4 User: Hello<|end_of_turn|>GPT4 Assistant: Hi<|end_of_turn|>GPT4 User: How are you today?<|end_of_turn|>GPT4 Assistant:")
294
+ # Result: [1, 402, 7982, 29946, 4911, 29901, 15043, 32000, 402, 7982, 29946, 4007, 22137, 29901, 6324, 32000, 402, 7982, 29946, 4911, 29901, 1128, 526, 366, 9826, 29973, 32000, 402, 7982, 29946, 4007, 22137, 29901]
295
+ ```
296
+
297
+ </details>
298
+
299
+ ## <a id="benchmarks"></a> Benchmarks
300
+
301
+ We have evaluated our models using the two most popular evaluation benchmarks **, including AlpacaEval and MT-bench. Here we list the top models with our released versions, sorted by model size in descending order. The full version can be found on the [MT-bench](https://chat.lmsys.org/?leaderboard) and [AlpacaEval](https://tatsu-lab.github.io/alpaca_eval/) leaderboards.
302
+
303
+ To ensure consistency, we used the same routine as ChatGPT / GPT-4 to run these benchmarks. We started the OpenAI API-compatible server and set the `openai.api_base` to `http://localhost:18888/v1` in the benchmark program.
304
+
305
+ | **Model** | **Size** | **Context** | **Dataset Size** | **💲Free** | **AlpacaEval (win rate %)** | **MT-bench (win rate adjusted %)** | **MT-bench (score)** |
306
+ |----------------------------------|----------|-------------|------------------|-----------|-----------------------------|------------------------------------|----------------------|
307
+ | | | | | | **v.s. text-davinci-003** | **v.s. ChatGPT** | |
308
+ | GPT-4 | 1.8T* | 8K | | ❌ | 95.3 | 82.5 | 8.99 |
309
+ | ChatGPT | 175B* | 4K | | ❌ | 89.4 | 50.0 | 7.94 |
310
+ | Llama-2-70B-Chat | 70B | 4K | 2.9M | ✅ | 92.7 | 60.0 | 6.86 |
311
+ | **OpenChat 3.2 SUPER** | **13B** | **4K** | **80K** | ✅ | **89.5** | **57.5** | **7.19** |
312
+ | Llama-2-13B-Chat | 13B | 4K | 2.9M | ✅ | 81.1 | 55.3 | 6.65 |
313
+ | WizardLM 1.2 | 13B | 4K | 196K | ✅ | 89.2 | 53.1 | 7.05 |
314
+ | Vicuna 1.5 | 13B | 2K | 125K | ✅ | 78.8 | 37.2 | 6.57 |
315
+
316
+ *: Estimated model size
317
+
318
+ **: The benchmark metrics represent a quantified measure of a subset of the model's capabilities. A win-rate greater than 50% does not necessarily indicate that the model is better than ChatGPT in all scenarios or for all use cases. It is essential to consider the specific tasks or applications for which the model was evaluated and compare the results accordingly.
319
+
320
+ ## Limitations
321
+
322
+ **Foundation Model Limitations**
323
+ Despite its advanced capabilities, OpenChat is still bound by the limitations inherent in its foundation models. These limitations may impact the model's performance in areas such as:
324
+
325
+ - Complex reasoning
326
+ - Mathematical and arithmetic tasks
327
+ - Programming and coding challenges
328
+
329
+ **Hallucination of Non-existent Information**
330
+ OpenChat may sometimes generate information that does not exist or is not accurate, also known as "hallucination". Users should be aware of this possibility and verify any critical information obtained from the model.
331
+
332
+ ## License
333
+
334
+ Our OpenChat V3 models are licensed under the [Llama 2 Community License](https://ai.meta.com/resources/models-and-libraries/llama-downloads/).