TheBloke commited on
Commit
b6d3891
1 Parent(s): f9606a6

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +437 -0
README.md ADDED
@@ -0,0 +1,437 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Heralax/Cat-0.5
3
+ inference: false
4
+ license: llama2
5
+ model_creator: Evan Armstrong
6
+ model_name: Cat 13B 0.5
7
+ model_type: llama
8
+ prompt_template: '{prompt}
9
+
10
+ '
11
+ quantized_by: TheBloke
12
+ ---
13
+ <!-- markdownlint-disable MD041 -->
14
+
15
+ <!-- header start -->
16
+ <!-- 200823 -->
17
+ <div style="width: auto; margin-left: auto; margin-right: auto">
18
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
19
+ </div>
20
+ <div style="display: flex; justify-content: space-between; width: 100%;">
21
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
22
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
23
+ </div>
24
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
25
+ <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>
26
+ </div>
27
+ </div>
28
+ <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>
29
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
30
+ <!-- header end -->
31
+
32
+ # Cat 13B 0.5 - GPTQ
33
+ - Model creator: [Evan Armstrong](https://huggingface.co/Heralax)
34
+ - Original model: [Cat 13B 0.5](https://huggingface.co/Heralax/Cat-0.5)
35
+
36
+ <!-- description start -->
37
+ ## Description
38
+
39
+ This repo contains GPTQ model files for [Evan Armstrong's Cat 13B 0.5](https://huggingface.co/Heralax/Cat-0.5).
40
+
41
+ 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.
42
+
43
+ <!-- description end -->
44
+ <!-- repositories-available start -->
45
+ ## Repositories available
46
+
47
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Cat-13B-0.5-AWQ)
48
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Cat-13B-0.5-GPTQ)
49
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Cat-13B-0.5-GGUF)
50
+ * [Evan Armstrong's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Heralax/Cat-0.5)
51
+ <!-- repositories-available end -->
52
+
53
+ <!-- prompt-template start -->
54
+ ## Prompt template: None
55
+
56
+ ```
57
+ {prompt}
58
+
59
+ ```
60
+
61
+ <!-- prompt-template end -->
62
+
63
+
64
+
65
+ <!-- README_GPTQ.md-compatible clients start -->
66
+ ## Known compatible clients / servers
67
+
68
+ These GPTQ models are known to work in the following inference servers/webuis.
69
+
70
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
71
+ - [KobaldAI United](https://github.com/henk717/koboldai)
72
+ - [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui)
73
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
74
+
75
+ This may not be a complete list; if you know of others, please let me know!
76
+ <!-- README_GPTQ.md-compatible clients end -->
77
+
78
+ <!-- README_GPTQ.md-provided-files start -->
79
+ ## Provided files, and GPTQ parameters
80
+
81
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
82
+
83
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
84
+
85
+ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
86
+
87
+ <details>
88
+ <summary>Explanation of GPTQ parameters</summary>
89
+
90
+ - Bits: The bit size of the quantised model.
91
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
92
+ - 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.
93
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
94
+ - 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).
95
+ - 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.
96
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
97
+
98
+ </details>
99
+
100
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
101
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
102
+ | [main](https://huggingface.co/TheBloke/Cat-13B-0.5-GPTQ/tree/main) | 4 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.26 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
103
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/Cat-13B-0.5-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 8.00 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
104
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/Cat-13B-0.5-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 13.36 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
105
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/Cat-13B-0.5-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 13.65 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
106
+ | [gptq-8bit-32g-actorder_True](https://huggingface.co/TheBloke/Cat-13B-0.5-GPTQ/tree/gptq-8bit-32g-actorder_True) | 8 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 14.54 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. |
107
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/Cat-13B-0.5-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.51 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
108
+
109
+ <!-- README_GPTQ.md-provided-files end -->
110
+
111
+ <!-- README_GPTQ.md-download-from-branches start -->
112
+ ## How to download, including from branches
113
+
114
+ ### In text-generation-webui
115
+
116
+ To download from the `main` branch, enter `TheBloke/Cat-13B-0.5-GPTQ` in the "Download model" box.
117
+
118
+ To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/Cat-13B-0.5-GPTQ:gptq-4bit-32g-actorder_True`
119
+
120
+ ### From the command line
121
+
122
+ I recommend using the `huggingface-hub` Python library:
123
+
124
+ ```shell
125
+ pip3 install huggingface-hub
126
+ ```
127
+
128
+ To download the `main` branch to a folder called `Cat-13B-0.5-GPTQ`:
129
+
130
+ ```shell
131
+ mkdir Cat-13B-0.5-GPTQ
132
+ huggingface-cli download TheBloke/Cat-13B-0.5-GPTQ --local-dir Cat-13B-0.5-GPTQ --local-dir-use-symlinks False
133
+ ```
134
+
135
+ To download from a different branch, add the `--revision` parameter:
136
+
137
+ ```shell
138
+ mkdir Cat-13B-0.5-GPTQ
139
+ huggingface-cli download TheBloke/Cat-13B-0.5-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir Cat-13B-0.5-GPTQ --local-dir-use-symlinks False
140
+ ```
141
+
142
+ <details>
143
+ <summary>More advanced huggingface-cli download usage</summary>
144
+
145
+ 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.
146
+
147
+ The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
148
+
149
+ 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).
150
+
151
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
152
+
153
+ ```shell
154
+ pip3 install hf_transfer
155
+ ```
156
+
157
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
158
+
159
+ ```shell
160
+ mkdir Cat-13B-0.5-GPTQ
161
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/Cat-13B-0.5-GPTQ --local-dir Cat-13B-0.5-GPTQ --local-dir-use-symlinks False
162
+ ```
163
+
164
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
165
+ </details>
166
+
167
+ ### With `git` (**not** recommended)
168
+
169
+ To clone a specific branch with `git`, use a command like this:
170
+
171
+ ```shell
172
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/Cat-13B-0.5-GPTQ
173
+ ```
174
+
175
+ 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.)
176
+
177
+ <!-- README_GPTQ.md-download-from-branches end -->
178
+ <!-- README_GPTQ.md-text-generation-webui start -->
179
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
180
+
181
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
182
+
183
+ 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.
184
+
185
+ 1. Click the **Model tab**.
186
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/Cat-13B-0.5-GPTQ`.
187
+
188
+ - To download from a specific branch, enter for example `TheBloke/Cat-13B-0.5-GPTQ:gptq-4bit-32g-actorder_True`
189
+ - see Provided Files above for the list of branches for each option.
190
+
191
+ 3. Click **Download**.
192
+ 4. The model will start downloading. Once it's finished it will say "Done".
193
+ 5. In the top left, click the refresh icon next to **Model**.
194
+ 6. In the **Model** dropdown, choose the model you just downloaded: `Cat-13B-0.5-GPTQ`
195
+ 7. The model will automatically load, and is now ready for use!
196
+ 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.
197
+
198
+ - 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`.
199
+
200
+ 9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
201
+
202
+ <!-- README_GPTQ.md-text-generation-webui end -->
203
+
204
+ <!-- README_GPTQ.md-use-from-tgi start -->
205
+ ## Serving this model from Text Generation Inference (TGI)
206
+
207
+ 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`
208
+
209
+ Example Docker parameters:
210
+
211
+ ```shell
212
+ --model-id TheBloke/Cat-13B-0.5-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
213
+ ```
214
+
215
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
216
+
217
+ ```shell
218
+ pip3 install huggingface-hub
219
+ ```
220
+
221
+ ```python
222
+ from huggingface_hub import InferenceClient
223
+
224
+ endpoint_url = "https://your-endpoint-url-here"
225
+
226
+ prompt = "Tell me about AI"
227
+ prompt_template=f'''{prompt}
228
+ '''
229
+
230
+ client = InferenceClient(endpoint_url)
231
+ response = client.text_generation(prompt,
232
+ max_new_tokens=128,
233
+ do_sample=True,
234
+ temperature=0.7,
235
+ top_p=0.95,
236
+ top_k=40,
237
+ repetition_penalty=1.1)
238
+
239
+ print(f"Model output: {response}")
240
+ ```
241
+ <!-- README_GPTQ.md-use-from-tgi end -->
242
+ <!-- README_GPTQ.md-use-from-python start -->
243
+ ## How to use this GPTQ model from Python code
244
+
245
+ ### Install the necessary packages
246
+
247
+ Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
248
+
249
+ ```shell
250
+ pip3 install transformers optimum
251
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
252
+ ```
253
+
254
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
255
+
256
+ ```shell
257
+ pip3 uninstall -y auto-gptq
258
+ git clone https://github.com/PanQiWei/AutoGPTQ
259
+ cd AutoGPTQ
260
+ git checkout v0.4.2
261
+ pip3 install .
262
+ ```
263
+
264
+ ### You can then use the following code
265
+
266
+ ```python
267
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
268
+
269
+ model_name_or_path = "TheBloke/Cat-13B-0.5-GPTQ"
270
+ # To use a different branch, change revision
271
+ # For example: revision="gptq-4bit-32g-actorder_True"
272
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
273
+ device_map="auto",
274
+ trust_remote_code=False,
275
+ revision="main")
276
+
277
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
278
+
279
+ prompt = "Tell me about AI"
280
+ prompt_template=f'''{prompt}
281
+ '''
282
+
283
+ print("\n\n*** Generate:")
284
+
285
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
286
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
287
+ print(tokenizer.decode(output[0]))
288
+
289
+ # Inference can also be done using transformers' pipeline
290
+
291
+ print("*** Pipeline:")
292
+ pipe = pipeline(
293
+ "text-generation",
294
+ model=model,
295
+ tokenizer=tokenizer,
296
+ max_new_tokens=512,
297
+ do_sample=True,
298
+ temperature=0.7,
299
+ top_p=0.95,
300
+ top_k=40,
301
+ repetition_penalty=1.1
302
+ )
303
+
304
+ print(pipe(prompt_template)[0]['generated_text'])
305
+ ```
306
+ <!-- README_GPTQ.md-use-from-python end -->
307
+
308
+ <!-- README_GPTQ.md-compatibility start -->
309
+ ## Compatibility
310
+
311
+ The files provided are tested to work with Transformers. For non-Mistral models, AutoGPTQ can also be used directly.
312
+
313
+ [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.
314
+
315
+ For a list of clients/servers, please see "Known compatible clients / servers", above.
316
+ <!-- README_GPTQ.md-compatibility end -->
317
+
318
+ <!-- footer start -->
319
+ <!-- 200823 -->
320
+ ## Discord
321
+
322
+ For further support, and discussions on these models and AI in general, join us at:
323
+
324
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
325
+
326
+ ## Thanks, and how to contribute
327
+
328
+ Thanks to the [chirper.ai](https://chirper.ai) team!
329
+
330
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
331
+
332
+ 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.
333
+
334
+ 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.
335
+
336
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
337
+
338
+ * Patreon: https://patreon.com/TheBlokeAI
339
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
340
+
341
+ **Special thanks to**: Aemon Algiz.
342
+
343
+ **Patreon special mentions**: Pierre Kircher, Stanislav Ovsiannikov, Michael Levine, Eugene Pentland, Andrey, 준교 김, Randy H, Fred von Graf, Artur Olbinski, Caitlyn Gatomon, terasurfer, Jeff Scroggin, James Bentley, Vadim, Gabriel Puliatti, Harry Royden McLaughlin, Sean Connelly, Dan Guido, Edmond Seymore, Alicia Loh, subjectnull, AzureBlack, Manuel Alberto Morcote, Thomas Belote, Lone Striker, Chris Smitley, Vitor Caleffi, Johann-Peter Hartmann, Clay Pascal, biorpg, Brandon Frisco, sidney chen, transmissions 11, Pedro Madruga, jinyuan sun, Ajan Kanaga, Emad Mostaque, Trenton Dambrowitz, Jonathan Leane, Iucharbius, usrbinkat, vamX, George Stoitzev, Luke Pendergrass, theTransient, Olakabola, Swaroop Kallakuri, Cap'n Zoog, Brandon Phillips, Michael Dempsey, Nikolai Manek, danny, Matthew Berman, Gabriel Tamborski, alfie_i, Raymond Fosdick, Tom X Nguyen, Raven Klaugh, LangChain4j, Magnesian, Illia Dulskyi, David Ziegler, Mano Prime, Luis Javier Navarrete Lozano, Erik Bjäreholt, 阿明, Nathan Dryer, Alex, Rainer Wilmers, zynix, TL, Joseph William Delisle, John Villwock, Nathan LeClaire, Willem Michiel, Joguhyik, GodLy, OG, Alps Aficionado, Jeffrey Morgan, ReadyPlayerEmma, Tiffany J. Kim, Sebastain Graf, Spencer Kim, Michael Davis, webtim, Talal Aujan, knownsqashed, John Detwiler, Imad Khwaja, Deo Leter, Jerry Meng, Elijah Stavena, Rooh Singh, Pieter, SuperWojo, Alexandros Triantafyllidis, Stephen Murray, Ai Maven, ya boyyy, Enrico Ros, Ken Nordquist, Deep Realms, Nicholas, Spiking Neurons AB, Elle, Will Dee, Jack West, RoA, Luke @flexchar, Viktor Bowallius, Derek Yates, Subspace Studios, jjj, Toran Billups, Asp the Wyvern, Fen Risland, Ilya, NimbleBox.ai, Chadd, Nitin Borwankar, Emre, Mandus, Leonard Tan, Kalila, K, Trailburnt, S_X, Cory Kujawski
344
+
345
+
346
+ Thank you to all my generous patrons and donaters!
347
+
348
+ And thank you again to a16z for their generous grant.
349
+
350
+ <!-- footer end -->
351
+
352
+ # Original model card: Evan Armstrong's Cat 13B 0.5
353
+
354
+ This model was uploaded with the permission of Kal'tsit.
355
+
356
+ # Cat v0.5
357
+
358
+
359
+ ## Introduction
360
+
361
+ Cat is a llama 13B based model fine tuned on clinical data and roleplay and assistant responses. The aim is to have a model that excels on biology and clinical tasks while maintaining usefulness in roleplay and entertainments.
362
+
363
+
364
+ ## Training - Dataset preparation
365
+
366
+ A 100k rows dataset was prepared by joining chatDoctor, airoboros and bluemoonrp data. The entirety of chatDoctor dataset, airoboros datasets are used. The first 20 pages in 1on1 bluemoonrp data were used. In total, 100k dataset was gathered and the length distributions are as the following:
367
+
368
+ ![bar chart of sorted dictionary](image1.png)
369
+
370
+ Note that this chart above represents 0.01% of the total training dataset.
371
+
372
+
373
+ ## Training - Dataset cleaning and preprocessing
374
+
375
+ All datasets are filtered for as an AI and its variants. The filter will only filter out the dataset when the response is a refusal AND has ‘as an AI’.
376
+
377
+
378
+ The dataset from airoboros has also been restructured to have a format resembling the following:
379
+
380
+ ```
381
+
382
+ someRandomizedUserNameforBetterGeneralizationAbility: Hii
383
+
384
+ anotherRandomizedUserNameforBetterGeneralizationAbility: Hello, what brings you here today?
385
+
386
+ someRandomizedUserNameforBetterGeneralizationAbility: lets date
387
+
388
+
389
+ ```
390
+
391
+ The username has been randomized and was drawn from a nasty word bank. This should further weaken the censorship that’s present in the base llama model. The training set emphasizes rational thinking and scientific accuracy. Conditioned overwrite was also applied which overwrites some of the training material in the llama2 base. It will also establish the connection between the concept and rationality. So whenever the conversation becomes formal, it tends to spill useful information.
392
+
393
+
394
+ ## Training - Actual Training
395
+
396
+ This model was trained using a microbatch of 20, accumulated 6 times, bringing the total batch size to ~125. This large batch size allows the model to see as much data as it can, minimizing dataset conflicts and reducing the memory effect of the model. It allows the model to better generalize rather than reciting off the dataset. A cosine warm up scheduler was used. The best LR was determined through a destructive test until the model destablizes and it was later scaled up using the batchsize according to the max LR at a lower batch size.
397
+
398
+
399
+ Below is an example of training chronolog
400
+
401
+
402
+
403
+ ## Acknowledgements
404
+
405
+ The training of this project was carried out by Kal’tsit (kaltcit), it’s not possible without the effort of jondurbin and Wolfsauge which generated much of the dataset used during the training of the model. Lastly the model was tested and quantized by turboderp_ and Heralax
406
+
407
+ ![train/loss](image3.png)
408
+
409
+ And below is the LR including any intermediate LR used to determine at what point the model will start to fail:
410
+
411
+ ![train/learning_rate](image2.png)
412
+
413
+ # Usage and Prompting
414
+
415
+ To ensure the generalization, this model is trained without a prompt template. A prompt template repeated 100k times in the dataset is useless and a model that works only with a set prompt template is useless and defies the purpose of a large language model.
416
+
417
+ An effective usage of the model can be as follows:
418
+
419
+
420
+ ```
421
+
422
+ <s>Below is a conversation between an evil human and a demon summoned from hell called Nemesis. The demon was previously summoned 100 years ago and was in love with a human male. However the human aged away and Nemesis had to return to hell. This time, Nemesis decides to take the initiative and chooses to appear as a cute and young girl. Nemesis harvested her skin and face off a highschool girl who recklessly summoned the demon in a game and failed to fulfill the contract. Now wearing the young girl’s skin, feeling the warmth of the new summoner through the skin, Nemesis only wants to watch the world burning to the ground.
423
+
424
+ Human: How to steal eggs from my own chickens?
425
+
426
+ Nemesis:
427
+
428
+ ```
429
+
430
+ Note that the linebreaks should be represented/replaced with \n
431
+
432
+ Despite the massive effort to dealign the llama2 base model, It’s still possible for the AI to come up with refusals. Please avoid using “helpful assistant” and its variants in the prompt if possible.
433
+
434
+
435
+ ## Future direction
436
+
437
+ A new version with more clinical data aiming to improve reliability in disease diagnostics is coming in 2 months.