TheBloke commited on
Commit
334626b
1 Parent(s): 6a7b1f8

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +613 -0
README.md ADDED
@@ -0,0 +1,613 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: openchat/openchat-3.5-0106
3
+ inference: false
4
+ library_name: transformers
5
+ license: apache-2.0
6
+ model_creator: OpenChat
7
+ model_name: Openchat 3.5 0106
8
+ model_type: mistral
9
+ pipeline_tag: text-generation
10
+ prompt_template: 'GPT4 Correct User: {prompt}<|end_of_turn|>GPT4 Correct Assistant:
11
+
12
+ '
13
+ quantized_by: TheBloke
14
+ tags:
15
+ - openchat
16
+ - mistral
17
+ - C-RLFT
18
+ ---
19
+ <!-- markdownlint-disable MD041 -->
20
+
21
+ <!-- header start -->
22
+ <!-- 200823 -->
23
+ <div style="width: auto; margin-left: auto; margin-right: auto">
24
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
25
+ </div>
26
+ <div style="display: flex; justify-content: space-between; width: 100%;">
27
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
28
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
29
+ </div>
30
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
31
+ <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>
32
+ </div>
33
+ </div>
34
+ <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>
35
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
36
+ <!-- header end -->
37
+
38
+ # Openchat 3.5 0106 - AWQ
39
+ - Model creator: [OpenChat](https://huggingface.co/openchat)
40
+ - Original model: [Openchat 3.5 0106](https://huggingface.co/openchat/openchat-3.5-0106)
41
+
42
+ <!-- description start -->
43
+ ## Description
44
+
45
+ This repo contains AWQ model files for [OpenChat's Openchat 3.5 0106](https://huggingface.co/openchat/openchat-3.5-0106).
46
+
47
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
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 with equivalent or better quality compared to the most commonly used GPTQ settings.
53
+
54
+ AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
55
+
56
+ It is supported by:
57
+
58
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
59
+ - [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
60
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
61
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
62
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
63
+
64
+ <!-- description end -->
65
+ <!-- repositories-available start -->
66
+ ## Repositories available
67
+
68
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/openchat-3.5-0106-AWQ)
69
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/openchat-3.5-0106-GPTQ)
70
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/openchat-3.5-0106-GGUF)
71
+ * [OpenChat's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/openchat/openchat-3.5-0106)
72
+ <!-- repositories-available end -->
73
+
74
+ <!-- prompt-template start -->
75
+ ## Prompt template: OpenChat-Correct
76
+
77
+ ```
78
+ GPT4 Correct User: {prompt}<|end_of_turn|>GPT4 Correct Assistant:
79
+
80
+ ```
81
+
82
+ <!-- prompt-template end -->
83
+
84
+
85
+ <!-- README_AWQ.md-provided-files start -->
86
+ ## Provided files, and AWQ parameters
87
+
88
+ I currently release 128g GEMM models only. The addition of group_size 32 models, and GEMV kernel models, is being actively considered.
89
+
90
+ Models are released as sharded safetensors files.
91
+
92
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
93
+ | ------ | ---- | -- | ----------- | ------- | ---- |
94
+ | [main](https://huggingface.co/TheBloke/openchat-3.5-0106-AWQ/tree/main) | 4 | 128 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 4.15 GB
95
+
96
+ <!-- README_AWQ.md-provided-files end -->
97
+
98
+ <!-- README_AWQ.md-text-generation-webui start -->
99
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
100
+
101
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
102
+
103
+ It is strongly recommended to use the text-generation-webui one-click-installers unless you're sure you know how to make a manual install.
104
+
105
+ 1. Click the **Model tab**.
106
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/openchat-3.5-0106-AWQ`.
107
+ 3. Click **Download**.
108
+ 4. The model will start downloading. Once it's finished it will say "Done".
109
+ 5. In the top left, click the refresh icon next to **Model**.
110
+ 6. In the **Model** dropdown, choose the model you just downloaded: `openchat-3.5-0106-AWQ`
111
+ 7. Select **Loader: AutoAWQ**.
112
+ 8. Click Load, and the model will load and is now ready for use.
113
+ 9. If you want any custom settings, set them and then click **Save settings for this model** followed by **Reload the Model** in the top right.
114
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
115
+ <!-- README_AWQ.md-text-generation-webui end -->
116
+
117
+ <!-- README_AWQ.md-use-from-vllm start -->
118
+ ## Multi-user inference server: vLLM
119
+
120
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
121
+
122
+ - Please ensure you are using vLLM version 0.2 or later.
123
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
124
+
125
+ For example:
126
+
127
+ ```shell
128
+ python3 -m vllm.entrypoints.api_server --model TheBloke/openchat-3.5-0106-AWQ --quantization awq --dtype auto
129
+ ```
130
+
131
+ - When using vLLM from Python code, again set `quantization=awq`.
132
+
133
+ For example:
134
+
135
+ ```python
136
+ from vllm import LLM, SamplingParams
137
+
138
+ prompts = [
139
+ "Tell me about AI",
140
+ "Write a story about llamas",
141
+ "What is 291 - 150?",
142
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
143
+ ]
144
+ prompt_template=f'''GPT4 Correct User: {prompt}<|end_of_turn|>GPT4 Correct Assistant:
145
+ '''
146
+
147
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
148
+
149
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
150
+
151
+ llm = LLM(model="TheBloke/openchat-3.5-0106-AWQ", quantization="awq", dtype="auto")
152
+
153
+ outputs = llm.generate(prompts, sampling_params)
154
+
155
+ # Print the outputs.
156
+ for output in outputs:
157
+ prompt = output.prompt
158
+ generated_text = output.outputs[0].text
159
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
160
+ ```
161
+ <!-- README_AWQ.md-use-from-vllm start -->
162
+
163
+ <!-- README_AWQ.md-use-from-tgi start -->
164
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
165
+
166
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
167
+
168
+ Example Docker parameters:
169
+
170
+ ```shell
171
+ --model-id TheBloke/openchat-3.5-0106-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
172
+ ```
173
+
174
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
175
+
176
+ ```shell
177
+ pip3 install huggingface-hub
178
+ ```
179
+
180
+ ```python
181
+ from huggingface_hub import InferenceClient
182
+
183
+ endpoint_url = "https://your-endpoint-url-here"
184
+
185
+ prompt = "Tell me about AI"
186
+ prompt_template=f'''GPT4 Correct User: {prompt}<|end_of_turn|>GPT4 Correct Assistant:
187
+ '''
188
+
189
+ client = InferenceClient(endpoint_url)
190
+ response = client.text_generation(prompt,
191
+ max_new_tokens=128,
192
+ do_sample=True,
193
+ temperature=0.7,
194
+ top_p=0.95,
195
+ top_k=40,
196
+ repetition_penalty=1.1)
197
+
198
+ print(f"Model output: ", response)
199
+ ```
200
+ <!-- README_AWQ.md-use-from-tgi end -->
201
+
202
+ <!-- README_AWQ.md-use-from-python start -->
203
+ ## Inference from Python code using Transformers
204
+
205
+ ### Install the necessary packages
206
+
207
+ - Requires: [Transformers](https://huggingface.co/docs/transformers) 4.35.0 or later.
208
+ - Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.6 or later.
209
+
210
+ ```shell
211
+ pip3 install --upgrade "autoawq>=0.1.6" "transformers>=4.35.0"
212
+ ```
213
+
214
+ Note that if you are using PyTorch 2.0.1, the above AutoAWQ command will automatically upgrade you to PyTorch 2.1.0.
215
+
216
+ If you are using CUDA 11.8 and wish to continue using PyTorch 2.0.1, instead run this command:
217
+
218
+ ```shell
219
+ pip3 install https://github.com/casper-hansen/AutoAWQ/releases/download/v0.1.6/autoawq-0.1.6+cu118-cp310-cp310-linux_x86_64.whl
220
+ ```
221
+
222
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
223
+
224
+ ```shell
225
+ pip3 uninstall -y autoawq
226
+ git clone https://github.com/casper-hansen/AutoAWQ
227
+ cd AutoAWQ
228
+ pip3 install .
229
+ ```
230
+
231
+ ### Transformers example code (requires Transformers 4.35.0 and later)
232
+
233
+ ```python
234
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
235
+
236
+ model_name_or_path = "TheBloke/openchat-3.5-0106-AWQ"
237
+
238
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
239
+ model = AutoModelForCausalLM.from_pretrained(
240
+ model_name_or_path,
241
+ low_cpu_mem_usage=True,
242
+ device_map="cuda:0"
243
+ )
244
+
245
+ # Using the text streamer to stream output one token at a time
246
+ streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
247
+
248
+ prompt = "Tell me about AI"
249
+ prompt_template=f'''GPT4 Correct User: {prompt}<|end_of_turn|>GPT4 Correct Assistant:
250
+ '''
251
+
252
+ # Convert prompt to tokens
253
+ tokens = tokenizer(
254
+ prompt_template,
255
+ return_tensors='pt'
256
+ ).input_ids.cuda()
257
+
258
+ generation_params = {
259
+ "do_sample": True,
260
+ "temperature": 0.7,
261
+ "top_p": 0.95,
262
+ "top_k": 40,
263
+ "max_new_tokens": 512,
264
+ "repetition_penalty": 1.1
265
+ }
266
+
267
+ # Generate streamed output, visible one token at a time
268
+ generation_output = model.generate(
269
+ tokens,
270
+ streamer=streamer,
271
+ **generation_params
272
+ )
273
+
274
+ # Generation without a streamer, which will include the prompt in the output
275
+ generation_output = model.generate(
276
+ tokens,
277
+ **generation_params
278
+ )
279
+
280
+ # Get the tokens from the output, decode them, print them
281
+ token_output = generation_output[0]
282
+ text_output = tokenizer.decode(token_output)
283
+ print("model.generate output: ", text_output)
284
+
285
+ # Inference is also possible via Transformers' pipeline
286
+ from transformers import pipeline
287
+
288
+ pipe = pipeline(
289
+ "text-generation",
290
+ model=model,
291
+ tokenizer=tokenizer,
292
+ **generation_params
293
+ )
294
+
295
+ pipe_output = pipe(prompt_template)[0]['generated_text']
296
+ print("pipeline output: ", pipe_output)
297
+
298
+ ```
299
+ <!-- README_AWQ.md-use-from-python end -->
300
+
301
+ <!-- README_AWQ.md-compatibility start -->
302
+ ## Compatibility
303
+
304
+ The files provided are tested to work with:
305
+
306
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
307
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
308
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
309
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later.
310
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
311
+
312
+ <!-- README_AWQ.md-compatibility end -->
313
+
314
+ <!-- footer start -->
315
+ <!-- 200823 -->
316
+ ## Discord
317
+
318
+ For further support, and discussions on these models and AI in general, join us at:
319
+
320
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
321
+
322
+ ## Thanks, and how to contribute
323
+
324
+ Thanks to the [chirper.ai](https://chirper.ai) team!
325
+
326
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
327
+
328
+ 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.
329
+
330
+ 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.
331
+
332
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
333
+
334
+ * Patreon: https://patreon.com/TheBlokeAI
335
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
336
+
337
+ **Special thanks to**: Aemon Algiz.
338
+
339
+ **Patreon special mentions**: Michael Levine, 阿明, Trailburnt, Nikolai Manek, John Detwiler, Randy H, Will Dee, Sebastain Graf, NimbleBox.ai, Eugene Pentland, Emad Mostaque, Ai Maven, Jim Angel, Jeff Scroggin, Michael Davis, Manuel Alberto Morcote, Stephen Murray, Robert, Justin Joy, Luke @flexchar, Brandon Frisco, Elijah Stavena, S_X, Dan Guido, Undi ., Komninos Chatzipapas, Shadi, theTransient, Lone Striker, Raven Klaugh, jjj, Cap'n Zoog, Michel-Marie MAUDET (LINAGORA), Matthew Berman, David, Fen Risland, Omer Bin Jawed, Luke Pendergrass, Kalila, OG, Erik Bjäreholt, Rooh Singh, Joseph William Delisle, Dan Lewis, TL, John Villwock, AzureBlack, Brad, Pedro Madruga, Caitlyn Gatomon, K, jinyuan sun, Mano Prime, Alex, Jeffrey Morgan, Alicia Loh, Illia Dulskyi, Chadd, transmissions 11, fincy, Rainer Wilmers, ReadyPlayerEmma, knownsqashed, Mandus, biorpg, Deo Leter, Brandon Phillips, SuperWojo, Sean Connelly, Iucharbius, Jack West, Harry Royden McLaughlin, Nicholas, terasurfer, Vitor Caleffi, Duane Dunston, Johann-Peter Hartmann, David Ziegler, Olakabola, Ken Nordquist, Trenton Dambrowitz, Tom X Nguyen, Vadim, Ajan Kanaga, Leonard Tan, Clay Pascal, Alexandros Triantafyllidis, JM33133, Xule, vamX, ya boyyy, subjectnull, Talal Aujan, Alps Aficionado, wassieverse, Ari Malik, James Bentley, Woland, Spencer Kim, Michael Dempsey, Fred von Graf, Elle, zynix, William Richards, Stanislav Ovsiannikov, Edmond Seymore, Jonathan Leane, Martin Kemka, usrbinkat, Enrico Ros
340
+
341
+
342
+ Thank you to all my generous patrons and donaters!
343
+
344
+ And thank you again to a16z for their generous grant.
345
+
346
+ <!-- footer end -->
347
+
348
+ # Original model card: OpenChat's Openchat 3.5 0106
349
+
350
+ <div align="center">
351
+ <img src="https://raw.githubusercontent.com/imoneoi/openchat/master/assets/logo_new.png" style="width: 65%">
352
+ <h1>Advancing Open-source Language Models with Mixed-Quality Data</h1>
353
+ </div>
354
+
355
+ <p align="center" style="margin-top: 0px;">
356
+ <a href="https://openchat.team">
357
+ <img src="https://github.com/alpayariyak/openchat/blob/master/assets/logo_nobg.png?raw=true" alt="OpenChat Logo" style="width:20px; vertical-align: middle; display: inline-block; margin-right: 5px; margin-left: 10px; margin-top: 0px; margin-bottom: 0px;"/>
358
+ <span class="link-text" style=" margin-right: 5px;">Online Demo</span>
359
+ </a> |
360
+ <a href="https://github.com/imoneoi/openchat">
361
+ <img src="https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png" alt="GitHub Logo" style="width:20px; vertical-align: middle; display: inline-block; margin-right: 5px; margin-left: 5px; margin-top: 0px; margin-bottom: 0px;"/>
362
+ <span class="link-text" style=" margin-right: 5px;">GitHub</span>
363
+ </a> |
364
+ <a href="https://arxiv.org/pdf/2309.11235.pdf">
365
+ <img src="https://github.com/alpayariyak/openchat/blob/master/assets/arxiv-logomark-small-square-border.png?raw=true" alt="ArXiv Logo" style="width:20px; vertical-align: middle; display: inline-block; margin-right: 5px; margin-left: 5px; margin-top: 0px; margin-bottom: 0px;"/>
366
+ <span class="link-text" style="margin-right: 5px;">Paper</span>
367
+ </a> |
368
+ <a href="https://discord.gg/pQjnXvNKHY">
369
+ <img src="https://cloud.githubusercontent.com/assets/6291467/26705903/96c2d66e-477c-11e7-9f4e-f3c0efe96c9a.png" alt="Discord Logo" style="width:20px; vertical-align: middle; display: inline-block; margin-right: 5px; margin-left: 5px; margin-top: 0px; margin-bottom: 0px;"/>
370
+ <span class="link-text">Discord</span>
371
+ </a>
372
+ </p>
373
+
374
+ <p align="center" style="margin-top: 0px;">
375
+ <span class="link-text" style=" margin-right: 0px; font-size: 0.8em">Sponsored by RunPod</span>
376
+ <img src="https://styles.redditmedia.com/t5_6075m3/styles/profileIcon_71syco7c5lt81.png?width=256&height=256&frame=1&auto=webp&crop=256:256,smart&s=24bd3c71dc11edc5d4f88d0cbc1da72ed7ae1969" alt="RunPod Logo" style="width:30px; vertical-align: middle; display: inline-block; margin-right: 5px; margin-left: 5px; margin-top: 0px; margin-bottom: 0px;"/>
377
+ </p>
378
+
379
+ <div style="background-color: white; padding: 0.7em; border-radius: 0.5em; color: black; display: flex; flex-direction: column; justify-content: center; text-align: center; ont-size: 0.5em; border: 0.8em solid #864AF9;">
380
+ <a href="https://huggingface.co/openchat/openchat-3.5-0106" style="text-decoration: none; color: black;">
381
+ <span style="font-size: 1.7em; font-family: 'Helvetica'; letter-spacing: 0.1em; font-weight: bold; color: black;">OPENCHAT</span><span style="font-size: 1.8em; font-family: 'Helvetica'; color: #3c72db; ">3.5</span>
382
+ <span style="font-size: 1.0em; font-family: 'Helvetica'; color: white; background-color: #864AF9; vertical-align: top; border-radius: 6em; padding: 0.066em 0.4em; letter-spacing: 0.1em; font-weight: bold;">0106</span>
383
+ <span style="font-size: 0.85em; font-family: 'Helvetica'; color: black;">
384
+ <br> 🏆 The Overall Best Performing Open Source 7B Model 🏆
385
+ <br> 🤖 Outperforms <span style="font-weight: bold;">ChatGPT</span> (March) and <span style="font-weight: bold;">Grok-1</span> 🤖
386
+ <br> 🚀<span style="font-size: 1em; font-family: 'Helvetica'; color: black; font-weight: bold;">15</span>-point improvement in Coding over <span style="font-size: 0.9em;
387
+ font-family: 'Helvetica'; color: black; font-weight: bold;">OpenChat-3.5🚀</span>
388
+ <br><br><span style="font-size: 1em; font-family: 'Helvetica'; color: #3c72db; font-weight: bold;">New Features</span>
389
+ <br> 💡 2 Modes: Coding + Generalist, Mathematical Reasoning 💡
390
+ <br> 🧑‍⚖️ Experimental support for Evaluator and Feedback capabilities 🧑‍⚖️
391
+ </span>
392
+ </a>
393
+ </div>
394
+
395
+ <div style="display: flex; justify-content: center; align-items: center">
396
+ <img src="https://raw.githubusercontent.com/imoneoi/openchat/master/assets/openchat-bench-0106.png" style="width: 100%; border-radius: 1em">
397
+ </div>
398
+
399
+
400
+ <div>
401
+ <h3> Table of Contents</h3>
402
+ </div>
403
+
404
+ 1. [Usage](#usage)
405
+ 2. [Benchmarks](#benchmarks)
406
+ 3. [Limitations](#limitations)
407
+ 4. [License](#license)
408
+ 6. [Citation](#citation)
409
+ 7. [Acknowledgements](#acknowledgements)
410
+
411
+
412
+ <div align="center">
413
+ <h2> Usage </h2>
414
+ </div>
415
+
416
+ To use this model, we highly recommend installing the OpenChat package by following the [installation guide](https://github.com/imoneoi/openchat#installation) in our repository 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 consumer GPU with 24GB RAM. To enable tensor parallelism, append `--tensor-parallel-size N` to the serving command.
417
+
418
+ Once 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). Please refer to the example request below for reference. Additionally, you can use the [OpenChat Web UI](https://github.com/imoneoi/openchat#web-ui) for a user-friendly experience.
419
+
420
+ If you want to deploy the server as an online service, you can 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. For security purposes, we recommend using an [HTTPS gateway](https://fastapi.tiangolo.com/es/deployment/concepts/#security-https) in front of the server.
421
+
422
+ | Model | Size | Context | Weights | Serving |
423
+ |-------------------|------|---------|------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
424
+ | OpenChat-3.5-0106 | 7B | 8192 | [Huggingface](https://huggingface.co/openchat/openchat-3.5-0106) | `python -m ochat.serving.openai_api_server --model openchat/openchat-3.5-0106 --engine-use-ray --worker-use-ray` |
425
+
426
+ <details>
427
+ <summary>Example request (click to expand)</summary>
428
+
429
+ 💡 **Default Mode (GPT4 Correct)**: Best for coding, chat and general tasks
430
+
431
+ ```bash
432
+ curl http://localhost:18888/v1/chat/completions \
433
+ -H "Content-Type: application/json" \
434
+ -d '{
435
+ "model": "openchat_3.5",
436
+ "messages": [{"role": "user", "content": "You are a large language model named OpenChat. Write a poem to describe yourself"}]
437
+ }'
438
+ ```
439
+
440
+ 🧮 **Mathematical Reasoning Mode**: Tailored for solving math problems
441
+
442
+ ```bash
443
+ curl http://localhost:18888/v1/chat/completions \
444
+ -H "Content-Type: application/json" \
445
+ -d '{
446
+ "model": "openchat_3.5",
447
+ "condition": "Math Correct",
448
+ "messages": [{"role": "user", "content": "10.3 − 7988.8133 = "}]
449
+ }'
450
+ ```
451
+
452
+ </details>
453
+
454
+ ### Conversation templates
455
+
456
+ 💡 **Default Mode (GPT4 Correct)**: Best for coding, chat and general tasks
457
+
458
+ ```
459
+ GPT4 Correct User: Hello<|end_of_turn|>GPT4 Correct Assistant: Hi<|end_of_turn|>GPT4 Correct User: How are you today?<|end_of_turn|>GPT4 Correct Assistant:
460
+ ```
461
+
462
+ 🧮 **Mathematical Reasoning Mode**: Tailored for solving math problems
463
+
464
+ ```
465
+ Math Correct User: 10.3 − 7988.8133=<|end_of_turn|>Math Correct Assistant:
466
+ ```
467
+
468
+ ⚠️ **Notice:** Remember to set `<|end_of_turn|>` as end of generation token.
469
+
470
+ The default (GPT4 Correct) template is also available as the integrated `tokenizer.chat_template`,
471
+ which can be used instead of manually specifying the template:
472
+
473
+ ```python
474
+ messages = [
475
+ {"role": "user", "content": "Hello"},
476
+ {"role": "assistant", "content": "Hi"},
477
+ {"role": "user", "content": "How are you today?"}
478
+ ]
479
+ tokens = tokenizer.apply_chat_template(messages, add_generation_prompt=True)
480
+ assert tokens == [1, 420, 6316, 28781, 3198, 3123, 1247, 28747, 22557, 32000, 420, 6316, 28781, 3198, 3123, 21631, 28747, 15359, 32000, 420, 6316, 28781, 3198, 3123, 1247, 28747, 1602, 460, 368, 3154, 28804, 32000, 420, 6316, 28781, 3198, 3123, 21631, 28747]
481
+ ```
482
+
483
+ <div align="center">
484
+ <h2> (Experimental) Evaluator / Feedback Capabilities </h2>
485
+ </div>
486
+
487
+ We've included evaluator capabilities in this release to advance open-source models as evaluators. You can use `Default Mode (GPT4 Correct)` with the following prompt (same as [Prometheus](https://huggingface.co/datasets/kaist-ai/Feedback-Collection)) to evaluate a response.
488
+
489
+ ```
490
+ ###Task Description:
491
+ An instruction (might include an Input inside it), a response to evaluate, a reference answer that gets a score of 5, and a score rubric representing a evaluation criteria are given.
492
+ 1. Write a detailed feedback that assess the quality of the response strictly based on the given score rubric, not evaluating in general.
493
+ 2. After writing a feedback, write a score that is an integer between 1 and 5. You should refer to the score rubric.
494
+ 3. The output format should look as follows: "Feedback: (write a feedback for criteria) [RESULT] (an integer number between 1 and 5)"
495
+ 4. Please do not generate any other opening, closing, and explanations.
496
+
497
+ ###The instruction to evaluate:
498
+ {orig_instruction}
499
+
500
+ ###Response to evaluate:
501
+ {orig_response}
502
+
503
+ ###Reference Answer (Score 5):
504
+ {orig_reference_answer}
505
+
506
+ ###Score Rubrics:
507
+ [{orig_criteria}]
508
+ Score 1: {orig_score1_description}
509
+ Score 2: {orig_score2_description}
510
+ Score 3: {orig_score3_description}
511
+ Score 4: {orig_score4_description}
512
+ Score 5: {orig_score5_description}
513
+
514
+ ###Feedback:
515
+ ```
516
+ <div align="center">
517
+ <h2> Benchmarks </h2>
518
+ </div>
519
+
520
+ | Model | # Params | Average | MT-Bench | HumanEval | BBH MC | AGIEval | TruthfulQA | MMLU | GSM8K | BBH CoT |
521
+ |-----------------------|----------|----------|----------|-----------|----------|----------|------------|----------|----------|----------|
522
+ | **OpenChat-3.5-0106** | **7B** | **64.5** | 7.8 | **71.3** | **51.5** | **49.1** | 61.0 | 65.8 | **77.4** | 62.2 |
523
+ | OpenChat-3.5-1210 | **7B** | 63.8 | 7.76 | 68.9 | 49.5 | 48.0 | **61.8** | 65.3 | 77.3 | 61.8 |
524
+ | OpenChat-3.5 | **7B** | 61.6 | 7.81 | 55.5 | 47.6 | 47.4 | 59.1 | 64.3 | 77.3 | 63.5 |
525
+ | ChatGPT (March)* | ???B | 61.5 | **7.94** | 48.1 | 47.6 | 47.1 | 57.7 | **67.3** | 74.9 | **70.1** |
526
+ | | | | | | | | | | | |
527
+ | OpenHermes 2.5 | 7B | 59.3 | 7.54 | 48.2 | 49.4 | 46.5 | 57.5 | 63.8 | 73.5 | 59.9 |
528
+ | OpenOrca Mistral | 7B | 52.7 | 6.86 | 38.4 | 49.4 | 42.9 | 45.9 | 59.3 | 59.1 | 58.1 |
529
+ | Zephyr-β^ | 7B | 34.6 | 7.34 | 22.0 | 40.6 | 39.0 | 40.8 | 39.8 | 5.1 | 16.0 |
530
+ | Mistral | 7B | - | 6.84 | 30.5 | 39.0 | 38.0 | - | 60.1 | 52.2 | - |
531
+
532
+ <details>
533
+ <summary>Evaluation Details(click to expand)</summary>
534
+
535
+ *: ChatGPT (March) results are from [GPT-4 Technical Report](https://arxiv.org/abs/2303.08774), [Chain-of-Thought Hub](https://github.com/FranxYao/chain-of-thought-hub), and our evaluation. Please note that ChatGPT is not a fixed baseline and evolves rapidly over time.
536
+
537
+ ^: Zephyr-β often fails to follow few-shot CoT instructions, likely because it was aligned with only chat data but not trained on few-shot data.
538
+
539
+ **: Mistral and Open-source SOTA results are taken from reported results in instruction-tuned model papers and official repositories.
540
+
541
+ All models are evaluated in chat mode (e.g. with the respective conversation template applied). All zero-shot benchmarks follow the same setting as in the AGIEval paper and Orca paper. CoT tasks use the same configuration as Chain-of-Thought Hub, HumanEval is evaluated with EvalPlus, and MT-bench is run using FastChat. To reproduce our results, follow the instructions in [our repository](https://github.com/imoneoi/openchat/#benchmarks).
542
+
543
+ </details>
544
+ <div>
545
+ <h3>HumanEval+</h3>
546
+ </div>
547
+
548
+ | Model | Size | HumanEval+ pass@1 |
549
+ |-----------------------------|--------|-------------------|
550
+ | **OpenChat-3.5-0106** | **7B** | **65.9** |
551
+ | ChatGPT (December 12, 2023) | ???B | 64.6 |
552
+ | WizardCoder-Python-34B-V1.0 | 34B | 64.6 |
553
+ | OpenChat 3.5 1210 | 7B | 63.4 |
554
+ | OpenHermes 2.5 | 7B | 41.5 |
555
+
556
+ <div>
557
+ <h3>OpenChat-3.5 vs. Grok</h3>
558
+ </div>
559
+
560
+ 🔥 OpenChat-3.5-0106 (7B) now outperforms Grok-0 (33B) on **all 4 benchmarks** and Grok-1 (???B) on average and **3/4 benchmarks**.
561
+
562
+ | | License | # Param | Average | MMLU | HumanEval | MATH | GSM8k |
563
+ |-----------------------|-------------|---------|----------|--------|-----------|----------|----------|
564
+ | **OpenChat-3.5-0106** | Apache-2.0 | **7B** | **61.0** | 65.8 | **71.3** | **29.3** | **77.4** |
565
+ | OpenChat-3.5-1210 | Apache-2.0 | **7B** | 60.1 | 65.3 | 68.9 | 28.9 | 77.3 |
566
+ | OpenChat-3.5 | Apache-2.0 | **7B** | 56.4 | 64.3 | 55.5 | 28.6 | 77.3 |
567
+ | Grok-0 | Proprietary | 33B | 44.5 | 65.7 | 39.7 | 15.7 | 56.8 |
568
+ | Grok-1 | Proprietary | ???B | 55.8 | **73** | 63.2 | 23.9 | 62.9 |
569
+
570
+ *: Grok results are reported by [X.AI](https://x.ai/).
571
+
572
+ <div align="center">
573
+ <h2> Limitations </h2>
574
+ </div>
575
+
576
+ **Foundation Model Limitations**
577
+ 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:
578
+
579
+ - Complex reasoning
580
+ - Mathematical and arithmetic tasks
581
+ - Programming and coding challenges
582
+
583
+ **Hallucination of Non-existent Information**
584
+ 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.
585
+
586
+ **Safety**
587
+ OpenChat may sometimes generate harmful, hate speech, biased responses, or answer unsafe questions. It's crucial to apply additional AI safety measures in use cases that require safe and moderated responses.
588
+
589
+ <div align="center">
590
+ <h2> License </h2>
591
+ </div>
592
+
593
+ Our OpenChat 3.5 code and models are distributed under the Apache License 2.0.
594
+
595
+ <div align="center">
596
+ <h2> Citation </h2>
597
+ </div>
598
+
599
+ ```
600
+ @article{wang2023openchat,
601
+ title={OpenChat: Advancing Open-source Language Models with Mixed-Quality Data},
602
+ author={Wang, Guan and Cheng, Sijie and Zhan, Xianyuan and Li, Xiangang and Song, Sen and Liu, Yang},
603
+ journal={arXiv preprint arXiv:2309.11235},
604
+ year={2023}
605
+ }
606
+ ```
607
+
608
+ <div align="center">
609
+ <h2> 💌 Main Contributor </h2>
610
+ </div>
611
+
612
+ * Wang Guan [imonenext@gmail.com], Cheng Sijie [csj23@mails.tsinghua.edu.cn], Alpay Ariyak [aariyak@wpi.edu]
613
+ * We look forward to hearing you and collaborating on this exciting project!