TheBloke commited on
Commit
8e88ab4
1 Parent(s): 6025435

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +652 -0
README.md ADDED
@@ -0,0 +1,652 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: openchat/openchat-3.5-1210
3
+ datasets:
4
+ - openchat/openchat_sharegpt4_dataset
5
+ - kaist-ai/Feedback-Collection
6
+ - imone/OpenOrca_FLAN
7
+ - LDJnr/LessWrong-Amplify-Instruct
8
+ - LDJnr/Pure-Dove
9
+ - LDJnr/Verified-Camel
10
+ - tiedong/goat
11
+ - glaiveai/glaive-code-assistant
12
+ - meta-math/MetaMathQA
13
+ - OpenAssistant/oasst_top1_2023-08-25
14
+ - TIGER-Lab/MathInstruct
15
+ inference: false
16
+ library_name: transformers
17
+ license: apache-2.0
18
+ model_creator: OpenChat
19
+ model_name: Openchat 3.5 1210
20
+ model_type: mistral
21
+ pipeline_tag: text-generation
22
+ prompt_template: 'GPT4 User: {prompt}<|end_of_turn|>GPT4 Assistant:
23
+
24
+ '
25
+ quantized_by: TheBloke
26
+ tags:
27
+ - openchat
28
+ - mistral
29
+ - C-RLFT
30
+ ---
31
+ <!-- markdownlint-disable MD041 -->
32
+
33
+ <!-- header start -->
34
+ <!-- 200823 -->
35
+ <div style="width: auto; margin-left: auto; margin-right: auto">
36
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
37
+ </div>
38
+ <div style="display: flex; justify-content: space-between; width: 100%;">
39
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
40
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
41
+ </div>
42
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
43
+ <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>
44
+ </div>
45
+ </div>
46
+ <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>
47
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
48
+ <!-- header end -->
49
+
50
+ # Openchat 3.5 1210 - AWQ
51
+ - Model creator: [OpenChat](https://huggingface.co/openchat)
52
+ - Original model: [Openchat 3.5 1210](https://huggingface.co/openchat/openchat-3.5-1210)
53
+
54
+ <!-- description start -->
55
+ ## Description
56
+
57
+ This repo contains AWQ model files for [OpenChat's Openchat 3.5 1210](https://huggingface.co/openchat/openchat-3.5-1210).
58
+
59
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
60
+
61
+
62
+ ### About AWQ
63
+
64
+ 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.
65
+
66
+ AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
67
+
68
+ It is supported by:
69
+
70
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
71
+ - [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
72
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
73
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
74
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
75
+
76
+ <!-- description end -->
77
+ <!-- repositories-available start -->
78
+ ## Repositories available
79
+
80
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/openchat-3.5-1210-AWQ)
81
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/openchat-3.5-1210-GPTQ)
82
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/openchat-3.5-1210-GGUF)
83
+ * [OpenChat's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/openchat/openchat-3.5-1210)
84
+ <!-- repositories-available end -->
85
+
86
+ <!-- prompt-template start -->
87
+ ## Prompt template: OpenChat
88
+
89
+ ```
90
+ GPT4 User: {prompt}<|end_of_turn|>GPT4 Assistant:
91
+
92
+ ```
93
+
94
+ <!-- prompt-template end -->
95
+
96
+
97
+ <!-- README_AWQ.md-provided-files start -->
98
+ ## Provided files, and AWQ parameters
99
+
100
+ I currently release 128g GEMM models only. The addition of group_size 32 models, and GEMV kernel models, is being actively considered.
101
+
102
+ Models are released as sharded safetensors files.
103
+
104
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
105
+ | ------ | ---- | -- | ----------- | ------- | ---- |
106
+ | [main](https://huggingface.co/TheBloke/openchat-3.5-1210-AWQ/tree/main) | 4 | 128 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 4.15 GB
107
+
108
+ <!-- README_AWQ.md-provided-files end -->
109
+
110
+ <!-- README_AWQ.md-text-generation-webui start -->
111
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
112
+
113
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
114
+
115
+ 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.
116
+
117
+ 1. Click the **Model tab**.
118
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/openchat-3.5-1210-AWQ`.
119
+ 3. Click **Download**.
120
+ 4. The model will start downloading. Once it's finished it will say "Done".
121
+ 5. In the top left, click the refresh icon next to **Model**.
122
+ 6. In the **Model** dropdown, choose the model you just downloaded: `openchat-3.5-1210-AWQ`
123
+ 7. Select **Loader: AutoAWQ**.
124
+ 8. Click Load, and the model will load and is now ready for use.
125
+ 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.
126
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
127
+ <!-- README_AWQ.md-text-generation-webui end -->
128
+
129
+ <!-- README_AWQ.md-use-from-vllm start -->
130
+ ## Multi-user inference server: vLLM
131
+
132
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
133
+
134
+ - Please ensure you are using vLLM version 0.2 or later.
135
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
136
+
137
+ For example:
138
+
139
+ ```shell
140
+ python3 -m vllm.entrypoints.api_server --model TheBloke/openchat-3.5-1210-AWQ --quantization awq --dtype auto
141
+ ```
142
+
143
+ - When using vLLM from Python code, again set `quantization=awq`.
144
+
145
+ For example:
146
+
147
+ ```python
148
+ from vllm import LLM, SamplingParams
149
+
150
+ prompts = [
151
+ "Tell me about AI",
152
+ "Write a story about llamas",
153
+ "What is 291 - 150?",
154
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
155
+ ]
156
+ prompt_template=f'''GPT4 User: {prompt}<|end_of_turn|>GPT4 Assistant:
157
+ '''
158
+
159
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
160
+
161
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
162
+
163
+ llm = LLM(model="TheBloke/openchat-3.5-1210-AWQ", quantization="awq", dtype="auto")
164
+
165
+ outputs = llm.generate(prompts, sampling_params)
166
+
167
+ # Print the outputs.
168
+ for output in outputs:
169
+ prompt = output.prompt
170
+ generated_text = output.outputs[0].text
171
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
172
+ ```
173
+ <!-- README_AWQ.md-use-from-vllm start -->
174
+
175
+ <!-- README_AWQ.md-use-from-tgi start -->
176
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
177
+
178
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
179
+
180
+ Example Docker parameters:
181
+
182
+ ```shell
183
+ --model-id TheBloke/openchat-3.5-1210-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
184
+ ```
185
+
186
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
187
+
188
+ ```shell
189
+ pip3 install huggingface-hub
190
+ ```
191
+
192
+ ```python
193
+ from huggingface_hub import InferenceClient
194
+
195
+ endpoint_url = "https://your-endpoint-url-here"
196
+
197
+ prompt = "Tell me about AI"
198
+ prompt_template=f'''GPT4 User: {prompt}<|end_of_turn|>GPT4 Assistant:
199
+ '''
200
+
201
+ client = InferenceClient(endpoint_url)
202
+ response = client.text_generation(prompt,
203
+ max_new_tokens=128,
204
+ do_sample=True,
205
+ temperature=0.7,
206
+ top_p=0.95,
207
+ top_k=40,
208
+ repetition_penalty=1.1)
209
+
210
+ print(f"Model output: ", response)
211
+ ```
212
+ <!-- README_AWQ.md-use-from-tgi end -->
213
+
214
+ <!-- README_AWQ.md-use-from-python start -->
215
+ ## Inference from Python code using Transformers
216
+
217
+ ### Install the necessary packages
218
+
219
+ - Requires: [Transformers](https://huggingface.co/docs/transformers) 4.35.0 or later.
220
+ - Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.6 or later.
221
+
222
+ ```shell
223
+ pip3 install --upgrade "autoawq>=0.1.6" "transformers>=4.35.0"
224
+ ```
225
+
226
+ Note that if you are using PyTorch 2.0.1, the above AutoAWQ command will automatically upgrade you to PyTorch 2.1.0.
227
+
228
+ If you are using CUDA 11.8 and wish to continue using PyTorch 2.0.1, instead run this command:
229
+
230
+ ```shell
231
+ pip3 install https://github.com/casper-hansen/AutoAWQ/releases/download/v0.1.6/autoawq-0.1.6+cu118-cp310-cp310-linux_x86_64.whl
232
+ ```
233
+
234
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
235
+
236
+ ```shell
237
+ pip3 uninstall -y autoawq
238
+ git clone https://github.com/casper-hansen/AutoAWQ
239
+ cd AutoAWQ
240
+ pip3 install .
241
+ ```
242
+
243
+ ### Transformers example code (requires Transformers 4.35.0 and later)
244
+
245
+ ```python
246
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
247
+
248
+ model_name_or_path = "TheBloke/openchat-3.5-1210-AWQ"
249
+
250
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
251
+ model = AutoModelForCausalLM.from_pretrained(
252
+ model_name_or_path,
253
+ low_cpu_mem_usage=True,
254
+ device_map="cuda:0"
255
+ )
256
+
257
+ # Using the text streamer to stream output one token at a time
258
+ streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
259
+
260
+ prompt = "Tell me about AI"
261
+ prompt_template=f'''GPT4 User: {prompt}<|end_of_turn|>GPT4 Assistant:
262
+ '''
263
+
264
+ # Convert prompt to tokens
265
+ tokens = tokenizer(
266
+ prompt_template,
267
+ return_tensors='pt'
268
+ ).input_ids.cuda()
269
+
270
+ generation_params = {
271
+ "do_sample": True,
272
+ "temperature": 0.7,
273
+ "top_p": 0.95,
274
+ "top_k": 40,
275
+ "max_new_tokens": 512,
276
+ "repetition_penalty": 1.1
277
+ }
278
+
279
+ # Generate streamed output, visible one token at a time
280
+ generation_output = model.generate(
281
+ tokens,
282
+ streamer=streamer,
283
+ **generation_params
284
+ )
285
+
286
+ # Generation without a streamer, which will include the prompt in the output
287
+ generation_output = model.generate(
288
+ tokens,
289
+ **generation_params
290
+ )
291
+
292
+ # Get the tokens from the output, decode them, print them
293
+ token_output = generation_output[0]
294
+ text_output = tokenizer.decode(token_output)
295
+ print("model.generate output: ", text_output)
296
+
297
+ # Inference is also possible via Transformers' pipeline
298
+ from transformers import pipeline
299
+
300
+ pipe = pipeline(
301
+ "text-generation",
302
+ model=model,
303
+ tokenizer=tokenizer,
304
+ **generation_params
305
+ )
306
+
307
+ pipe_output = pipe(prompt_template)[0]['generated_text']
308
+ print("pipeline output: ", pipe_output)
309
+
310
+ ```
311
+ <!-- README_AWQ.md-use-from-python end -->
312
+
313
+ <!-- README_AWQ.md-compatibility start -->
314
+ ## Compatibility
315
+
316
+ The files provided are tested to work with:
317
+
318
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
319
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
320
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
321
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later.
322
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
323
+
324
+ <!-- README_AWQ.md-compatibility end -->
325
+
326
+ <!-- footer start -->
327
+ <!-- 200823 -->
328
+ ## Discord
329
+
330
+ For further support, and discussions on these models and AI in general, join us at:
331
+
332
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
333
+
334
+ ## Thanks, and how to contribute
335
+
336
+ Thanks to the [chirper.ai](https://chirper.ai) team!
337
+
338
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
339
+
340
+ 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.
341
+
342
+ 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.
343
+
344
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
345
+
346
+ * Patreon: https://patreon.com/TheBlokeAI
347
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
348
+
349
+ **Special thanks to**: Aemon Algiz.
350
+
351
+ **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
352
+
353
+
354
+ Thank you to all my generous patrons and donaters!
355
+
356
+ And thank you again to a16z for their generous grant.
357
+
358
+ <!-- footer end -->
359
+
360
+ # Original model card: OpenChat's Openchat 3.5 1210
361
+
362
+ <div align="center">
363
+ <img src="https://raw.githubusercontent.com/imoneoi/openchat/master/assets/logo_new.png" style="width: 65%">
364
+ <h1>Advancing Open-source Language Models with Mixed-Quality Data</h1>
365
+ </div>
366
+
367
+ <p align="center" style="margin-top: 0px;">
368
+ <a href="https://openchat.team">
369
+ <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;"/>
370
+ <span class="link-text" style=" margin-right: 5px;">Online Demo</span>
371
+ </a> |
372
+ <a href="https://github.com/imoneoi/openchat">
373
+ <img src="https://camo.githubusercontent.com/4133dc1cd4511d4a292b84ce10e52e4ed92569fb2a8165381c9c47be5edc2796/68747470733a2f2f6564656e742e6769746875622e696f2f537570657254696e7949636f6e732f696d616765732f706e672f6769746875622e706e67" alt="GitHub Logo" style="width:20px; vertical-align: middle; display: inline-block; margin-right: 5px; margin-left: 5px; margin-top: 0px; margin-bottom: 0px;"/>
374
+ <span class="link-text" style=" margin-right: 5px;">GitHub</span>
375
+ </a> |
376
+ <a href="https://arxiv.org/pdf/2309.11235.pdf">
377
+ <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;"/>
378
+ <span class="link-text" style="margin-right: 5px;">Paper</span>
379
+ </a> |
380
+ <a href="https://discord.gg/pQjnXvNKHY">
381
+ <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;"/>
382
+ <span class="link-text">Discord</span>
383
+ </a>
384
+ </p>
385
+
386
+ <hr>
387
+ <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;">
388
+ <a href="https://huggingface.co/openchat/openchat_3.5" style="text-decoration: none; color: black;">
389
+ <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>
390
+ <span style="font-size: 0.7em; font-family: 'Helvetica'; color: white; vertical-align: top; background-color:red; border-radius: 6em; padding: 0.066em 0.4em; letter-spacing: 0.1em; font-weight: bold;">1210</span>
391
+ <span style="font-size: 0.85em; font-family: 'Helvetica'; color: black;">
392
+ <br> 🏆 The Overall Best Performing Open Source 7B Model 🏆
393
+ <br> 🤖 Outperforms <span style="font-weight: bold;">ChatGPT</span> (March) and <span style="font-weight: bold;">Grok-1</span> 🤖
394
+ <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;
395
+ font-family: 'Helvetica'; color: black; font-weight: bold;">OpenChat-3.5🚀</span>
396
+ <br><br><span style="font-size: 1em; font-family: 'Helvetica'; color: #3c72db; font-weight: bold;">New Features</span>
397
+ <br> 💡 2 Modes: Coding + Generalist, Mathematical Reasoning 💡
398
+ <br> 🧑‍⚖️ Experimental support for Evaluator and Feedback capabilities 🧑‍⚖️
399
+ </span>
400
+ </a>
401
+ </div>
402
+
403
+ <div style="display: flex; justify-content: center; align-items: center">
404
+ <img src="https://github.com/alpayariyak/openchat/blob/master/assets/1210bench.png?raw=true" style="width: 100%; border-radius: 1em">
405
+ </div>
406
+
407
+ <div>
408
+ <h3> Table of Contents</h3>
409
+ </div>
410
+
411
+ 1. [Usage](#usage)
412
+ 2. [Benchmarks](#benchmarks)
413
+ 3. [Limitations](#limitations)
414
+ 4. [License](#license)
415
+ 5. [Dataset Details](#dataset-details)
416
+ 6. [Citation](#citation)
417
+ 7. [Acknowledgements](#acknowledgements)
418
+
419
+
420
+ <div align="center">
421
+ <h2> Usage </h2>
422
+ </div>
423
+
424
+ 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.
425
+
426
+ 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.
427
+
428
+ 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.
429
+
430
+ | Model | Size | Context | Weights | Serving |
431
+ |-------------------|------|---------|------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
432
+ | OpenChat 3.5 1210 | 7B | 8192 | [Huggingface](https://huggingface.co/openchat/openchat_3.5_1210) | `python -m ochat.serving.openai_api_server --model openchat/openchat_3.5_1210 --engine-use-ray --worker-use-ray` |
433
+
434
+ <details>
435
+ <summary>Example request (click to expand)</summary>
436
+
437
+ 💡 **Default Mode (GPT4 Correct)**: Best for coding, chat and general tasks
438
+
439
+ ```bash
440
+ curl http://localhost:18888/v1/chat/completions \
441
+ -H "Content-Type: application/json" \
442
+ -d '{
443
+ "model": "openchat_3.5",
444
+ "messages": [{"role": "user", "content": "You are a large language model named OpenChat. Write a poem to describe yourself"}]
445
+ }'
446
+ ```
447
+
448
+ 🧮 **Mathematical Reasoning Mode**: Tailored for solving math problems
449
+
450
+ ```bash
451
+ curl http://localhost:18888/v1/chat/completions \
452
+ -H "Content-Type: application/json" \
453
+ -d '{
454
+ "model": "openchat_3.5",
455
+ "condition": "Math Correct",
456
+ "messages": [{"role": "user", "content": "10.3 − 7988.8133 = "}]
457
+ }'
458
+ ```
459
+
460
+ </details>
461
+
462
+ ### Conversation templates
463
+
464
+ 💡 **Default Mode (GPT4 Correct)**: Best for coding, chat and general tasks
465
+
466
+ ```
467
+ 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:
468
+ ```
469
+
470
+ 🧮 **Mathematical Reasoning Mode**: Tailored for solving math problems
471
+
472
+ ```
473
+ Math Correct User: 10.3 − 7988.8133=<|end_of_turn|>Math Correct Assistant:
474
+ ```
475
+
476
+ ⚠️ **Notice:** Remember to set `<|end_of_turn|>` as end of generation token.
477
+
478
+ The default (GPT4 Correct) template is also available as the integrated `tokenizer.chat_template`,
479
+ which can be used instead of manually specifying the template:
480
+
481
+ ```python
482
+ messages = [
483
+ {"role": "user", "content": "Hello"},
484
+ {"role": "assistant", "content": "Hi"},
485
+ {"role": "user", "content": "How are you today?"}
486
+ ]
487
+ tokens = tokenizer.apply_chat_template(messages, add_generation_prompt=True)
488
+ 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]
489
+ ```
490
+
491
+ <div align="center">
492
+ <h2> (Experimental) Evaluator / Feedback Capabilities </h2>
493
+ </div>
494
+ 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.
495
+
496
+ ```
497
+ ###Task Description:
498
+ 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.
499
+ 1. Write a detailed feedback that assess the quality of the response strictly based on the given score rubric, not evaluating in general.
500
+ 2. After writing a feedback, write a score that is an integer between 1 and 5. You should refer to the score rubric.
501
+ 3. The output format should look as follows: "Feedback: (write a feedback for criteria) [RESULT] (an integer number between 1 and 5)"
502
+ 4. Please do not generate any other opening, closing, and explanations.
503
+
504
+ ###The instruction to evaluate:
505
+ {orig_instruction}
506
+
507
+ ###Response to evaluate:
508
+ {orig_response}
509
+
510
+ ###Reference Answer (Score 5):
511
+ {orig_reference_answer}
512
+
513
+ ###Score Rubrics:
514
+ [{orig_criteria}]
515
+ Score 1: {orig_score1_description}
516
+ Score 2: {orig_score2_description}
517
+ Score 3: {orig_score3_description}
518
+ Score 4: {orig_score4_description}
519
+ Score 5: {orig_score5_description}
520
+
521
+ ###Feedback:
522
+ ```
523
+ <div align="center">
524
+ <h2> Benchmarks </h2>
525
+ </div>
526
+
527
+ | Model | # Params | Average | MT-Bench | HumanEval | BBH MC | AGIEval | TruthfulQA | MMLU | GSM8K | BBH CoT |
528
+ |--------------------|----------|----------|--------------|-----------------|----------|----------|---------------|--------------|--------------|-------------|
529
+ | OpenChat-3.5-1210 | **7B** | **63.8** | 7.76 | **68.9** | **49.5** | **48.0** | **61.8** | 65.3 | **77.3** | 61.8 |
530
+ | OpenChat-3.5 | **7B** | 61.6 | 7.81 | 55.5 | 47.6 | 47.4 | 59.1 | 64.3 | **77.3** | 63.5 |
531
+ | ChatGPT (March)* | ? | 61.5 | **7.94** | 48.1 | 47.6 | 47.1 | 57.7 | **67.3** | 74.9 | **70.1** |
532
+ | | | | | | | | | | | |
533
+ | OpenHermes 2.5 | 7B | 59.3 | 7.54 | 48.2 | 49.4 | 46.5 | 57.5 | 63.8 | 73.5 | 59.9 |
534
+ | OpenOrca Mistral | 7B | 52.7 | 6.86 | 38.4 | 49.4 | 42.9 | 45.9 | 59.3 | 59.1 | 58.1 |
535
+ | Zephyr-β^ | 7B | 34.6 | 7.34 | 22.0 | 40.6 | 39.0 | 40.8 | 39.8 | 5.1 | 16.0 |
536
+ | Mistral | 7B | - | 6.84 | 30.5 | 39.0 | 38.0 | - | 60.1 | 52.2 | - |
537
+
538
+ <details>
539
+ <summary>Evaluation Details(click to expand)</summary>
540
+ *: 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.
541
+
542
+ ^: 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.
543
+
544
+ **: Mistral and Open-source SOTA results are taken from reported results in instruction-tuned model papers and official repositories.
545
+
546
+ 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).
547
+ </details>
548
+ <div>
549
+ <h3>HumanEval+</h3>
550
+ </div>
551
+
552
+ | Model | Size | HumanEval+ pass@1 |
553
+ |-----------------------------|----------|------------|
554
+ | ChatGPT (December 12, 2023) | - | 64.6 |
555
+ | WizardCoder-Python-34B-V1.0 | 34B | 64.6 |
556
+ | **OpenChat 3.5 (Dec 10)** | **7B** | **63.4** |
557
+ | OpenHermes 2.5 | 7B | 41.5 |
558
+
559
+ <div>
560
+ <h3>OpenChat-3.5-1210 vs. Grok</h3>
561
+ </div>
562
+
563
+ | | License | # Param | Average | MMLU | HumanEval | MATH | GSM8k |
564
+ |-------------------|-------------|---------|----------|------|-----------|----------|----------|
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>
573
+ <h3>Massive Multitask Language Understanding in Chinese (CMMLU)</h3>
574
+ 5-shot:
575
+ </div>
576
+
577
+ | Models | STEM | Humanities | SocialSciences | Other | ChinaSpecific | Avg |
578
+ |----------|-------|------------|----------------|-------|---------------|-------|
579
+ | ChatGPT | 47.81 | 55.68 | 56.5 | 62.66 | 50.69 | 55.51 |
580
+ | OpenChat | 38.7 | 45.99 | 48.32 | 50.23 | 43.27 | 45.85 |
581
+
582
+ <div>
583
+ <h3>Multi-Level Multi-Discipline Chinese Evaluation Suite (CEVAL)</h3>
584
+ <div>
585
+
586
+ | Model | Avg | STEM | Social Science | Humanities | Others |
587
+ |----------|-------|-------|----------------|------------|--------|
588
+ | ChatGPT | 54.4 | 52.9 | 61.8 | 50.9 | 53.6 |
589
+ | OpenChat | 47.29 | 45.22 | 52.49 | 48.52 | 45.08 |
590
+
591
+
592
+ <div align="center">
593
+ <h2> Limitations </h2>
594
+ </div>
595
+
596
+ **Foundation Model Limitations**
597
+ 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:
598
+
599
+ - Complex reasoning
600
+ - Mathematical and arithmetic tasks
601
+ - Programming and coding challenges
602
+
603
+ **Hallucination of Non-existent Information**
604
+ 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.
605
+
606
+ **Safety**
607
+ 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.
608
+
609
+ <div align="center">
610
+ <h2> License </h2>
611
+ </div>
612
+
613
+ Our OpenChat 3.5 code and models are distributed under the Apache License 2.0.
614
+
615
+ <div align="center">
616
+ <h2> Dataset Details </h2>
617
+ </div>
618
+
619
+ OpenChat 3.5 was trained with C-RLFT on a collection of publicly available high-quality instruction data, with a custom processing pipeline. We detail some notable subsets included here:
620
+
621
+ - [OpenChat ShareGPT](https://huggingface.co/datasets/openchat/openchat_sharegpt4_dataset)
622
+ - [Open-Orca with FLAN answers](https://huggingface.co/datasets/imone/OpenOrca_FLAN)
623
+ - [Feedback-Collection](https://huggingface.co/datasets/kaist-ai/Feedback-Collection)
624
+ - Capybara [1](https://huggingface.co/datasets/LDJnr/Pure-Dove) [2](https://huggingface.co/datasets/LDJnr/Verified-Camel) [3](https://huggingface.co/datasets/LDJnr/LessWrong-Amplify-Instruct)
625
+ - [GOAT](https://huggingface.co/datasets/tiedong/goat)
626
+ - [Glaive](https://huggingface.co/datasets/glaiveai/glaive-code-assistant)
627
+ - [MetaMathQA](https://huggingface.co/datasets/meta-math/MetaMathQA)
628
+ - [MathInstruct](https://huggingface.co/datasets/TIGER-Lab/MathInstruct)
629
+ - [OpenAssistant](https://huggingface.co/datasets/OpenAssistant/oasst_top1_2023-08-25)
630
+
631
+ <div align="center">
632
+ <h2> Citation </h2>
633
+ </div>
634
+
635
+ ```
636
+ @article{wang2023openchat,
637
+ title={OpenChat: Advancing Open-source Language Models with Mixed-Quality Data},
638
+ author={Wang, Guan and Cheng, Sijie and Zhan, Xianyuan and Li, Xiangang and Song, Sen and Liu, Yang},
639
+ journal={arXiv preprint arXiv:2309.11235},
640
+ year={2023}
641
+ }
642
+ ```
643
+
644
+ <div align="center">
645
+ <h2> Acknowledgments </h2>
646
+ </div>
647
+
648
+ We extend our heartfelt gratitude to AutoMeta and caesus from Alignment Lab AI, LDJ and Teknium from Nous Research, alpin and TearGosling from Pygmalion AI for their substantial contributions to data collection and model training.
649
+
650
+ Special thanks go to Changling Liu from GPT Desk Pte. Ltd., Qiying Yu at Tsinghua University, Baochang Ma, and Hao Wan from 01.AI company for their generous provision of resources. We are also deeply grateful to Jianxiong Li and Peng Li at Tsinghua University for their insightful discussions.
651
+
652
+ Furthermore, we appreciate the developers behind the following projects for their significant contributions to our research: [Mistral](https://mistral.ai/), [Chain-of-Thought Hub](https://github.com/FranxYao/chain-of-thought-hub), [Llama 2](https://ai.meta.com/llama/), [Self-Instruct](https://arxiv.org/abs/2212.10560), [FastChat (Vicuna)](https://github.com/lm-sys/FastChat), [Alpaca](https://github.com/tatsu-lab/stanford_alpaca.git), and [StarCoder](https://github.com/bigcode-project/starcoder). Their work has been instrumental in driving our research forward.