TheBloke commited on
Commit
3d4aa78
1 Parent(s): 7560680

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +591 -0
README.md ADDED
@@ -0,0 +1,591 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: SUSTech/SUS-Chat-34B
3
+ inference: false
4
+ license: other
5
+ license_link: LICENSE
6
+ license_name: yi-license
7
+ model_creator: Southern university of science and technology
8
+ model_name: SUS Chat 34B
9
+ model_type: yi
10
+ pipeline_tag: text-generation
11
+ prompt_template: '### Human: {prompt}
12
+
13
+
14
+ ### Assistant:
15
+
16
+ '
17
+ quantized_by: TheBloke
18
+ widget:
19
+ - example_title: SUS-Chat
20
+ output:
21
+ text: ' Hello! How can I assist you today?'
22
+ text: hi
23
+ ---
24
+ <!-- markdownlint-disable MD041 -->
25
+
26
+ <!-- header start -->
27
+ <!-- 200823 -->
28
+ <div style="width: auto; margin-left: auto; margin-right: auto">
29
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
30
+ </div>
31
+ <div style="display: flex; justify-content: space-between; width: 100%;">
32
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
33
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
34
+ </div>
35
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
36
+ <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>
37
+ </div>
38
+ </div>
39
+ <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>
40
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
41
+ <!-- header end -->
42
+
43
+ # SUS Chat 34B - GPTQ
44
+ - Model creator: [Southern university of science and technology](https://huggingface.co/SUSTech)
45
+ - Original model: [SUS Chat 34B](https://huggingface.co/SUSTech/SUS-Chat-34B)
46
+
47
+ <!-- description start -->
48
+ # Description
49
+
50
+ This repo contains GPTQ model files for [Southern university of science and technology's SUS Chat 34B](https://huggingface.co/SUSTech/SUS-Chat-34B).
51
+
52
+ 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.
53
+
54
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
55
+
56
+ <!-- description end -->
57
+ <!-- repositories-available start -->
58
+ ## Repositories available
59
+
60
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/SUS-Chat-34B-AWQ)
61
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/SUS-Chat-34B-GPTQ)
62
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/SUS-Chat-34B-GGUF)
63
+ * [Southern university of science and technology's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/SUSTech/SUS-Chat-34B)
64
+ <!-- repositories-available end -->
65
+
66
+ <!-- prompt-template start -->
67
+ ## Prompt template: SUS
68
+
69
+ ```
70
+ ### Human: {prompt}
71
+
72
+ ### Assistant:
73
+
74
+ ```
75
+
76
+ <!-- prompt-template end -->
77
+
78
+
79
+
80
+ <!-- README_GPTQ.md-compatible clients start -->
81
+ ## Known compatible clients / servers
82
+
83
+ GPTQ models are currently supported on Linux (NVidia/AMD) and Windows (NVidia only). macOS users: please use GGUF models.
84
+
85
+ These GPTQ models are known to work in the following inference servers/webuis.
86
+
87
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
88
+ - [KoboldAI United](https://github.com/henk717/koboldai)
89
+ - [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui)
90
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
91
+
92
+ This may not be a complete list; if you know of others, please let me know!
93
+ <!-- README_GPTQ.md-compatible clients end -->
94
+
95
+ <!-- README_GPTQ.md-provided-files start -->
96
+ ## Provided files, and GPTQ parameters
97
+
98
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
99
+
100
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
101
+
102
+ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
103
+
104
+ <details>
105
+ <summary>Explanation of GPTQ parameters</summary>
106
+
107
+ - Bits: The bit size of the quantised model.
108
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
109
+ - 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.
110
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
111
+ - 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).
112
+ - 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.
113
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
114
+
115
+ </details>
116
+
117
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
118
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
119
+ | [main](https://huggingface.co/TheBloke/SUS-Chat-34B-GPTQ/tree/main) | 4 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 18.60 GB | Yes | 4-bit, with Act Order. No group size, to lower VRAM requirements. |
120
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/SUS-Chat-34B-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 19.25 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
121
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/SUS-Chat-34B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 21.21 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
122
+ | [gptq-3bit-128g-actorder_True](https://huggingface.co/TheBloke/SUS-Chat-34B-GPTQ/tree/gptq-3bit-128g-actorder_True) | 3 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 15.03 GB | No | 3-bit, with group size 128g and act-order. Higher quality than 128g-False. |
123
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/SUS-Chat-34B-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 35.34 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
124
+ | [gptq-3bit-32g-actorder_True](https://huggingface.co/TheBloke/SUS-Chat-34B-GPTQ/tree/gptq-3bit-32g-actorder_True) | 3 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 16.90 GB | No | 3-bit, with group size 64g and act-order. Highest quality 3-bit option. |
125
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/SUS-Chat-34B-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 36.11 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
126
+
127
+ <!-- README_GPTQ.md-provided-files end -->
128
+
129
+ <!-- README_GPTQ.md-download-from-branches start -->
130
+ ## How to download, including from branches
131
+
132
+ ### In text-generation-webui
133
+
134
+ To download from the `main` branch, enter `TheBloke/SUS-Chat-34B-GPTQ` in the "Download model" box.
135
+
136
+ To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/SUS-Chat-34B-GPTQ:gptq-4bit-128g-actorder_True`
137
+
138
+ ### From the command line
139
+
140
+ I recommend using the `huggingface-hub` Python library:
141
+
142
+ ```shell
143
+ pip3 install huggingface-hub
144
+ ```
145
+
146
+ To download the `main` branch to a folder called `SUS-Chat-34B-GPTQ`:
147
+
148
+ ```shell
149
+ mkdir SUS-Chat-34B-GPTQ
150
+ huggingface-cli download TheBloke/SUS-Chat-34B-GPTQ --local-dir SUS-Chat-34B-GPTQ --local-dir-use-symlinks False
151
+ ```
152
+
153
+ To download from a different branch, add the `--revision` parameter:
154
+
155
+ ```shell
156
+ mkdir SUS-Chat-34B-GPTQ
157
+ huggingface-cli download TheBloke/SUS-Chat-34B-GPTQ --revision gptq-4bit-128g-actorder_True --local-dir SUS-Chat-34B-GPTQ --local-dir-use-symlinks False
158
+ ```
159
+
160
+ <details>
161
+ <summary>More advanced huggingface-cli download usage</summary>
162
+
163
+ 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.
164
+
165
+ The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
166
+
167
+ 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).
168
+
169
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
170
+
171
+ ```shell
172
+ pip3 install hf_transfer
173
+ ```
174
+
175
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
176
+
177
+ ```shell
178
+ mkdir SUS-Chat-34B-GPTQ
179
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/SUS-Chat-34B-GPTQ --local-dir SUS-Chat-34B-GPTQ --local-dir-use-symlinks False
180
+ ```
181
+
182
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
183
+ </details>
184
+
185
+ ### With `git` (**not** recommended)
186
+
187
+ To clone a specific branch with `git`, use a command like this:
188
+
189
+ ```shell
190
+ git clone --single-branch --branch gptq-4bit-128g-actorder_True https://huggingface.co/TheBloke/SUS-Chat-34B-GPTQ
191
+ ```
192
+
193
+ 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.)
194
+
195
+ <!-- README_GPTQ.md-download-from-branches end -->
196
+ <!-- README_GPTQ.md-text-generation-webui start -->
197
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
198
+
199
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
200
+
201
+ 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.
202
+
203
+ 1. Click the **Model tab**.
204
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/SUS-Chat-34B-GPTQ`.
205
+
206
+ - To download from a specific branch, enter for example `TheBloke/SUS-Chat-34B-GPTQ:gptq-4bit-128g-actorder_True`
207
+ - see Provided Files above for the list of branches for each option.
208
+
209
+ 3. Click **Download**.
210
+ 4. The model will start downloading. Once it's finished it will say "Done".
211
+ 5. In the top left, click the refresh icon next to **Model**.
212
+ 6. In the **Model** dropdown, choose the model you just downloaded: `SUS-Chat-34B-GPTQ`
213
+ 7. The model will automatically load, and is now ready for use!
214
+ 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.
215
+
216
+ - 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`.
217
+
218
+ 9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
219
+
220
+ <!-- README_GPTQ.md-text-generation-webui end -->
221
+
222
+ <!-- README_GPTQ.md-use-from-tgi start -->
223
+ ## Serving this model from Text Generation Inference (TGI)
224
+
225
+ 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`
226
+
227
+ Example Docker parameters:
228
+
229
+ ```shell
230
+ --model-id TheBloke/SUS-Chat-34B-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
231
+ ```
232
+
233
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
234
+
235
+ ```shell
236
+ pip3 install huggingface-hub
237
+ ```
238
+
239
+ ```python
240
+ from huggingface_hub import InferenceClient
241
+
242
+ endpoint_url = "https://your-endpoint-url-here"
243
+
244
+ prompt = "Tell me about AI"
245
+ prompt_template=f'''### Human: {prompt}
246
+
247
+ ### Assistant:
248
+ '''
249
+
250
+ client = InferenceClient(endpoint_url)
251
+ response = client.text_generation(prompt,
252
+ max_new_tokens=128,
253
+ do_sample=True,
254
+ temperature=0.7,
255
+ top_p=0.95,
256
+ top_k=40,
257
+ repetition_penalty=1.1)
258
+
259
+ print(f"Model output: {response}")
260
+ ```
261
+ <!-- README_GPTQ.md-use-from-tgi end -->
262
+ <!-- README_GPTQ.md-use-from-python start -->
263
+ ## Python code example: inference from this GPTQ model
264
+
265
+ ### Install the necessary packages
266
+
267
+ Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
268
+
269
+ ```shell
270
+ pip3 install --upgrade transformers optimum
271
+ # If using PyTorch 2.1 + CUDA 12.x:
272
+ pip3 install --upgrade auto-gptq
273
+ # or, if using PyTorch 2.1 + CUDA 11.x:
274
+ pip3 install --upgrade auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/
275
+ ```
276
+
277
+ 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:
278
+
279
+ ```shell
280
+ pip3 uninstall -y auto-gptq
281
+ git clone https://github.com/PanQiWei/AutoGPTQ
282
+ cd AutoGPTQ
283
+ git checkout v0.5.1
284
+ pip3 install .
285
+ ```
286
+
287
+ ### Example Python code
288
+
289
+ ```python
290
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
291
+
292
+ model_name_or_path = "TheBloke/SUS-Chat-34B-GPTQ"
293
+ # To use a different branch, change revision
294
+ # For example: revision="gptq-4bit-128g-actorder_True"
295
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
296
+ device_map="auto",
297
+ trust_remote_code=False,
298
+ revision="main")
299
+
300
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
301
+
302
+ prompt = "Tell me about AI"
303
+ prompt_template=f'''### Human: {prompt}
304
+
305
+ ### Assistant:
306
+ '''
307
+
308
+ print("\n\n*** Generate:")
309
+
310
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
311
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
312
+ print(tokenizer.decode(output[0]))
313
+
314
+ # Inference can also be done using transformers' pipeline
315
+
316
+ print("*** Pipeline:")
317
+ pipe = pipeline(
318
+ "text-generation",
319
+ model=model,
320
+ tokenizer=tokenizer,
321
+ max_new_tokens=512,
322
+ do_sample=True,
323
+ temperature=0.7,
324
+ top_p=0.95,
325
+ top_k=40,
326
+ repetition_penalty=1.1
327
+ )
328
+
329
+ print(pipe(prompt_template)[0]['generated_text'])
330
+ ```
331
+ <!-- README_GPTQ.md-use-from-python end -->
332
+
333
+ <!-- README_GPTQ.md-compatibility start -->
334
+ ## Compatibility
335
+
336
+ The files provided are tested to work with Transformers. For non-Mistral models, AutoGPTQ can also be used directly.
337
+
338
+ [ExLlama](https://github.com/turboderp/exllama) is compatible with Llama and Mistral models in 4-bit. Please see the Provided Files table above for per-file compatibility.
339
+
340
+ For a list of clients/servers, please see "Known compatible clients / servers", above.
341
+ <!-- README_GPTQ.md-compatibility end -->
342
+
343
+ <!-- footer start -->
344
+ <!-- 200823 -->
345
+ ## Discord
346
+
347
+ For further support, and discussions on these models and AI in general, join us at:
348
+
349
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
350
+
351
+ ## Thanks, and how to contribute
352
+
353
+ Thanks to the [chirper.ai](https://chirper.ai) team!
354
+
355
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
356
+
357
+ 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.
358
+
359
+ 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.
360
+
361
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
362
+
363
+ * Patreon: https://patreon.com/TheBlokeAI
364
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
365
+
366
+ **Special thanks to**: Aemon Algiz.
367
+
368
+ **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
369
+
370
+
371
+ Thank you to all my generous patrons and donaters!
372
+
373
+ And thank you again to a16z for their generous grant.
374
+
375
+ <!-- footer end -->
376
+
377
+ # Original model card: Southern university of science and technology's SUS Chat 34B
378
+
379
+
380
+ # 🐷SUS-Chat: Instruction tuning done right
381
+
382
+
383
+
384
+ <div align="center">
385
+
386
+ <p align="center">
387
+ <img src="https://github.com/SUSTech-IDEA/SUS-Chat/raw/main/assets/sustech.svg?sanitize=true" width="200px">
388
+ <img src="https://github.com/SUSTech-IDEA/SUS-Chat/raw/main/assets/ccnl.png?sanitize=true" width="200px">
389
+ </p>
390
+
391
+ <div style="display: inline-block;">
392
+
393
+ <a rel="noopener nofollow" href="https://github.com/SUSTech-IDEA/SUS-Chat/issues">
394
+ <img src="https://img.shields.io/github/issues/SUSTech-IDEA/SUS-Chat?logo=github" style="margin: 0 0;">
395
+ </a>
396
+
397
+ </div>
398
+
399
+ <div style="display: inline-block;">
400
+
401
+ <a href="https://huggingface.co/SUSTech">
402
+ <img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-SUSTech-blue" style="margin: 0 0;">
403
+ </a>
404
+
405
+ </div>
406
+
407
+ <div style="display: inline-block;">
408
+
409
+ <a rel="noopener nofollow" href="https://www.modelscope.cn/organization/sustc/">
410
+ <img src="https://img.shields.io/badge/ModelScope-sustc-blue" style="margin: 0 0;">
411
+ </a>
412
+
413
+ </div>
414
+
415
+ <div style="display: inline-block;">
416
+
417
+ <a rel="noopener nofollow" href="https://github.com/SUSTech-IDEA/SUS-Chat/blob/main/LICENSE">
418
+ <img src="https://img.shields.io/badge/Code_License-Apache_2.0-lightblue" style="margin: 0 0;">
419
+ </a>
420
+
421
+ </div>
422
+
423
+ <div style="display: inline-block;">
424
+
425
+ <a rel="noopener nofollow" href="https://github.com/01-ai/Yi/blob/main/MODEL_LICENSE_AGREEMENT.txt">
426
+ <img src="https://img.shields.io/badge/Model_License-Model_Agreement-lightblue" style="margin: 0 0;">
427
+ </a>
428
+
429
+ </div>
430
+
431
+ <div style="display: inline-block;">
432
+
433
+ <a rel="noopener nofollow" href="mailto:[email protected]">
434
+ <img src="https://img.shields.io/badge/✉️[email protected]" style="margin: 0 0;">
435
+ </a>
436
+
437
+ </div>
438
+
439
+ </div>
440
+
441
+ # News
442
+
443
+ - 2023-12-05: SUS-Chat is ranked 2nd in [Open LLM
444
+ leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
445
+ and surpassed all models under 70B.
446
+
447
+ - 2023-12-01: SUS-Chat-34B is now avaliable on HuggingFace🤗.
448
+
449
+ # Inrtoduction
450
+
451
+ <img src="https://hackmd.io/_uploads/HJlDtzhBa.png" id="fig-sus"
452
+ alt="Figure 1: DALL·E 2023-12-01 11.03.28 - An imposing, majestic wild boar combined with elements of a futuristic transformer robot. The boar itself should be intricately blended with these tra" />
453
+
454
+ **SUS-Chat** is a 34B bilingual Chinese-English dialogue model, jointly
455
+ released by the **Southern University of Science and Technology** and
456
+ **International Digital Economy Academy**. The SUS-Chat-34B model has
457
+ been fine-tuned on millions of high-quality, multilingual instruction
458
+ data. While maintaining the strong language capabilities of the base
459
+ model, the SUS-Chat-34B model has improved the model’s response to human
460
+ instructions through high-quality instruction fine-tuning and excels at
461
+ imitating human thought processes through chains of thought. It
462
+ introduces inter-instruction attention sharing in long texts, expanding
463
+ the window size from 4K to 8K, significantly enhancing the usability of
464
+ multi-round dialogues.
465
+
466
+ It has surpassed all models of the same size in almost all benchmark
467
+ tests and is better suited to meet the practical needs of complex
468
+ multilingual tasks. Compared to larger models, SUS-Chat-34B remains
469
+ highly competitive and achieved state-of-the-art performance in our
470
+ comprehensive evaluations.
471
+
472
+ SUS-Chat powerfully demonstrates that through the right instruction
473
+ fine-tuning, academic institutions can achieve better performance
474
+ without increasing model parameters, using open-source datasets and
475
+ models. This bridges the gap between academia and industry in large
476
+ language models and opens new possibilities for collaboration between
477
+ academic and industrial sectors.
478
+
479
+ # Performance
480
+
481
+ To better evaluate the performance of the SUS-Chat-34B model, we
482
+ conducted assessments across multiple benchmark tests and have
483
+ open-sourced the evaluation framework
484
+ [TLEM](https://huggingface.co/spaces/SUSTech/tlem) to facilitate
485
+ replication and comparison by other researchers.
486
+
487
+ In TLEM, we utilized various benchmark tests including MMLU, CMMLU,
488
+ C-Eval, BBH, GSM-8K, and MATH, focusing on measuring the model’s
489
+ knowledge and thinking capabilities. In these metrics, the SUS-Chat-34B
490
+ model achieved state-of-the-art performance. Additionally, we
491
+ incorporated
492
+ [lm-eval](https://github.com/EleutherAI/lm-evaluation-harness) to test
493
+ SUS-Chat and similar models on winogrande, hellaswag, arc, and
494
+ truthful-qa, assessing the model’s common-sense reasoning ability and
495
+ susceptibility to illusions.
496
+
497
+ Overall, the SUS-Chat-34B model significantly outperformed models of
498
+ similar scale and achieved the most advanced comprehensive performance.
499
+
500
+ | model | mmlu-chat | cmmlu-chat | ceval-chat | gsm8k | BBH | MATH | winogrande | arc | hellaswag | truthfulqa | average |
501
+ |:------------------|----------:|-----------:|-----------:|------:|------:|------:|-----------:|------:|----------:|-----------:|--------:|
502
+ | GPT-4 | 83 | 71 | 69.9 | 91.4 | 86.7 | 45.8 | 87.5 | 94.5 | 91.4 | nan | 80.1333 |
503
+ | SUS-Chat-34B | 77.35 | 78.68 | 82.42 | 80.06 | 67.62 | 28.8 | 81.22 | 81.54 | 83.79 | 57.47 | 71.895 |
504
+ | Qwen-72B-Chat | 74.52 | 77.02 | 77.22 | 76.57 | 72.63 | 35.9 | 80.58 | 81.29 | 87.02 | 50.64 | 71.339 |
505
+ | DeepSeek-67B-Chat | 69.43 | 48.51 | 59.7 | 74.45 | 69.73 | 29.56 | 76.09 | 82.1 | 86.06 | 56.37 | 65.2 |
506
+ | OrionStar-34B | 68.51 | 66.88 | 65.13 | 54.36 | 62.88 | 12.8 | 77.27 | 80.19 | 84.54 | 53.24 | 62.58 |
507
+ | Yi-34B-Chat | 66.96 | 55.16 | 77.16 | 63.76 | 61.54 | 10.02 | 76.64 | 70.66 | 82.29 | 54.57 | 61.876 |
508
+
509
+ <img
510
+ src="https://github.com/SUSTech-IDEA/SUS-Chat/raw/main/assets/radar.png"
511
+ id="fig-bench" alt="Figure 2: Benchmark" />
512
+
513
+ # Usage
514
+
515
+ SUS-Chat-34B is a standard LLaMA model and should be seamlessly
516
+ compatible with the LLaMA ecosystem. We provide the following example to
517
+ demonstrate how it can be used for multi-turn dialogues.
518
+
519
+ ``` python
520
+ from transformers import AutoModelForCausalLM, AutoTokenizer
521
+
522
+
523
+ def chat_template(messages):
524
+ history = ""
525
+ for message in messages:
526
+ match message:
527
+ case {"role": "user", "content": message}:
528
+ history += f"### Human: {message}\n\n### Assistant: "
529
+ case {"role": "assistant", "content": message}:
530
+ history += message
531
+ return history
532
+
533
+
534
+ model_path = "SUSTech/SUS-Chat-34B"
535
+
536
+ tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False)
537
+ model = AutoModelForCausalLM.from_pretrained(
538
+ model_path, device_map="auto", torch_dtype="auto"
539
+ ).eval()
540
+
541
+ messages = [{"role": "user", "content": "hi"}]
542
+
543
+ input_ids = tokenizer.encode(chat_template(messages), return_tensors="pt").to("cuda")
544
+ output_ids = model.generate(input_ids.to("cuda"))
545
+ response = tokenizer.decode(
546
+ output_ids[0][input_ids.shape[1] :], skip_special_tokens=True
547
+ )
548
+
549
+ messages.append({"role": "assistant", "content": response})
550
+
551
+ # Second round
552
+
553
+ messages.append({"role": "user", "content": "What is the capital of China?"})
554
+
555
+ input_ids = tokenizer.encode(chat_template(messages), return_tensors="pt").to("cuda")
556
+ output_ids = model.generate(input_ids.to("cuda"))
557
+ response = tokenizer.decode(
558
+ output_ids[0][input_ids.shape[1] :], skip_special_tokens=True
559
+ )
560
+
561
+ messages.append({"role": "assistant", "content": response})
562
+ ```
563
+
564
+ # Limitations
565
+
566
+ SUS-Chat has only undergone supervised fine-tuning and has not yet been
567
+ trained on human preference learning. As a result, it may produce
568
+ unreasonable responses in some situations and exacerbate existing issues
569
+ in language models, including hallucinations, non-determinism, and
570
+ cumulative errors. To achieve better performance for downstream tasks,
571
+ we recommend adjusting the generation configuration parameters
572
+ accordingly.
573
+
574
+ # Disclaimer
575
+
576
+ During the training process, we used data compliance check algorithms to
577
+ ensure the compliance of the training model as much as possible. Due to
578
+ the complexity of the data and the diverse use cases of language models,
579
+ we cannot guarantee that the model will produce correct and reasonable
580
+ outputs in all scenarios. Please be aware that there is still a risk of
581
+ the model generating problematic outputs. We will not be responsible for
582
+ any risks or issues arising from misuse, misguidance, illegal use, and
583
+ related misinformation, as well as data security issues related to the
584
+ model.
585
+
586
+ # License
587
+
588
+ This model is developed entirely for academic research and free
589
+ commercial use, but it must adhere to the
590
+ [license](https://github.com/SUSTech-IDEA/SUS-Chat/blob/main/MODEL_LICENSE_AGREEMENT.txt)
591
+ from 01-ai.