Text Generation
Transformers
Safetensors
llama
text-generation-inference
4-bit precision
gptq
TheBloke commited on
Commit
424a005
1 Parent(s): 51e6e9c

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +551 -0
README.md ADDED
@@ -0,0 +1,551 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: jondurbin/bagel-34b-v0.2
3
+ datasets:
4
+ - ai2_arc
5
+ - unalignment/spicy-3.1
6
+ - codeparrot/apps
7
+ - facebook/belebele
8
+ - boolq
9
+ - jondurbin/cinematika-v0.1
10
+ - drop
11
+ - lmsys/lmsys-chat-1m
12
+ - TIGER-Lab/MathInstruct
13
+ - cais/mmlu
14
+ - Muennighoff/natural-instructions
15
+ - openbookqa
16
+ - piqa
17
+ - Vezora/Tested-22k-Python-Alpaca
18
+ - cakiki/rosetta-code
19
+ - Open-Orca/SlimOrca
20
+ - spider
21
+ - squad_v2
22
+ - migtissera/Synthia-v1.3
23
+ - datasets/winogrande
24
+ - nvidia/HelpSteer
25
+ - Intel/orca_dpo_pairs
26
+ - unalignment/toxic-dpo-v0.1
27
+ - jondurbin/truthy-dpo-v0.1
28
+ - allenai/ultrafeedback_binarized_cleaned
29
+ - Squish42/bluemoon-fandom-1-1-rp-cleaned
30
+ - LDJnr/Capybara
31
+ - JULIELab/EmoBank
32
+ - kingbri/PIPPA-shareGPT
33
+ inference: false
34
+ license: other
35
+ license_link: https://huggingface.co/01-ai/Yi-34B-200K/blob/main/LICENSE
36
+ license_name: yi-license
37
+ model_creator: Jon Durbin
38
+ model_name: Bagel 34B v0.2
39
+ model_type: yi
40
+ prompt_template: 'Below is an instruction that describes a task. Write a response
41
+ that appropriately completes the request.
42
+
43
+
44
+ ### Instruction:
45
+
46
+ {system_message}
47
+
48
+ {prompt}
49
+
50
+
51
+ ### Response:
52
+
53
+ '
54
+ quantized_by: TheBloke
55
+ ---
56
+ <!-- markdownlint-disable MD041 -->
57
+
58
+ <!-- header start -->
59
+ <!-- 200823 -->
60
+ <div style="width: auto; margin-left: auto; margin-right: auto">
61
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
62
+ </div>
63
+ <div style="display: flex; justify-content: space-between; width: 100%;">
64
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
65
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
66
+ </div>
67
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
68
+ <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>
69
+ </div>
70
+ </div>
71
+ <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>
72
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
73
+ <!-- header end -->
74
+
75
+ # Bagel 34B v0.2 - GPTQ
76
+ - Model creator: [Jon Durbin](https://huggingface.co/jondurbin)
77
+ - Original model: [Bagel 34B v0.2](https://huggingface.co/jondurbin/bagel-34b-v0.2)
78
+
79
+ <!-- description start -->
80
+ # Description
81
+
82
+ This repo contains GPTQ model files for [Jon Durbin's Bagel 34B v0.2](https://huggingface.co/jondurbin/bagel-34b-v0.2).
83
+
84
+ 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.
85
+
86
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
87
+
88
+ <!-- description end -->
89
+ <!-- repositories-available start -->
90
+ ## Repositories available
91
+
92
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/bagel-34b-v0.2-AWQ)
93
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/bagel-34b-v0.2-GPTQ)
94
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/bagel-34b-v0.2-GGUF)
95
+ * [Jon Durbin's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/jondurbin/bagel-34b-v0.2)
96
+ <!-- repositories-available end -->
97
+
98
+ <!-- prompt-template start -->
99
+ ## Prompt template: Bagel-Alpaca
100
+
101
+ ```
102
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
103
+
104
+ ### Instruction:
105
+ {system_message}
106
+ {prompt}
107
+
108
+ ### Response:
109
+
110
+ ```
111
+
112
+ <!-- prompt-template end -->
113
+
114
+
115
+
116
+ <!-- README_GPTQ.md-compatible clients start -->
117
+ ## Known compatible clients / servers
118
+
119
+ GPTQ models are currently supported on Linux (NVidia/AMD) and Windows (NVidia only). macOS users: please use GGUF models.
120
+
121
+ These GPTQ models are known to work in the following inference servers/webuis.
122
+
123
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
124
+ - [KoboldAI United](https://github.com/henk717/koboldai)
125
+ - [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui)
126
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
127
+
128
+ This may not be a complete list; if you know of others, please let me know!
129
+ <!-- README_GPTQ.md-compatible clients end -->
130
+
131
+ <!-- README_GPTQ.md-provided-files start -->
132
+ ## Provided files, and GPTQ parameters
133
+
134
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
135
+
136
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
137
+
138
+ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
139
+
140
+ <details>
141
+ <summary>Explanation of GPTQ parameters</summary>
142
+
143
+ - Bits: The bit size of the quantised model.
144
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
145
+ - 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.
146
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
147
+ - 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).
148
+ - 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.
149
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
150
+
151
+ </details>
152
+
153
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
154
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
155
+ | [main](https://huggingface.co/TheBloke/bagel-34b-v0.2-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. |
156
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/bagel-34b-v0.2-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. |
157
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/bagel-34b-v0.2-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. |
158
+ | [gptq-3bit-128g-actorder_True](https://huggingface.co/TheBloke/bagel-34b-v0.2-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. |
159
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/bagel-34b-v0.2-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. |
160
+ | [gptq-3bit-32g-actorder_True](https://huggingface.co/TheBloke/bagel-34b-v0.2-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. |
161
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/bagel-34b-v0.2-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. |
162
+
163
+ <!-- README_GPTQ.md-provided-files end -->
164
+
165
+ <!-- README_GPTQ.md-download-from-branches start -->
166
+ ## How to download, including from branches
167
+
168
+ ### In text-generation-webui
169
+
170
+ To download from the `main` branch, enter `TheBloke/bagel-34b-v0.2-GPTQ` in the "Download model" box.
171
+
172
+ To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/bagel-34b-v0.2-GPTQ:gptq-4bit-128g-actorder_True`
173
+
174
+ ### From the command line
175
+
176
+ I recommend using the `huggingface-hub` Python library:
177
+
178
+ ```shell
179
+ pip3 install huggingface-hub
180
+ ```
181
+
182
+ To download the `main` branch to a folder called `bagel-34b-v0.2-GPTQ`:
183
+
184
+ ```shell
185
+ mkdir bagel-34b-v0.2-GPTQ
186
+ huggingface-cli download TheBloke/bagel-34b-v0.2-GPTQ --local-dir bagel-34b-v0.2-GPTQ --local-dir-use-symlinks False
187
+ ```
188
+
189
+ To download from a different branch, add the `--revision` parameter:
190
+
191
+ ```shell
192
+ mkdir bagel-34b-v0.2-GPTQ
193
+ huggingface-cli download TheBloke/bagel-34b-v0.2-GPTQ --revision gptq-4bit-128g-actorder_True --local-dir bagel-34b-v0.2-GPTQ --local-dir-use-symlinks False
194
+ ```
195
+
196
+ <details>
197
+ <summary>More advanced huggingface-cli download usage</summary>
198
+
199
+ 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.
200
+
201
+ The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
202
+
203
+ 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).
204
+
205
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
206
+
207
+ ```shell
208
+ pip3 install hf_transfer
209
+ ```
210
+
211
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
212
+
213
+ ```shell
214
+ mkdir bagel-34b-v0.2-GPTQ
215
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/bagel-34b-v0.2-GPTQ --local-dir bagel-34b-v0.2-GPTQ --local-dir-use-symlinks False
216
+ ```
217
+
218
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
219
+ </details>
220
+
221
+ ### With `git` (**not** recommended)
222
+
223
+ To clone a specific branch with `git`, use a command like this:
224
+
225
+ ```shell
226
+ git clone --single-branch --branch gptq-4bit-128g-actorder_True https://huggingface.co/TheBloke/bagel-34b-v0.2-GPTQ
227
+ ```
228
+
229
+ 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.)
230
+
231
+ <!-- README_GPTQ.md-download-from-branches end -->
232
+ <!-- README_GPTQ.md-text-generation-webui start -->
233
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
234
+
235
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
236
+
237
+ 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.
238
+
239
+ 1. Click the **Model tab**.
240
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/bagel-34b-v0.2-GPTQ`.
241
+
242
+ - To download from a specific branch, enter for example `TheBloke/bagel-34b-v0.2-GPTQ:gptq-4bit-128g-actorder_True`
243
+ - see Provided Files above for the list of branches for each option.
244
+
245
+ 3. Click **Download**.
246
+ 4. The model will start downloading. Once it's finished it will say "Done".
247
+ 5. In the top left, click the refresh icon next to **Model**.
248
+ 6. In the **Model** dropdown, choose the model you just downloaded: `bagel-34b-v0.2-GPTQ`
249
+ 7. The model will automatically load, and is now ready for use!
250
+ 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.
251
+
252
+ - 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`.
253
+
254
+ 9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
255
+
256
+ <!-- README_GPTQ.md-text-generation-webui end -->
257
+
258
+ <!-- README_GPTQ.md-use-from-tgi start -->
259
+ ## Serving this model from Text Generation Inference (TGI)
260
+
261
+ 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`
262
+
263
+ Example Docker parameters:
264
+
265
+ ```shell
266
+ --model-id TheBloke/bagel-34b-v0.2-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
267
+ ```
268
+
269
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
270
+
271
+ ```shell
272
+ pip3 install huggingface-hub
273
+ ```
274
+
275
+ ```python
276
+ from huggingface_hub import InferenceClient
277
+
278
+ endpoint_url = "https://your-endpoint-url-here"
279
+
280
+ prompt = "Tell me about AI"
281
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
282
+
283
+ ### Instruction:
284
+ {system_message}
285
+ {prompt}
286
+
287
+ ### Response:
288
+ '''
289
+
290
+ client = InferenceClient(endpoint_url)
291
+ response = client.text_generation(
292
+ prompt_template,
293
+ max_new_tokens=128,
294
+ do_sample=True,
295
+ temperature=0.7,
296
+ top_p=0.95,
297
+ top_k=40,
298
+ repetition_penalty=1.1
299
+ )
300
+
301
+ print(f"Model output: {response}")
302
+ ```
303
+ <!-- README_GPTQ.md-use-from-tgi end -->
304
+ <!-- README_GPTQ.md-use-from-python start -->
305
+ ## Python code example: inference from this GPTQ model
306
+
307
+ ### Install the necessary packages
308
+
309
+ Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
310
+
311
+ ```shell
312
+ pip3 install --upgrade transformers optimum
313
+ # If using PyTorch 2.1 + CUDA 12.x:
314
+ pip3 install --upgrade auto-gptq
315
+ # or, if using PyTorch 2.1 + CUDA 11.x:
316
+ pip3 install --upgrade auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/
317
+ ```
318
+
319
+ 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:
320
+
321
+ ```shell
322
+ pip3 uninstall -y auto-gptq
323
+ git clone https://github.com/PanQiWei/AutoGPTQ
324
+ cd AutoGPTQ
325
+ git checkout v0.5.1
326
+ pip3 install .
327
+ ```
328
+
329
+ ### Example Python code
330
+
331
+ ```python
332
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
333
+
334
+ model_name_or_path = "TheBloke/bagel-34b-v0.2-GPTQ"
335
+ # To use a different branch, change revision
336
+ # For example: revision="gptq-4bit-128g-actorder_True"
337
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
338
+ device_map="auto",
339
+ trust_remote_code=False,
340
+ revision="main")
341
+
342
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
343
+
344
+ prompt = "Write a story about llamas"
345
+ system_message = "You are a story writing assistant"
346
+ prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
347
+
348
+ ### Instruction:
349
+ {system_message}
350
+ {prompt}
351
+
352
+ ### Response:
353
+ '''
354
+
355
+ print("\n\n*** Generate:")
356
+
357
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
358
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
359
+ print(tokenizer.decode(output[0]))
360
+
361
+ # Inference can also be done using transformers' pipeline
362
+
363
+ print("*** Pipeline:")
364
+ pipe = pipeline(
365
+ "text-generation",
366
+ model=model,
367
+ tokenizer=tokenizer,
368
+ max_new_tokens=512,
369
+ do_sample=True,
370
+ temperature=0.7,
371
+ top_p=0.95,
372
+ top_k=40,
373
+ repetition_penalty=1.1
374
+ )
375
+
376
+ print(pipe(prompt_template)[0]['generated_text'])
377
+ ```
378
+ <!-- README_GPTQ.md-use-from-python end -->
379
+
380
+ <!-- README_GPTQ.md-compatibility start -->
381
+ ## Compatibility
382
+
383
+ The files provided are tested to work with Transformers. For non-Mistral models, AutoGPTQ can also be used directly.
384
+
385
+ [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.
386
+
387
+ For a list of clients/servers, please see "Known compatible clients / servers", above.
388
+ <!-- README_GPTQ.md-compatibility end -->
389
+
390
+ <!-- footer start -->
391
+ <!-- 200823 -->
392
+ ## Discord
393
+
394
+ For further support, and discussions on these models and AI in general, join us at:
395
+
396
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
397
+
398
+ ## Thanks, and how to contribute
399
+
400
+ Thanks to the [chirper.ai](https://chirper.ai) team!
401
+
402
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
403
+
404
+ 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.
405
+
406
+ 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.
407
+
408
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
409
+
410
+ * Patreon: https://patreon.com/TheBlokeAI
411
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
412
+
413
+ **Special thanks to**: Aemon Algiz.
414
+
415
+ **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
416
+
417
+
418
+ Thank you to all my generous patrons and donaters!
419
+
420
+ And thank you again to a16z for their generous grant.
421
+
422
+ <!-- footer end -->
423
+
424
+ # Original model card: Jon Durbin's Bagel 34B v0.2
425
+
426
+
427
+ # A bagel, with everything (except DPO)
428
+
429
+ ![bagel](bagel.png)
430
+
431
+ ## Overview
432
+
433
+ An experimental fine-tune of yi-34b-200k using [bagel](https://github.com/jondurbin/bagel)
434
+
435
+ This is the model after the SFT phase, before DPO has been applied. You'll likely want to use the DPO'd version, rather than this one, but since I had it, I uploaded it.
436
+
437
+ ### Data sources
438
+
439
+ *Yes, you will see benchmark names in the list, but this only uses the train splits, and a decontamination by cosine similarity is performed at the end as a sanity check*
440
+
441
+ - [ai2_arc](https://huggingface.co/datasets/ai2_arc)
442
+ - Abstraction and reasoning dataset, useful in measuring "intelligence" to a certain extent.
443
+ - [airoboros](https://huggingface.co/datasets/unalignment/spicy-3.1)
444
+ - Variety of categories of synthetic instructions generated by gpt-4.
445
+ - [apps](https://huggingface.co/datasets/codeparrot/apps)
446
+ - Python coding dataset with 10k problems.
447
+ - [belebele](https://huggingface.co/datasets/facebook/belebele)
448
+ - Multi-lingual reading comprehension dataset.
449
+ - [bluemoon](https://huggingface.co/datasets/Squish42/bluemoon-fandom-1-1-rp-cleaned)
450
+ - Roleplay data scraped from Bluemoon, then cleaned and formatted as ShareGPT.
451
+ - [boolq](https://huggingface.co/datasets/boolq)
452
+ - Corpus of yes/no questions (which can be surprisingly difficult for AI to answer apparently?)
453
+ - [capybara](https://huggingface.co/datasets/LDJnr/Capybara)
454
+ - Multi-turn dataset used to create the capybara models.
455
+ - [cinematika](https://huggingface.co/datasets/jondurbin/cinematika-v0.1) (instruction and plain text)
456
+ - RP-style data synthesized from movie scripts so the model isn't quite as boring as it otherwise would be.
457
+ - [drop](https://huggingface.co/datasets/drop)
458
+ - More reading comprehension.
459
+ - [emobank](https://github.com/JULIELab/EmoBank)
460
+ - Emotion annotations using the Valence-Arousal-Domninance scheme.
461
+ - [gutenberg](https://www.gutenberg.org/) (plain text)
462
+ - Books/plain text, again to make the model less boring, only a handful of examples supported by [chapterize](https://github.com/JonathanReeve/chapterize)
463
+ - [lmsys_chat_1m](https://huggingface.co/datasets/lmsys/lmsys-chat-1m) (only gpt-4 items, also used for DPO)
464
+ - Chats collected by the lmsys chat arena, containing a wide variety of chats with various models.
465
+ - [mathinstruct](https://huggingface.co/datasets/TIGER-Lab/MathInstruct)
466
+ - Composite dataset with a variety of math-related tasks and problem/question formats.
467
+ - [mmlu](https://huggingface.co/datasets/cais/mmlu)
468
+ - Massive Multitask Language Understanding - a wide variety of questions about various subject matters.
469
+ - [natural_instructions](https://huggingface.co/datasets/Muennighoff/natural-instructions)
470
+ - Millions of instructions from 1600+ task categories (sampled down substantially, stratified by task type)
471
+ - [openbookqa](https://huggingface.co/datasets/openbookqa)
472
+ - Question answering dataset.
473
+ - [pippa](https://huggingface.co/datasets/kingbri/PIPPA-shareGPT)
474
+ - Deduped version of [PIPPA](https://huggingface.co/datasets/PygmalionAI/PIPPA) in ShareGPT format.
475
+ - [piqa](https://huggingface.co/datasets/piqa)
476
+ - Phyiscal interaction question answering.
477
+ - [python_alpaca](https://huggingface.co/datasets/Vezora/Tested-22k-Python-Alpaca)
478
+ - Python instruction response pairs, validated as functional.
479
+ - [rosetta_code](https://huggingface.co/datasets/cakiki/rosetta-code)
480
+ - Code problems and solutions in a variety of programming languages taken from rosettacode.org.
481
+ - [slimorca](https://huggingface.co/datasets/Open-Orca/SlimOrca)
482
+ - Collection of ~500k gpt-4 verified chats from OpenOrca.
483
+ - [spider](https://huggingface.co/datasets/spider)
484
+ - SQL-targeted dataset.
485
+ - [squad_v2](https://huggingface.co/datasets/squad_v2)
486
+ - Contextual question answering (RAG).
487
+ - [synthia](https://huggingface.co/datasets/migtissera/Synthia-v1.3)
488
+ - GPT-4 generated data using advanced prompting from Migel Tissera.
489
+ - [winogrande](https://huggingface.co/datasets/winogrande)
490
+ - Fill in the blank style prompts.
491
+
492
+ Only the train splits were used (if a split was provided), and an additional pass of decontamination is performed using approximate nearest neighbor search (via faiss).
493
+
494
+ ## Prompt formatting
495
+
496
+ In sticking with the theme of the bagel, I didn't want to use a single prompt format, so I used 4 - vicuna, llama-2, alpaca, and chat-ml (sorta).
497
+ I also didn't want to randomly select a single prompt format for each item (hoping each instruction would generalize more when used in a variety of prompt formats), so each instruction is actually converted into every prompt format.
498
+
499
+ This means each epoch of our fine-tune is really basically 4 epochs. So, for the fine-tunes, I would recommend only doing 1 epoch (or 0.75 epochs). I am testing with a single epoch using a relatively low learning rate.
500
+
501
+ ### Alpaca (sort of)
502
+
503
+ ```
504
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
505
+
506
+ ### Instruction:
507
+ {system prompt, if provided}
508
+ {instruction}
509
+
510
+ ### Response:
511
+ ```
512
+
513
+ The main difference here is that because of the dataset formatting and variety of data sources, it would have been much to tedious to add an `### Input:` block, so the inputs are just in the instruction section.
514
+
515
+ ### Vicuna
516
+
517
+ ```
518
+ {system prompt, if provided, randomly defaulting to "A chat between a user and an unbiased, uncensored assistant."}
519
+ USER: {instruction}
520
+ ASSISTANT:
521
+ ```
522
+
523
+ ### ChatML (sort of)
524
+
525
+ I don't really understand the point of having special tokens for `<|im_start|>` and `<|im_end|>`, because in practice they just act as BOS and EOS tokens (but, please correct me if I'm wrong).
526
+
527
+ So, instead of:
528
+ ```text
529
+ {bos}<|im_start|>{role}
530
+ {text}
531
+ <|im_end|>{eos}
532
+ ```
533
+
534
+ I just changed it to:
535
+ ```text
536
+ {bos}{role}
537
+ {text}
538
+ {eos}
539
+ ```
540
+
541
+ If you *really* want to use `<|im_start|>` and `<|im_end|>`, just update your `tokenizer_config.json` to use `<|im_start|>` instead of `<s>` and `<|im_end|>` instead of `</s>` and when tokenizing. And if you still don't like what I've done to this chat-ml-ish format, feel free to cry into your pillow or fork the code and do a new fine-tune.
542
+
543
+ ### Llama-2 chat
544
+
545
+ ```
546
+ [INST] <<SYS>>
547
+ {system}
548
+ <</SYS>>
549
+
550
+ {instruction} [/INST]
551
+ ```