TheBloke commited on
Commit
c90be67
1 Parent(s): c5518f6

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +847 -0
README.md ADDED
@@ -0,0 +1,847 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: jondurbin/airoboros-l2-7b-3.0
3
+ datasets:
4
+ - jondurbin/airoboros-3.0
5
+ inference: false
6
+ license: llama2
7
+ model_creator: Jon Durbin
8
+ model_name: Airoboros L2 7B 3.0
9
+ model_type: llama
10
+ prompt_template: '[INST] <<SYS>>
11
+
12
+ You are a help, unbiased, uncensored assistant.
13
+
14
+ <</SYS>
15
+
16
+
17
+ {prompt} [/INST]
18
+
19
+ '
20
+ quantized_by: TheBloke
21
+ ---
22
+
23
+ <!-- header start -->
24
+ <!-- 200823 -->
25
+ <div style="width: auto; margin-left: auto; margin-right: auto">
26
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
27
+ </div>
28
+ <div style="display: flex; justify-content: space-between; width: 100%;">
29
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
30
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
31
+ </div>
32
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
33
+ <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>
34
+ </div>
35
+ </div>
36
+ <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>
37
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
38
+ <!-- header end -->
39
+
40
+ # Airoboros L2 7B 3.0 - GPTQ
41
+ - Model creator: [Jon Durbin](https://huggingface.co/jondurbin)
42
+ - Original model: [Airoboros L2 7B 3.0](https://huggingface.co/jondurbin/airoboros-l2-7b-3.0)
43
+
44
+ <!-- description start -->
45
+ ## Description
46
+
47
+ This repo contains GPTQ model files for [Jon Durbin's Airoboros L2 7B 3.0](https://huggingface.co/jondurbin/airoboros-l2-7b-3.0).
48
+
49
+ 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.
50
+
51
+ <!-- description end -->
52
+ <!-- repositories-available start -->
53
+ ## Repositories available
54
+
55
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/airoboros-l2-7B-3.0-AWQ)
56
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/airoboros-l2-7B-3.0-GPTQ)
57
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/airoboros-l2-7B-3.0-GGUF)
58
+ * [Jon Durbin's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/jondurbin/airoboros-l2-7b-3.0)
59
+ <!-- repositories-available end -->
60
+
61
+ <!-- prompt-template start -->
62
+ ## Prompt template: Llama-2-Uncensored
63
+
64
+ ```
65
+ [INST] <<SYS>>
66
+ You are a help, unbiased, uncensored assistant.
67
+ <</SYS>
68
+
69
+ {prompt} [/INST]
70
+
71
+ ```
72
+
73
+ <!-- prompt-template end -->
74
+
75
+
76
+ <!-- README_GPTQ.md-provided-files start -->
77
+ ## Provided files, and GPTQ parameters
78
+
79
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
80
+
81
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
82
+
83
+ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
84
+
85
+ <details>
86
+ <summary>Explanation of GPTQ parameters</summary>
87
+
88
+ - Bits: The bit size of the quantised model.
89
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
90
+ - 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.
91
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
92
+ - 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).
93
+ - 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.
94
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
95
+
96
+ </details>
97
+
98
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
99
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
100
+ | [main](https://huggingface.co/TheBloke/airoboros-l2-7B-3.0-GPTQ/tree/main) | 4 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 3.90 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
101
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/airoboros-l2-7B-3.0-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.28 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
102
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/airoboros-l2-7B-3.0-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.01 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
103
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/airoboros-l2-7B-3.0-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.16 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
104
+ | [gptq-8bit-32g-actorder_True](https://huggingface.co/TheBloke/airoboros-l2-7B-3.0-GPTQ/tree/gptq-8bit-32g-actorder_True) | 8 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.62 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. |
105
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/airoboros-l2-7B-3.0-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.02 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
106
+
107
+ <!-- README_GPTQ.md-provided-files end -->
108
+
109
+ <!-- README_GPTQ.md-download-from-branches start -->
110
+ ## How to download, including from branches
111
+
112
+ ### In text-generation-webui
113
+
114
+ To download from the `main` branch, enter `TheBloke/airoboros-l2-7B-3.0-GPTQ` in the "Download model" box.
115
+
116
+ To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/airoboros-l2-7B-3.0-GPTQ:gptq-4bit-32g-actorder_True`
117
+
118
+ ### From the command line
119
+
120
+ I recommend using the `huggingface-hub` Python library:
121
+
122
+ ```shell
123
+ pip3 install huggingface-hub
124
+ ```
125
+
126
+ To download the `main` branch to a folder called `airoboros-l2-7B-3.0-GPTQ`:
127
+
128
+ ```shell
129
+ mkdir airoboros-l2-7B-3.0-GPTQ
130
+ huggingface-cli download TheBloke/airoboros-l2-7B-3.0-GPTQ --local-dir airoboros-l2-7B-3.0-GPTQ --local-dir-use-symlinks False
131
+ ```
132
+
133
+ To download from a different branch, add the `--revision` parameter:
134
+
135
+ ```shell
136
+ mkdir airoboros-l2-7B-3.0-GPTQ
137
+ huggingface-cli download TheBloke/airoboros-l2-7B-3.0-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir airoboros-l2-7B-3.0-GPTQ --local-dir-use-symlinks False
138
+ ```
139
+
140
+ <details>
141
+ <summary>More advanced huggingface-cli download usage</summary>
142
+
143
+ If you remove the `--local-dir-use-symlinks False` parameter, the files will instead be stored in the central Huggingface 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.
144
+
145
+ The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
146
+
147
+ 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).
148
+
149
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
150
+
151
+ ```shell
152
+ pip3 install hf_transfer
153
+ ```
154
+
155
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
156
+
157
+ ```shell
158
+ mkdir airoboros-l2-7B-3.0-GPTQ
159
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/airoboros-l2-7B-3.0-GPTQ --local-dir airoboros-l2-7B-3.0-GPTQ --local-dir-use-symlinks False
160
+ ```
161
+
162
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
163
+ </details>
164
+
165
+ ### With `git` (**not** recommended)
166
+
167
+ To clone a specific branch with `git`, use a command like this:
168
+
169
+ ```shell
170
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/airoboros-l2-7B-3.0-GPTQ
171
+ ```
172
+
173
+ 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.)
174
+
175
+ <!-- README_GPTQ.md-download-from-branches end -->
176
+ <!-- README_GPTQ.md-text-generation-webui start -->
177
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
178
+
179
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
180
+
181
+ 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.
182
+
183
+ 1. Click the **Model tab**.
184
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/airoboros-l2-7B-3.0-GPTQ`.
185
+ - To download from a specific branch, enter for example `TheBloke/airoboros-l2-7B-3.0-GPTQ:gptq-4bit-32g-actorder_True`
186
+ - see Provided Files above for the list of branches for each option.
187
+ 3. Click **Download**.
188
+ 4. The model will start downloading. Once it's finished it will say "Done".
189
+ 5. In the top left, click the refresh icon next to **Model**.
190
+ 6. In the **Model** dropdown, choose the model you just downloaded: `airoboros-l2-7B-3.0-GPTQ`
191
+ 7. The model will automatically load, and is now ready for use!
192
+ 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.
193
+ * 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`.
194
+ 9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
195
+
196
+ <!-- README_GPTQ.md-text-generation-webui end -->
197
+
198
+ <!-- README_GPTQ.md-use-from-tgi start -->
199
+ ## Serving this model from Text Generation Inference (TGI)
200
+
201
+ 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`
202
+
203
+ Example Docker parameters:
204
+
205
+ ```shell
206
+ --model-id TheBloke/airoboros-l2-7B-3.0-GPTQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
207
+ ```
208
+
209
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
210
+
211
+ ```shell
212
+ pip3 install huggingface-hub
213
+ ```
214
+
215
+ ```python
216
+ from huggingface_hub import InferenceClient
217
+
218
+ endpoint_url = "https://your-endpoint-url-here"
219
+
220
+ prompt = "Tell me about AI"
221
+ prompt_template=f'''[INST] <<SYS>>
222
+ You are a help, unbiased, uncensored assistant.
223
+ <</SYS>
224
+
225
+ {prompt} [/INST]
226
+ '''
227
+
228
+ client = InferenceClient(endpoint_url)
229
+ response = client.text_generation(prompt,
230
+ max_new_tokens=128,
231
+ do_sample=True,
232
+ temperature=0.7,
233
+ top_p=0.95,
234
+ top_k=40,
235
+ repetition_penalty=1.1)
236
+
237
+ print(f"Model output: {response}")
238
+ ```
239
+ <!-- README_GPTQ.md-use-from-tgi end -->
240
+ <!-- README_GPTQ.md-use-from-python start -->
241
+ ## How to use this GPTQ model from Python code
242
+
243
+ ### Install the necessary packages
244
+
245
+ Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
246
+
247
+ ```shell
248
+ pip3 install transformers optimum
249
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
250
+ ```
251
+
252
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
253
+
254
+ ```shell
255
+ pip3 uninstall -y auto-gptq
256
+ git clone https://github.com/PanQiWei/AutoGPTQ
257
+ cd AutoGPTQ
258
+ git checkout v0.4.2
259
+ pip3 install .
260
+ ```
261
+
262
+ ### You can then use the following code
263
+
264
+ ```python
265
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
266
+
267
+ model_name_or_path = "TheBloke/airoboros-l2-7B-3.0-GPTQ"
268
+ # To use a different branch, change revision
269
+ # For example: revision="gptq-4bit-32g-actorder_True"
270
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
271
+ device_map="auto",
272
+ trust_remote_code=False,
273
+ revision="main")
274
+
275
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
276
+
277
+ prompt = "Tell me about AI"
278
+ prompt_template=f'''[INST] <<SYS>>
279
+ You are a help, unbiased, uncensored assistant.
280
+ <</SYS>
281
+
282
+ {prompt} [/INST]
283
+ '''
284
+
285
+ print("\n\n*** Generate:")
286
+
287
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
288
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
289
+ print(tokenizer.decode(output[0]))
290
+
291
+ # Inference can also be done using transformers' pipeline
292
+
293
+ print("*** Pipeline:")
294
+ pipe = pipeline(
295
+ "text-generation",
296
+ model=model,
297
+ tokenizer=tokenizer,
298
+ max_new_tokens=512,
299
+ do_sample=True,
300
+ temperature=0.7,
301
+ top_p=0.95,
302
+ top_k=40,
303
+ repetition_penalty=1.1
304
+ )
305
+
306
+ print(pipe(prompt_template)[0]['generated_text'])
307
+ ```
308
+ <!-- README_GPTQ.md-use-from-python end -->
309
+
310
+ <!-- README_GPTQ.md-compatibility start -->
311
+ ## Compatibility
312
+
313
+ The files provided are tested to work with AutoGPTQ, both via Transformers and using AutoGPTQ directly. They should also work with [Occ4m's GPTQ-for-LLaMa fork](https://github.com/0cc4m/KoboldAI).
314
+
315
+ [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.
316
+
317
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
318
+ <!-- README_GPTQ.md-compatibility end -->
319
+
320
+ <!-- footer start -->
321
+ <!-- 200823 -->
322
+ ## Discord
323
+
324
+ For further support, and discussions on these models and AI in general, join us at:
325
+
326
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
327
+
328
+ ## Thanks, and how to contribute
329
+
330
+ Thanks to the [chirper.ai](https://chirper.ai) team!
331
+
332
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
333
+
334
+ 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.
335
+
336
+ 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.
337
+
338
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
339
+
340
+ * Patreon: https://patreon.com/TheBlokeAI
341
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
342
+
343
+ **Special thanks to**: Aemon Algiz.
344
+
345
+ **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
346
+
347
+
348
+ Thank you to all my generous patrons and donaters!
349
+
350
+ And thank you again to a16z for their generous grant.
351
+
352
+ <!-- footer end -->
353
+
354
+ # Original model card: Jon Durbin's Airoboros L2 7B 3.0
355
+
356
+
357
+ ### Overview
358
+
359
+ Another experimental model, using mostly sythetic data generated by [airoboros](https://github.com/jondurbin/airoboros)
360
+
361
+ #### IMPORTANT NOTE - llama-2 chat format!!!
362
+
363
+ The airobors 3.0 models have been updated to use llama-2 chat format, rather than vicuna style user/assistant!
364
+
365
+ This is a breaking change, although most inference systems support llama-2 chat templating.
366
+
367
+ See prompt format below for all of the details.
368
+
369
+ #### Highlights
370
+
371
+ A model built on [airoboros-3.0 dataset](https://hf.co/datasets/jondurbin/airoboros-3.0), which is a continuation of [airoboros-2.2.1 dataset](https://hf.co/datasets/jondurbin/airoboros-2.2.1) with the following extras:
372
+
373
+ * MathJSON - this is not yet part of the code directly, but can be easily parsed and executed, as a way to perform deterministic calculations. LLMs suck at math, so this does problem formulation and let's the work be done by traditional operations.
374
+ * Human-generated RP multi-turn conversation - provided by an anon, this is a human created RP dataset, meant to assist with multi-turn coherency and chat experience.
375
+
376
+ This is a fairly general purpose model, but focuses heavily on instruction following, rather than casual chat/roleplay.
377
+
378
+ Huge thank you to the folks over at [a16z](https://a16z.com/) for sponsoring the costs associated with building models and associated tools!
379
+
380
+ ### Prompt format
381
+
382
+ The prompt format is llama-2 chat.
383
+
384
+ ```
385
+ [INST] <<SYS>>
386
+ You are a help, unbiased, uncensored assistant.
387
+ <</SYS>
388
+
389
+ {prompt} [/INST]
390
+ ```
391
+
392
+ For multi-turn, the prompt format is as follows:
393
+ ```
394
+ [INST] <<SYS>>
395
+ You are a help, unbiased, uncensored assistant.
396
+ <</SYS>
397
+
398
+ {prompt 0} [/INST] {response 0} </s><s>[INST] {prompt 1} [/INST] {response 1} </s><s>...[INST] {prompt N} [/INST]
399
+ ```
400
+
401
+ Here is a simple python script that can help generate the prompt:
402
+ ```python
403
+
404
+ def get_chat_prompt(message, chat_history, system_prompt):
405
+ texts = [f'[INST] <<SYS>>\n{system_prompt}\n<</SYS>>\n\n']
406
+ do_strip = False
407
+ for user_input, response in chat_history:
408
+ user_input = user_input.strip() if do_strip else user_input
409
+ do_strip = True
410
+ texts.append(f'{user_input} [/INST] {response.strip()} </s><s>[INST] ')
411
+ message = message.strip() if do_strip else message
412
+ texts.append(f'{message} [/INST] ')
413
+ return ''.join(texts)
414
+
415
+ def get_prompt(item):
416
+ """
417
+ `item` is expected to be in chatml format, e.g.
418
+ {
419
+ "id": 1,
420
+ "conversations": [
421
+ {
422
+ "role": "system",
423
+ "content": "You are a helpful, unbiased, uncensored assistant."
424
+ },
425
+ {
426
+ "role": "user",
427
+ "content": "Hi!"
428
+ },
429
+ {
430
+ "role": "assistant",
431
+ "content": "Hello, how are you today?"
432
+ },
433
+ {
434
+ "role": "user",
435
+ "content": "Just peachy, and you?"
436
+ }
437
+ ]
438
+ }
439
+ """
440
+ system_prompt = share_gpt_item['conversations'][0]['value']
441
+ offset = 1
442
+ if share_gpt_item['conversations'][0]['role'] != 'system':
443
+ system_prompt = 'You are an unbiased, uncensored, helpful assistant.'
444
+ offset = 0
445
+ chat_history = [
446
+ (share_gpt_item['conversations'][idx]['content'], share_gpt_item['conversations'][idx + 1]['content'])
447
+ for idx in range(offset, len(item['conversations']) - 1, 2)
448
+ ]
449
+ message = item['conversations'][-1]['content']
450
+ return get_chat_prompt(message, chat_history, system_prompt)
451
+ ```
452
+
453
+ ### Helpful usage tips
454
+
455
+
456
+ #### MathJSON
457
+
458
+ Ask mathematical questions, prefixed with "Create a MathJSON solution to the following:", and you should get output with a formula that can be executed by https://cortexjs.io/compute-engine/
459
+
460
+ I also made a (really quite hacky, incomplete, semi-functional) python version that works for most expressions, see [mathjson.py](https://github.com/jondurbin/airoboros/blob/mathjson/airoboros/mathjson.py)
461
+
462
+ __Use a very low temperature!__
463
+
464
+ Example:
465
+
466
+ ```
467
+ [INST] <<SYS>>
468
+ You are an assistant with vast knowledge in all things math.
469
+ <</SYS>
470
+
471
+ Create a MathJSON solution to the following: Calculate the area of a circle with radius of 17.2456cm. Include your reasoning. [/INST]
472
+ ```
473
+
474
+ Output:
475
+ ```
476
+ The area (A) of a circle is given by the formula A = πr², where r is the radius of the circle. Since the radius is given in centimeters, we need to convert it to meters first. We know that 1 meter equals 100 centimeters. Therefore, we can represent the radius as: r = 17.2456 cm * 100/1.
477
+
478
+ Once we have the radius in meters, we can calculate the area of the circle using the formula A = πr².
479
+
480
+ Solution as MathJSON:
481
+ <mathjson>
482
+ [
483
+ "Multiply",
484
+ "Pi",
485
+ [
486
+ "Power",
487
+ 17.2456,
488
+ 2
489
+ ]
490
+ ]
491
+ </mathjson>
492
+ ```
493
+
494
+ You can then validate the JSON between `<mathjson>` and `</mathjson>`, then pass the parsed JSON to compute-engine JS or the `evaluate` function in mathjson.py to calculate the response.
495
+
496
+ #### Context obedient question answering
497
+
498
+ By obedient, I mean the model was trained to ignore what it thinks it knows, and uses the context to answer the question. The model was also tuned to limit the values to the provided context as much as possible to reduce hallucinations.
499
+
500
+ The format for a closed-context prompt is as follows:
501
+ ```
502
+ BEGININPUT
503
+ BEGINCONTEXT
504
+ [key0: value0]
505
+ [key1: value1]
506
+ ... other metdata ...
507
+ ENDCONTEXT
508
+ [insert your text blocks here]
509
+ ENDINPUT
510
+ [add as many other blocks, in the exact same format]
511
+ BEGININSTRUCTION
512
+ [insert your instruction(s). The model was tuned with single questions, paragraph format, lists, etc.]
513
+ ENDINSTRUCTION
514
+ ```
515
+
516
+ It's also helpful to add "Don't make up answers if you don't know." to your instruction block to make sure if the context is completely unrelated it doesn't make something up.
517
+
518
+ *The __only__ prompts that need this closed context formating are closed-context instructions. Normal questions/instructions do not!*
519
+
520
+ I know it's a bit verbose and annoying, but after much trial and error, using these explicit delimiters helps the model understand where to find the responses and how to associate specific sources with it.
521
+ - `BEGININPUT` - denotes a new input block
522
+ - `BEGINCONTEXT` - denotes the block of context (metadata key/value pairs) to associate with the current input block
523
+ - `ENDCONTEXT` - denotes the end of the metadata block for the current input
524
+ - [text] - Insert whatever text you want for the input block, as many paragraphs as can fit in the context.
525
+ - `ENDINPUT` - denotes the end of the current input block
526
+ - [repeat as many input blocks in this format as you want]
527
+ - `BEGININSTRUCTION` - denotes the start of the list (or one) instruction(s) to respond to for all of the input blocks above.
528
+ - [instruction(s)]
529
+ - `ENDINSTRUCTION` - denotes the end of instruction set
530
+
531
+ It sometimes works without `ENDINSTRUCTION`, but by explicitly including that in the prompt, the model better understands that all of the instructions in the block should be responded to.
532
+
533
+ __Use a very low temperature!__
534
+
535
+ Here's a trivial, but important example to prove the point:
536
+ ```
537
+ BEGININPUT
538
+ BEGINCONTEXT
539
+ date: 2021-01-01
540
+ url: https://web.site/123
541
+ ENDCONTEXT
542
+ In a shocking turn of events, blueberries are now green, but will be sticking with the same name.
543
+ ENDINPUT
544
+ BEGININSTRUCTION
545
+ What color are bluberries? Source?
546
+ ENDINSTRUCTION
547
+ ```
548
+
549
+ And the response:
550
+ ```
551
+ Blueberries are now green.
552
+ Source:
553
+ date: 2021-01-01
554
+ url: https://web.site/123
555
+ ```
556
+
557
+ #### Summarization
558
+
559
+ 500 samples have been included from [this dataset](https://huggingface.co/datasets/mattpscott/airoboros-summarization), using the same format as contextual question answering, for example:
560
+
561
+ ```
562
+ BEGININPUT
563
+ {text to summarize}
564
+ ENDINPUT
565
+ BEGININSTRUCTION
566
+ Summarize the input in around 130 words.
567
+ ENDINSTRUCTION
568
+ ```
569
+
570
+ #### Getting longer responses
571
+
572
+ You can use a few techniques to get longer responses.
573
+
574
+ Detailed prompts, with explicit instruction for word count:
575
+ ```
576
+ Please compose a narrative set in the heart of an ancient library, steeped in the scent of old parchment and ink. The protagonist should be a young scholar who is dedicated to studying the art of storytelling and its evolution throughout history. In her pursuit of knowledge, she stumbles upon a forgotten tome that seems to possess an unusual aura. This book has the ability to bring stories to life, literally manifesting characters and scenarios from within its pages into reality.
577
+
578
+ The main character must navigate through various epochs of storytelling - from oral traditions of tribal societies, through medieval minstrels' tales, to modern-day digital narratives - as they come alive around her. Each era presents its unique challenges and lessons about the power and impact of stories on human civilization.
579
+
580
+ One such character could be a sentient quill pen, who was once used by renowned authors of yesteryears and now holds their wisdom and experiences. It becomes her mentor, guiding her through this journey with witty remarks and insightful commentary.
581
+
582
+ Ensure that your tale encapsulates the thrill of adventure, the beauty of learning, and the profound connection between humans and their stories. All characters involved should be non-human entities. Feel free to explore creative liberties but maintain the mentioned elements.
583
+
584
+ Your response should be approximately 2300 words.
585
+ ```
586
+
587
+ Or, a simpler example:
588
+ ```
589
+ Please create a long, detailed story about a dragon in an old growth forest who, for some reason, begins speaking the words of the source code of linux.
590
+ ```
591
+
592
+ There are a few examples of next chapter completion as well, e.g.:
593
+ ```
594
+ Write the next chapter of a historical fiction novel set in Paris during the 20th century.
595
+
596
+ Here's a summary of the previous chapter:
597
+ In the vibrant city of Paris, amid the tumultuous changes of the 20th century, our protagonist Margot, an aspiring fashion designer, has just secured an apprenticeship at a prestigious couture house. She meets Lucien, a charming journalist who covers the fashion industry. Together they navigate the ever-changing world of fashion and society, uncovering secrets that reveal the intricate links between style, politics, and culture. As the chapter concludes, they decide to delve deeper into the hidden corners of the fashion world to unravel its mysteries.
598
+
599
+ Requirements for the next chapter:
600
+
601
+ 1. Character Development of Margot and Lucien:
602
+ - Margot's Evolution: Unfold more about Margot's past, her dreams of revolutionizing fashion, and her struggle to establish herself in a male-dominated industry. Illustrate her growing expertise, innovative ideas, and increasing dependence on Lucien.
603
+ - Lucien's Complexity: Introduce uncertainties surrounding Lucien's background and real motives. Increase suspense by suggesting undisclosed information he possesses, while also highlighting his wit and perceptiveness.
604
+
605
+ 2. Exploration of Paris and the Couture House:
606
+ - Paris: Elaborate their journey through the bustling streets of Paris, including encounters with iconic figures, social unrest, and relics from different eras of French history.
607
+ - The Couture House: Expand on the grandeur of the couture house they work in, filled with artistic masterpieces, intense competition, and cryptic notes hinting at a scandalous past.
608
+
609
+ 3. Emergence of the Subplot: The Lost Collection:
610
+ - Discovery: Have Margot and Lucien stumble upon a secret vault containing a lost collection designed before World War II, raising new questions about the previous owner and the influence of war on fashion.
611
+ - Revelation: Capture their shock as they realize the designs were plagiarized, the potential repercussions, and the opportunities it presents for Margot's career.
612
+ - Twist: End with a twist that suggests there are other stolen collections across Paris, setting up their new mission.
613
+
614
+
615
+ Your response should be approximately 650 words.
616
+ ```
617
+
618
+ #### Coding
619
+
620
+ You can ask for fairly complex coding instructions with multiple criteria, e.g.:
621
+
622
+ ```
623
+ Create a python application with the following requirements:
624
+ - Asyncio FastAPI webserver
625
+ - ping endpoint that returns the current date in JSON format
626
+ - file upload endpoint, which calculates the file's sha256 checksum, and checks postgres to deduplicate
627
+ ```
628
+
629
+ Or inline criteria:
630
+
631
+ ```
632
+ Write a multi-threaded TCP server in C that accepts a "GET [key]" input and "SET [key] [value]" input, and uses a binary tree to get and store the input values.
633
+ ```
634
+
635
+ You can also optionally add a single space and "PLAINFORMAT" at the end of your prompt to avoid backticks, explanations, etc. and just print the code, e.g.:
636
+
637
+ ```
638
+ Write a websocket application in node.js. PLAINFORMAT
639
+ ```
640
+
641
+ #### Agent/function calling
642
+
643
+ The dataset includes many examples of function/args generation based on input criteria. This is somewhat similar to the OpenAI function calling, but the output is either JSON or YAML.
644
+
645
+ Example prompt:
646
+ ```
647
+ As an AI assistant, please select the most suitable function and parameters from the list of available functions below, based on the user's input. Provide your response in JSON format.
648
+
649
+ Input: I want to know how many times 'Python' is mentioned in my text file.
650
+
651
+ Available functions:
652
+ file_analytics:
653
+ description: This tool performs various operations on a text file.
654
+ params:
655
+ action: The operation we want to perform on the data, such as "count_occurrences", "find_line", etc.
656
+ filters:
657
+ keyword: The word or phrase we want to search for.
658
+ ```
659
+
660
+ Response:
661
+ ```json
662
+ {
663
+ "function": "file_analytics",
664
+ "params": {
665
+ "action": "count_occurrences",
666
+ "filters": {
667
+ "keyword": "Python"
668
+ }
669
+ }
670
+ }
671
+ ```
672
+
673
+ #### Chain-of-thought
674
+
675
+ You can ask for several possible responses to a given problem, with a ranking and final answer selection.
676
+
677
+ Example prompt:
678
+
679
+ ```
680
+ A group of people decide to play a round-robin tournament where every player plays every other player exactly once. If a total of 45 games were played, how many players participated in the tournament? Offer several potential answers, rank them according to mathematical logic, and pick the most feasible one.
681
+ ```
682
+
683
+ Example response:
684
+ ```
685
+ Solution 1:
686
+ In a round-robin tournament, each player plays every other player exactly once. This means that the total number of games played is equal to the combination of all players taken two at a time (since a game involves two players).
687
+
688
+ The formula for combinations is nC2 = n(n-1)/2, where n is the total number of players. We know that nC2 equals 45 (the total number of games), so we can set up the equation as follows:
689
+
690
+ n(n-1)/2 = 45
691
+
692
+ Solving this equation gives us n=10.
693
+
694
+ Final answer: There were 10 players in the tournament.
695
+
696
+ Solution 2:
697
+ Another way to approach this problem is by using the concept of triangular numbers. Triangular numbers are a sequence of numbers where each number can be represented as a triangle with dots. The nth triangular number is given by the sum of the first n natural numbers.
698
+
699
+ If we consider each game as a dot and each player as a side of the triangle, then the total number of games (45) would correspond to the 9th triangular number because 1+2+3+4+5+6+7+8+9=45. However, since each side of the triangle represents a player, and there's one more player than sides in our model (because the last player has no one left to play against), we need to add one more to get the total number of players.
700
+
701
+ Final answer: There were 10 players in the tournament.
702
+
703
+ Solution 3:
704
+ We could also use trial and error to solve this problem. Starting from a small number of players, we calculate how many games would be played in a round-robin tournament until we reach 45 games. For example, with 2 players, only 1 game is played; with 3 players, 3 games are played; with 4 players, 6 games are played, and so on. Continuing this process, we find that with 10 players, 45 games are played.
705
+
706
+ Final answer: There were 10 players in the tournament.
707
+
708
+ Ranking of solutions from best to worst:
709
+ 1. Solution 1: This solution uses direct mathematical reasoning based on the properties of a round-robin tournament and solves an equation to find the answer.
710
+ 2. Solution 2: This solution uses the concept of triangular numbers which requires additional steps and knowledge beyond the immediate problem context, but still arrives at the correct answer.
711
+ 3. Solution 3: This solution relies on trial and error, which is less efficient and reliable than the other methods, but it eventually gets to the right answer.
712
+
713
+ Best and final answer: There were 10 players in the tournament.
714
+ ```
715
+
716
+ #### reWOO style execution planning
717
+
718
+ The model now supports execution planning for complex instructions that would require making use of several tools. The output is just the plan, you must implement a mechanism to parse the output and actually call the functions!
719
+
720
+ Example prompt:
721
+ ```
722
+ Please construct a systematic plan to generate an optimal response to the user instruction, utilizing a set of provided tools. Each plan will correspond to an evidence value, which will be the output of one of the available functions given an input string
723
+ that could be the user's question, one or more prior evidence values, or a combination of both.
724
+
725
+ Here are the tools available to be called:
726
+ DuckDuckGo[input]: Tool that enables the user to search for information using the DuckDuckGo search engine. This tool is helpful in locating a suitable list of sites that may contain the answer to the user's query. It does not directly answer the question but finds a list of sites that might have the answer.
727
+ TextScraper[input]: Load one or more websites from the input string containing newline delimited links, where input is one or more links, and produces plain text output containing the content of the links.
728
+ HyperlinkExtractor[input]: Extract links from plain text and produces a plain text, newline delimited response of links.
729
+ KnowledgeModel[input]: Question answering language model, particularly useful in answering questions based on an input passage of text. The input must be a text question that references an :evidence[n]: variable, e.g. What color is the cat, given :evidence1:?
730
+
731
+ The output should be in format:
732
+ Plan: [first action to take based on input question]
733
+ :evidence0: = [function to call with input parameter]
734
+ Plan: [next action to take, based on result of :evidence0:]
735
+ :evidence1: = [next function to call and input parameter, which may include reference to previous evidence, e.g. "Given context :evidence0"]
736
+ ...
737
+ Answer: [:evidence[n]: containing the final answer.]
738
+
739
+ Question: Who won the Nobel Prize in Literature in 2020 and what is their most famous work?
740
+ ```
741
+
742
+ Response:
743
+ ```
744
+ Plan: Begin by conducting a web search to find out who won the Nobel Prize in Literature in 2020.
745
+ :evidence0: = DuckDuckGo[Nobel Prize in Literature 2020 winner]
746
+ Plan: Utilize the KnowledgeModel to interpret the search results and find the name of the laureate.
747
+ :evidence1: = KnowledgeModel[Who won the Nobel Prize in Literature in 2020, given :evidence0:?]
748
+ Plan: Conduct another web search to find the most famous work of the identified laureate.
749
+ :evidence2: = DuckDuckGo[Most famous work of :evidence1:]
750
+ Plan: Extract the relevant links from the DuckDuckGo search results for a more focused search.
751
+ :evidence3: = HyperlinkExtractor[:evidence2:]
752
+ Plan: Use the TextScraper tool to extract information from the relevant links.
753
+ :evidence4: = TextScraper[:evidence3:]
754
+ Plan: Finally, utilize the KnowledgeModel to identify and summarize the most famous work of the laureate from the extracted information.
755
+ :evidence5: = KnowledgeModel[What is the most famous work of :evidence1:, given :evidence4:?]
756
+ Answer: :evidence5:
757
+ ```
758
+
759
+ For this to be useful, you'd have to parse the output plan text, and implement/call each of the functions. This is just pseudo-code, completely untested off the top of my head, and obviously would requiring full implementation + hardening:
760
+
761
+ ```python
762
+ import re
763
+ import requests
764
+
765
+ def inject_context(input_text, **context):
766
+ for ref in set(re.findall(r"(:evidence[0-9]+:)", input_text, re.I)):
767
+ input_text = input_text.replace(ref, context.get(ref, ""))
768
+ return input_text
769
+
770
+ def duckduckgo(input_text, **context):
771
+ search_string = inject_context(input_text, **context)
772
+ ... search via duck duck go using search_string
773
+ ... return text content
774
+
775
+ def link_extractor(input_text, **context):
776
+ input_text = inject_context(input_text, **context)
777
+ return "\n".join(list(set(re.findall(r"(https?://[^\s]+?\.?)", input_text, re.I))))
778
+
779
+ def scrape(input_text, **context):
780
+ input_text = inject_context(input_text, **context)
781
+ text = []
782
+ for link in input_text.splitlines():
783
+ text.append(requests.get(link).text)
784
+ return "\n".join(text)
785
+
786
+ def infer(input_text, **context)
787
+ prompt = inject_context(input_text, **context)
788
+ ... call model with prompt, return output
789
+
790
+ def parse_plan(plan):
791
+ method_map = {
792
+ "DuckDuckGo": duckduckgo,
793
+ "HyperlinkExtractor": link_extractor,
794
+ "KnowledgeModel": infer,
795
+ "TextScraper": scrape,
796
+ }
797
+ context = {}
798
+ for line in plan.strip().splitlines():
799
+ if line.startswith("Plan:"):
800
+ print(line)
801
+ continue
802
+ parts = re.match("^(:evidence[0-9]+:)\s*=\s*([^\[]+])(\[.*\])\s$", line, re.I)
803
+ if not parts:
804
+ if line.startswith("Answer: "):
805
+ return context.get(line.split(" ")[-1].strip(), "Answer couldn't be generated...")
806
+ raise RuntimeError("bad format: " + line)
807
+ context[parts.group(1)] = method_map[parts.group(2)](parts.group(3), **context)
808
+ ```
809
+
810
+ ### Contribute
811
+
812
+ If you're interested in new functionality, particularly a new "instructor" type to generate a specific type of training data,
813
+ take a look at the dataset generation tool repo: https://github.com/jondurbin/airoboros and either make a PR or open an issue with details.
814
+
815
+ To help me with the OpenAI/compute costs:
816
+
817
+ - https://bmc.link/jondurbin
818
+ - ETH 0xce914eAFC2fe52FdceE59565Dd92c06f776fcb11
819
+ - BTC bc1qdwuth4vlg8x37ggntlxu5cjfwgmdy5zaa7pswf
820
+
821
+ ### Licence and usage restrictions
822
+
823
+ The airoboros 3.0 models are built on top of multiple base models, each with their own license/restrictions.
824
+
825
+ The models with `-l2` in the name have a custom Meta license:
826
+ - See the [meta-license/LICENSE.txt](meta-license/LICENSE.txt) file attached for the original license provided by Meta.
827
+ - See also [meta-license/USE_POLICY.md](meta-license/USE_POLICY.md) and [meta-license/Responsible-Use-Guide.pdf](meta-license/Responsible-Use-Guide.pdf), also provided by Meta.
828
+
829
+ The models with `-m-` are mistral-7b (apache 2.0)
830
+
831
+ The model with `-3b` uses Stability AI, which as a `cc-by-sa-4.0` license.
832
+
833
+ The fine-tuning data was mostly generated by OpenAI API calls to gpt-4, via [airoboros](https://github.com/jondurbin/airoboros)
834
+
835
+ The ToS for OpenAI API usage has a clause preventing the output from being used to train a model that __competes__ with OpenAI
836
+
837
+ - what does *compete* actually mean here?
838
+ - these small open source models will not produce output anywhere near the quality of gpt-4, or even gpt-3.5, so I can't imagine this could credibly be considered competing in the first place
839
+ - if someone else uses the dataset to do the same, they wouldn't necessarily be violating the ToS because they didn't call the API, so I don't know how that works
840
+ - the training data used in essentially all large language models includes a significant amount of copyrighted or otherwise non-permissive licensing in the first place
841
+ - other work using the self-instruct method, e.g. the original here: https://github.com/yizhongw/self-instruct released the data and model as apache-2
842
+
843
+ I am purposingly leaving this license ambiguous (other than the fact you must comply with the Meta original license for llama-2) because I am not a lawyer and refuse to attempt to interpret all of the terms accordingly.
844
+
845
+ Your best bet is probably to avoid using this commercially due to the OpenAI API usage.
846
+
847
+ Either way, by using this model, you agree to completely indemnify me.