TheBloke commited on
Commit
4d732e8
1 Parent(s): ea6f5b8

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +670 -0
README.md ADDED
@@ -0,0 +1,670 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 - GPTQ
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 GPTQ model files for [OpenChat's Openchat 3.5 1210](https://huggingface.co/openchat/openchat-3.5-1210).
58
+
59
+ Multiple GPTQ parameter permutations are provided; see Provided Files below for details of the options provided, their parameters, and the software used to create them.
60
+
61
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
62
+
63
+ <!-- description end -->
64
+ <!-- repositories-available start -->
65
+ ## Repositories available
66
+
67
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/openchat-3.5-1210-AWQ)
68
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/openchat-3.5-1210-GPTQ)
69
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/openchat-3.5-1210-GGUF)
70
+ * [OpenChat's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/openchat/openchat-3.5-1210)
71
+ <!-- repositories-available end -->
72
+
73
+ <!-- prompt-template start -->
74
+ ## Prompt template: OpenChat
75
+
76
+ ```
77
+ GPT4 User: {prompt}<|end_of_turn|>GPT4 Assistant:
78
+
79
+ ```
80
+
81
+ <!-- prompt-template end -->
82
+
83
+
84
+
85
+ <!-- README_GPTQ.md-compatible clients start -->
86
+ ## Known compatible clients / servers
87
+
88
+ GPTQ models are currently supported on Linux (NVidia/AMD) and Windows (NVidia only). macOS users: please use GGUF models.
89
+
90
+ These GPTQ models are known to work in the following inference servers/webuis.
91
+
92
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
93
+ - [KoboldAI United](https://github.com/henk717/koboldai)
94
+ - [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui)
95
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
96
+
97
+ This may not be a complete list; if you know of others, please let me know!
98
+ <!-- README_GPTQ.md-compatible clients end -->
99
+
100
+ <!-- README_GPTQ.md-provided-files start -->
101
+ ## Provided files, and GPTQ parameters
102
+
103
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
104
+
105
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
106
+
107
+ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
108
+
109
+ <details>
110
+ <summary>Explanation of GPTQ parameters</summary>
111
+
112
+ - Bits: The bit size of the quantised model.
113
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
114
+ - Act Order: True or False. Also known as `desc_act`. True results in better quantisation accuracy. Some GPTQ clients have had issues with models that use Act Order plus Group Size, but this is generally resolved now.
115
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
116
+ - GPTQ dataset: The calibration dataset used during quantisation. Using a dataset more appropriate to the model's training can improve quantisation accuracy. Note that the GPTQ calibration dataset is not the same as the dataset used to train the model - please refer to the original model repo for details of the training dataset(s).
117
+ - Sequence Length: The length of the dataset sequences used for quantisation. Ideally this is the same as the model sequence length. For some very long sequence models (16+K), a lower sequence length may have to be used. Note that a lower sequence length does not limit the sequence length of the quantised model. It only impacts the quantisation accuracy on longer inference sequences.
118
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
119
+
120
+ </details>
121
+
122
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
123
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
124
+ | [main](https://huggingface.co/TheBloke/openchat-3.5-1210-GPTQ/tree/main) | 4 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 4.16 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
125
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/openchat-3.5-1210-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 4.57 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
126
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/openchat-3.5-1210-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 7.52 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
127
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/openchat-3.5-1210-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 7.68 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
128
+ | [gptq-8bit-32g-actorder_True](https://huggingface.co/TheBloke/openchat-3.5-1210-GPTQ/tree/gptq-8bit-32g-actorder_True) | 8 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 8.17 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. |
129
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/openchat-3.5-1210-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 4.30 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
130
+
131
+ <!-- README_GPTQ.md-provided-files end -->
132
+
133
+ <!-- README_GPTQ.md-download-from-branches start -->
134
+ ## How to download, including from branches
135
+
136
+ ### In text-generation-webui
137
+
138
+ To download from the `main` branch, enter `TheBloke/openchat-3.5-1210-GPTQ` in the "Download model" box.
139
+
140
+ To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/openchat-3.5-1210-GPTQ:gptq-4bit-32g-actorder_True`
141
+
142
+ ### From the command line
143
+
144
+ I recommend using the `huggingface-hub` Python library:
145
+
146
+ ```shell
147
+ pip3 install huggingface-hub
148
+ ```
149
+
150
+ To download the `main` branch to a folder called `openchat-3.5-1210-GPTQ`:
151
+
152
+ ```shell
153
+ mkdir openchat-3.5-1210-GPTQ
154
+ huggingface-cli download TheBloke/openchat-3.5-1210-GPTQ --local-dir openchat-3.5-1210-GPTQ --local-dir-use-symlinks False
155
+ ```
156
+
157
+ To download from a different branch, add the `--revision` parameter:
158
+
159
+ ```shell
160
+ mkdir openchat-3.5-1210-GPTQ
161
+ huggingface-cli download TheBloke/openchat-3.5-1210-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir openchat-3.5-1210-GPTQ --local-dir-use-symlinks False
162
+ ```
163
+
164
+ <details>
165
+ <summary>More advanced huggingface-cli download usage</summary>
166
+
167
+ If you remove the `--local-dir-use-symlinks False` parameter, the files will instead be stored in the central Hugging Face cache directory (default location on Linux is: `~/.cache/huggingface`), and symlinks will be added to the specified `--local-dir`, pointing to their real location in the cache. This allows for interrupted downloads to be resumed, and allows you to quickly clone the repo to multiple places on disk without triggering a download again. The downside, and the reason why I don't list that as the default option, is that the files are then hidden away in a cache folder and it's harder to know where your disk space is being used, and to clear it up if/when you want to remove a download model.
168
+
169
+ The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
170
+
171
+ For more documentation on downloading with `huggingface-cli`, please see: [HF -> Hub Python Library -> Download files -> Download from the CLI](https://huggingface.co/docs/huggingface_hub/guides/download#download-from-the-cli).
172
+
173
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
174
+
175
+ ```shell
176
+ pip3 install hf_transfer
177
+ ```
178
+
179
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
180
+
181
+ ```shell
182
+ mkdir openchat-3.5-1210-GPTQ
183
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/openchat-3.5-1210-GPTQ --local-dir openchat-3.5-1210-GPTQ --local-dir-use-symlinks False
184
+ ```
185
+
186
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
187
+ </details>
188
+
189
+ ### With `git` (**not** recommended)
190
+
191
+ To clone a specific branch with `git`, use a command like this:
192
+
193
+ ```shell
194
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/openchat-3.5-1210-GPTQ
195
+ ```
196
+
197
+ Note that using Git with HF repos is strongly discouraged. It will be much slower than using `huggingface-hub`, and will use twice as much disk space as it has to store the model files twice (it stores every byte both in the intended target folder, and again in the `.git` folder as a blob.)
198
+
199
+ <!-- README_GPTQ.md-download-from-branches end -->
200
+ <!-- README_GPTQ.md-text-generation-webui start -->
201
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
202
+
203
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
204
+
205
+ 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.
206
+
207
+ 1. Click the **Model tab**.
208
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/openchat-3.5-1210-GPTQ`.
209
+
210
+ - To download from a specific branch, enter for example `TheBloke/openchat-3.5-1210-GPTQ:gptq-4bit-32g-actorder_True`
211
+ - see Provided Files above for the list of branches for each option.
212
+
213
+ 3. Click **Download**.
214
+ 4. The model will start downloading. Once it's finished it will say "Done".
215
+ 5. In the top left, click the refresh icon next to **Model**.
216
+ 6. In the **Model** dropdown, choose the model you just downloaded: `openchat-3.5-1210-GPTQ`
217
+ 7. The model will automatically load, and is now ready for use!
218
+ 8. 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.
219
+
220
+ - Note that you do not need to and should not set manual GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
221
+
222
+ 9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
223
+
224
+ <!-- README_GPTQ.md-text-generation-webui end -->
225
+
226
+ <!-- README_GPTQ.md-use-from-tgi start -->
227
+ ## Serving this model from Text Generation Inference (TGI)
228
+
229
+ It's recommended to use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
230
+
231
+ Example Docker parameters:
232
+
233
+ ```shell
234
+ --model-id TheBloke/openchat-3.5-1210-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
235
+ ```
236
+
237
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
238
+
239
+ ```shell
240
+ pip3 install huggingface-hub
241
+ ```
242
+
243
+ ```python
244
+ from huggingface_hub import InferenceClient
245
+
246
+ endpoint_url = "https://your-endpoint-url-here"
247
+
248
+ prompt = "Tell me about AI"
249
+ prompt_template=f'''GPT4 User: {prompt}<|end_of_turn|>GPT4 Assistant:
250
+ '''
251
+
252
+ client = InferenceClient(endpoint_url)
253
+ response = client.text_generation(prompt,
254
+ max_new_tokens=128,
255
+ do_sample=True,
256
+ temperature=0.7,
257
+ top_p=0.95,
258
+ top_k=40,
259
+ repetition_penalty=1.1)
260
+
261
+ print(f"Model output: {response}")
262
+ ```
263
+ <!-- README_GPTQ.md-use-from-tgi end -->
264
+ <!-- README_GPTQ.md-use-from-python start -->
265
+ ## Python code example: inference from this GPTQ model
266
+
267
+ ### Install the necessary packages
268
+
269
+ Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
270
+
271
+ ```shell
272
+ pip3 install --upgrade transformers optimum
273
+ # If using PyTorch 2.1 + CUDA 12.x:
274
+ pip3 install --upgrade auto-gptq
275
+ # or, if using PyTorch 2.1 + CUDA 11.x:
276
+ pip3 install --upgrade auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/
277
+ ```
278
+
279
+ If you are using PyTorch 2.0, you will need to install AutoGPTQ from source. Likewise if you have problems with the pre-built wheels, you should try building from source:
280
+
281
+ ```shell
282
+ pip3 uninstall -y auto-gptq
283
+ git clone https://github.com/PanQiWei/AutoGPTQ
284
+ cd AutoGPTQ
285
+ git checkout v0.5.1
286
+ pip3 install .
287
+ ```
288
+
289
+ ### Example Python code
290
+
291
+ ```python
292
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
293
+
294
+ model_name_or_path = "TheBloke/openchat-3.5-1210-GPTQ"
295
+ # To use a different branch, change revision
296
+ # For example: revision="gptq-4bit-32g-actorder_True"
297
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
298
+ device_map="auto",
299
+ trust_remote_code=False,
300
+ revision="main")
301
+
302
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
303
+
304
+ prompt = "Write a story about llamas"
305
+ system_message = "You are a story writing assistant"
306
+ prompt_template=f'''GPT4 User: {prompt}<|end_of_turn|>GPT4 Assistant:
307
+ '''
308
+
309
+ print("\n\n*** Generate:")
310
+
311
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
312
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
313
+ print(tokenizer.decode(output[0]))
314
+
315
+ # Inference can also be done using transformers' pipeline
316
+
317
+ print("*** Pipeline:")
318
+ pipe = pipeline(
319
+ "text-generation",
320
+ model=model,
321
+ tokenizer=tokenizer,
322
+ max_new_tokens=512,
323
+ do_sample=True,
324
+ temperature=0.7,
325
+ top_p=0.95,
326
+ top_k=40,
327
+ repetition_penalty=1.1
328
+ )
329
+
330
+ print(pipe(prompt_template)[0]['generated_text'])
331
+ ```
332
+ <!-- README_GPTQ.md-use-from-python end -->
333
+
334
+ <!-- README_GPTQ.md-compatibility start -->
335
+ ## Compatibility
336
+
337
+ The files provided are tested to work with Transformers. For non-Mistral models, AutoGPTQ can also be used directly.
338
+
339
+ [ExLlama](https://github.com/turboderp/exllama) is compatible with Llama architecture models (including Mistral, Yi, DeepSeek, SOLAR, etc) in 4-bit. Please see the Provided Files table above for per-file compatibility.
340
+
341
+ For a list of clients/servers, please see "Known compatible clients / servers", above.
342
+ <!-- README_GPTQ.md-compatibility end -->
343
+
344
+ <!-- footer start -->
345
+ <!-- 200823 -->
346
+ ## Discord
347
+
348
+ For further support, and discussions on these models and AI in general, join us at:
349
+
350
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
351
+
352
+ ## Thanks, and how to contribute
353
+
354
+ Thanks to the [chirper.ai](https://chirper.ai) team!
355
+
356
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
357
+
358
+ 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.
359
+
360
+ 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.
361
+
362
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
363
+
364
+ * Patreon: https://patreon.com/TheBlokeAI
365
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
366
+
367
+ **Special thanks to**: Aemon Algiz.
368
+
369
+ **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
370
+
371
+
372
+ Thank you to all my generous patrons and donaters!
373
+
374
+ And thank you again to a16z for their generous grant.
375
+
376
+ <!-- footer end -->
377
+
378
+ # Original model card: OpenChat's Openchat 3.5 1210
379
+
380
+ <div align="center">
381
+ <img src="https://raw.githubusercontent.com/imoneoi/openchat/master/assets/logo_new.png" style="width: 65%">
382
+ <h1>Advancing Open-source Language Models with Mixed-Quality Data</h1>
383
+ </div>
384
+
385
+ <p align="center" style="margin-top: 0px;">
386
+ <a href="https://openchat.team">
387
+ <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;"/>
388
+ <span class="link-text" style=" margin-right: 5px;">Online Demo</span>
389
+ </a> |
390
+ <a href="https://github.com/imoneoi/openchat">
391
+ <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;"/>
392
+ <span class="link-text" style=" margin-right: 5px;">GitHub</span>
393
+ </a> |
394
+ <a href="https://arxiv.org/pdf/2309.11235.pdf">
395
+ <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;"/>
396
+ <span class="link-text" style="margin-right: 5px;">Paper</span>
397
+ </a> |
398
+ <a href="https://discord.gg/pQjnXvNKHY">
399
+ <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;"/>
400
+ <span class="link-text">Discord</span>
401
+ </a>
402
+ </p>
403
+
404
+ <hr>
405
+ <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;">
406
+ <a href="https://huggingface.co/openchat/openchat_3.5" style="text-decoration: none; color: black;">
407
+ <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>
408
+ <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>
409
+ <span style="font-size: 0.85em; font-family: 'Helvetica'; color: black;">
410
+ <br> 🏆 The Overall Best Performing Open Source 7B Model 🏆
411
+ <br> 🤖 Outperforms <span style="font-weight: bold;">ChatGPT</span> (March) and <span style="font-weight: bold;">Grok-1</span> 🤖
412
+ <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;
413
+ font-family: 'Helvetica'; color: black; font-weight: bold;">OpenChat-3.5🚀</span>
414
+ <br><br><span style="font-size: 1em; font-family: 'Helvetica'; color: #3c72db; font-weight: bold;">New Features</span>
415
+ <br> 💡 2 Modes: Coding + Generalist, Mathematical Reasoning 💡
416
+ <br> 🧑‍⚖️ Experimental support for Evaluator and Feedback capabilities 🧑‍⚖️
417
+ </span>
418
+ </a>
419
+ </div>
420
+
421
+ <div style="display: flex; justify-content: center; align-items: center">
422
+ <img src="https://github.com/alpayariyak/openchat/blob/master/assets/1210bench.png?raw=true" style="width: 100%; border-radius: 1em">
423
+ </div>
424
+
425
+ <div>
426
+ <h3> Table of Contents</h3>
427
+ </div>
428
+
429
+ 1. [Usage](#usage)
430
+ 2. [Benchmarks](#benchmarks)
431
+ 3. [Limitations](#limitations)
432
+ 4. [License](#license)
433
+ 5. [Dataset Details](#dataset-details)
434
+ 6. [Citation](#citation)
435
+ 7. [Acknowledgements](#acknowledgements)
436
+
437
+
438
+ <div align="center">
439
+ <h2> Usage </h2>
440
+ </div>
441
+
442
+ 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.
443
+
444
+ 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.
445
+
446
+ 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.
447
+
448
+ | Model | Size | Context | Weights | Serving |
449
+ |-------------------|------|---------|------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
450
+ | 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` |
451
+
452
+ <details>
453
+ <summary>Example request (click to expand)</summary>
454
+
455
+ 💡 **Default Mode (GPT4 Correct)**: Best for coding, chat and general tasks
456
+
457
+ ```bash
458
+ curl http://localhost:18888/v1/chat/completions \
459
+ -H "Content-Type: application/json" \
460
+ -d '{
461
+ "model": "openchat_3.5",
462
+ "messages": [{"role": "user", "content": "You are a large language model named OpenChat. Write a poem to describe yourself"}]
463
+ }'
464
+ ```
465
+
466
+ 🧮 **Mathematical Reasoning Mode**: Tailored for solving math problems
467
+
468
+ ```bash
469
+ curl http://localhost:18888/v1/chat/completions \
470
+ -H "Content-Type: application/json" \
471
+ -d '{
472
+ "model": "openchat_3.5",
473
+ "condition": "Math Correct",
474
+ "messages": [{"role": "user", "content": "10.3 − 7988.8133 = "}]
475
+ }'
476
+ ```
477
+
478
+ </details>
479
+
480
+ ### Conversation templates
481
+
482
+ 💡 **Default Mode (GPT4 Correct)**: Best for coding, chat and general tasks
483
+
484
+ ```
485
+ 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:
486
+ ```
487
+
488
+ 🧮 **Mathematical Reasoning Mode**: Tailored for solving math problems
489
+
490
+ ```
491
+ Math Correct User: 10.3 − 7988.8133=<|end_of_turn|>Math Correct Assistant:
492
+ ```
493
+
494
+ ⚠️ **Notice:** Remember to set `<|end_of_turn|>` as end of generation token.
495
+
496
+ The default (GPT4 Correct) template is also available as the integrated `tokenizer.chat_template`,
497
+ which can be used instead of manually specifying the template:
498
+
499
+ ```python
500
+ messages = [
501
+ {"role": "user", "content": "Hello"},
502
+ {"role": "assistant", "content": "Hi"},
503
+ {"role": "user", "content": "How are you today?"}
504
+ ]
505
+ tokens = tokenizer.apply_chat_template(messages, add_generation_prompt=True)
506
+ 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]
507
+ ```
508
+
509
+ <div align="center">
510
+ <h2> (Experimental) Evaluator / Feedback Capabilities </h2>
511
+ </div>
512
+ 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.
513
+
514
+ ```
515
+ ###Task Description:
516
+ 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.
517
+ 1. Write a detailed feedback that assess the quality of the response strictly based on the given score rubric, not evaluating in general.
518
+ 2. After writing a feedback, write a score that is an integer between 1 and 5. You should refer to the score rubric.
519
+ 3. The output format should look as follows: "Feedback: (write a feedback for criteria) [RESULT] (an integer number between 1 and 5)"
520
+ 4. Please do not generate any other opening, closing, and explanations.
521
+
522
+ ###The instruction to evaluate:
523
+ {orig_instruction}
524
+
525
+ ###Response to evaluate:
526
+ {orig_response}
527
+
528
+ ###Reference Answer (Score 5):
529
+ {orig_reference_answer}
530
+
531
+ ###Score Rubrics:
532
+ [{orig_criteria}]
533
+ Score 1: {orig_score1_description}
534
+ Score 2: {orig_score2_description}
535
+ Score 3: {orig_score3_description}
536
+ Score 4: {orig_score4_description}
537
+ Score 5: {orig_score5_description}
538
+
539
+ ###Feedback:
540
+ ```
541
+ <div align="center">
542
+ <h2> Benchmarks </h2>
543
+ </div>
544
+
545
+ | Model | # Params | Average | MT-Bench | HumanEval | BBH MC | AGIEval | TruthfulQA | MMLU | GSM8K | BBH CoT |
546
+ |--------------------|----------|----------|--------------|-----------------|----------|----------|---------------|--------------|--------------|-------------|
547
+ | OpenChat-3.5-1210 | **7B** | **63.8** | 7.76 | **68.9** | **49.5** | **48.0** | **61.8** | 65.3 | **77.3** | 61.8 |
548
+ | OpenChat-3.5 | **7B** | 61.6 | 7.81 | 55.5 | 47.6 | 47.4 | 59.1 | 64.3 | **77.3** | 63.5 |
549
+ | ChatGPT (March)* | ? | 61.5 | **7.94** | 48.1 | 47.6 | 47.1 | 57.7 | **67.3** | 74.9 | **70.1** |
550
+ | | | | | | | | | | | |
551
+ | OpenHermes 2.5 | 7B | 59.3 | 7.54 | 48.2 | 49.4 | 46.5 | 57.5 | 63.8 | 73.5 | 59.9 |
552
+ | OpenOrca Mistral | 7B | 52.7 | 6.86 | 38.4 | 49.4 | 42.9 | 45.9 | 59.3 | 59.1 | 58.1 |
553
+ | Zephyr-β^ | 7B | 34.6 | 7.34 | 22.0 | 40.6 | 39.0 | 40.8 | 39.8 | 5.1 | 16.0 |
554
+ | Mistral | 7B | - | 6.84 | 30.5 | 39.0 | 38.0 | - | 60.1 | 52.2 | - |
555
+
556
+ <details>
557
+ <summary>Evaluation Details(click to expand)</summary>
558
+ *: 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.
559
+
560
+ ^: 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.
561
+
562
+ **: Mistral and Open-source SOTA results are taken from reported results in instruction-tuned model papers and official repositories.
563
+
564
+ 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).
565
+ </details>
566
+ <div>
567
+ <h3>HumanEval+</h3>
568
+ </div>
569
+
570
+ | Model | Size | HumanEval+ pass@1 |
571
+ |-----------------------------|----------|------------|
572
+ | ChatGPT (December 12, 2023) | - | 64.6 |
573
+ | WizardCoder-Python-34B-V1.0 | 34B | 64.6 |
574
+ | **OpenChat 3.5 (Dec 10)** | **7B** | **63.4** |
575
+ | OpenHermes 2.5 | 7B | 41.5 |
576
+
577
+ <div>
578
+ <h3>OpenChat-3.5-1210 vs. Grok</h3>
579
+ </div>
580
+
581
+ | | License | # Param | Average | MMLU | HumanEval | MATH | GSM8k |
582
+ |-------------------|-------------|---------|----------|------|-----------|----------|----------|
583
+ | OpenChat 3.5 1210 | Apache-2.0 | **7B** | **60.1** | 65.3 | **68.9** | **28.9** | **77.3** |
584
+ | OpenChat 3.5 | Apache-2.0 | **7B** | 56.4 | 64.3 | 55.5 | 28.6 | **77.3** |
585
+ | Grok-0 | Proprietary | 33B | 44.5 | 65.7 | 39.7 | 15.7 | 56.8 |
586
+ | Grok-1 | Proprietary | ???B | 55.8 | 73 | 63.2 | 23.9 | 62.9 |
587
+
588
+ *: Grok results are reported by [X.AI](https://x.ai/).
589
+
590
+ <div>
591
+ <h3>Massive Multitask Language Understanding in Chinese (CMMLU)</h3>
592
+ 5-shot:
593
+ </div>
594
+
595
+ | Models | STEM | Humanities | SocialSciences | Other | ChinaSpecific | Avg |
596
+ |----------|-------|------------|----------------|-------|---------------|-------|
597
+ | ChatGPT | 47.81 | 55.68 | 56.5 | 62.66 | 50.69 | 55.51 |
598
+ | OpenChat | 38.7 | 45.99 | 48.32 | 50.23 | 43.27 | 45.85 |
599
+
600
+ <div>
601
+ <h3>Multi-Level Multi-Discipline Chinese Evaluation Suite (CEVAL)</h3>
602
+ <div>
603
+
604
+ | Model | Avg | STEM | Social Science | Humanities | Others |
605
+ |----------|-------|-------|----------------|------------|--------|
606
+ | ChatGPT | 54.4 | 52.9 | 61.8 | 50.9 | 53.6 |
607
+ | OpenChat | 47.29 | 45.22 | 52.49 | 48.52 | 45.08 |
608
+
609
+
610
+ <div align="center">
611
+ <h2> Limitations </h2>
612
+ </div>
613
+
614
+ **Foundation Model Limitations**
615
+ 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:
616
+
617
+ - Complex reasoning
618
+ - Mathematical and arithmetic tasks
619
+ - Programming and coding challenges
620
+
621
+ **Hallucination of Non-existent Information**
622
+ 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.
623
+
624
+ **Safety**
625
+ 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.
626
+
627
+ <div align="center">
628
+ <h2> License </h2>
629
+ </div>
630
+
631
+ Our OpenChat 3.5 code and models are distributed under the Apache License 2.0.
632
+
633
+ <div align="center">
634
+ <h2> Dataset Details </h2>
635
+ </div>
636
+
637
+ 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:
638
+
639
+ - [OpenChat ShareGPT](https://huggingface.co/datasets/openchat/openchat_sharegpt4_dataset)
640
+ - [Open-Orca with FLAN answers](https://huggingface.co/datasets/imone/OpenOrca_FLAN)
641
+ - [Feedback-Collection](https://huggingface.co/datasets/kaist-ai/Feedback-Collection)
642
+ - 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)
643
+ - [GOAT](https://huggingface.co/datasets/tiedong/goat)
644
+ - [Glaive](https://huggingface.co/datasets/glaiveai/glaive-code-assistant)
645
+ - [MetaMathQA](https://huggingface.co/datasets/meta-math/MetaMathQA)
646
+ - [MathInstruct](https://huggingface.co/datasets/TIGER-Lab/MathInstruct)
647
+ - [OpenAssistant](https://huggingface.co/datasets/OpenAssistant/oasst_top1_2023-08-25)
648
+
649
+ <div align="center">
650
+ <h2> Citation </h2>
651
+ </div>
652
+
653
+ ```
654
+ @article{wang2023openchat,
655
+ title={OpenChat: Advancing Open-source Language Models with Mixed-Quality Data},
656
+ author={Wang, Guan and Cheng, Sijie and Zhan, Xianyuan and Li, Xiangang and Song, Sen and Liu, Yang},
657
+ journal={arXiv preprint arXiv:2309.11235},
658
+ year={2023}
659
+ }
660
+ ```
661
+
662
+ <div align="center">
663
+ <h2> Acknowledgments </h2>
664
+ </div>
665
+
666
+ 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.
667
+
668
+ 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.
669
+
670
+ 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.