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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: jondurbin/airoboros-l2-13b-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 13B 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 13B 3.0 - GPTQ
|
41 |
+
- Model creator: [Jon Durbin](https://huggingface.co/jondurbin)
|
42 |
+
- Original model: [Airoboros L2 13B 3.0](https://huggingface.co/jondurbin/airoboros-l2-13b-3.0)
|
43 |
+
|
44 |
+
<!-- description start -->
|
45 |
+
## Description
|
46 |
+
|
47 |
+
This repo contains GPTQ model files for [Jon Durbin's Airoboros L2 13B 3.0](https://huggingface.co/jondurbin/airoboros-l2-13b-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-13B-3.0-AWQ)
|
56 |
+
* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/airoboros-l2-13B-3.0-GPTQ)
|
57 |
+
* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/airoboros-l2-13B-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-13b-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-13B-3.0-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. |
|
101 |
+
| [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/airoboros-l2-13B-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 | 8.00 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-13B-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 | 13.36 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-13B-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 | 13.65 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-13B-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 | 14.54 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-13B-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 | 7.51 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-13B-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-13B-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-13B-3.0-GPTQ`:
|
127 |
+
|
128 |
+
```shell
|
129 |
+
mkdir airoboros-l2-13B-3.0-GPTQ
|
130 |
+
huggingface-cli download TheBloke/airoboros-l2-13B-3.0-GPTQ --local-dir airoboros-l2-13B-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-13B-3.0-GPTQ
|
137 |
+
huggingface-cli download TheBloke/airoboros-l2-13B-3.0-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir airoboros-l2-13B-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-13B-3.0-GPTQ
|
159 |
+
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/airoboros-l2-13B-3.0-GPTQ --local-dir airoboros-l2-13B-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-13B-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-13B-3.0-GPTQ`.
|
185 |
+
- To download from a specific branch, enter for example `TheBloke/airoboros-l2-13B-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-13B-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-13B-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-13B-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 13B 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 |
+
### Fine tuning info
|
454 |
+
|
455 |
+
https://wandb.ai/jondurbin/airoboros-l2-13b-3.0/runs/97utxyk9?workspace=user-jondurbin
|
456 |
+
|
457 |
+
### Helpful usage tips
|
458 |
+
|
459 |
+
|
460 |
+
#### MathJSON
|
461 |
+
|
462 |
+
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/
|
463 |
+
|
464 |
+
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)
|
465 |
+
|
466 |
+
__Use a very low temperature!__
|
467 |
+
|
468 |
+
Example:
|
469 |
+
|
470 |
+
```
|
471 |
+
[INST] <<SYS>>
|
472 |
+
You are an assistant with vast knowledge in all things math.
|
473 |
+
<</SYS>
|
474 |
+
|
475 |
+
Create a MathJSON solution to the following: Calculate the area of a circle with radius of 17.2456cm. Include your reasoning. [/INST]
|
476 |
+
```
|
477 |
+
|
478 |
+
Output:
|
479 |
+
```
|
480 |
+
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.
|
481 |
+
|
482 |
+
Once we have the radius in meters, we can calculate the area of the circle using the formula A = πr².
|
483 |
+
|
484 |
+
Solution as MathJSON:
|
485 |
+
<mathjson>
|
486 |
+
[
|
487 |
+
"Multiply",
|
488 |
+
"Pi",
|
489 |
+
[
|
490 |
+
"Power",
|
491 |
+
17.2456,
|
492 |
+
2
|
493 |
+
]
|
494 |
+
]
|
495 |
+
</mathjson>
|
496 |
+
```
|
497 |
+
|
498 |
+
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.
|
499 |
+
|
500 |
+
#### Context obedient question answering
|
501 |
+
|
502 |
+
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.
|
503 |
+
|
504 |
+
The format for a closed-context prompt is as follows:
|
505 |
+
```
|
506 |
+
BEGININPUT
|
507 |
+
BEGINCONTEXT
|
508 |
+
[key0: value0]
|
509 |
+
[key1: value1]
|
510 |
+
... other metdata ...
|
511 |
+
ENDCONTEXT
|
512 |
+
[insert your text blocks here]
|
513 |
+
ENDINPUT
|
514 |
+
[add as many other blocks, in the exact same format]
|
515 |
+
BEGININSTRUCTION
|
516 |
+
[insert your instruction(s). The model was tuned with single questions, paragraph format, lists, etc.]
|
517 |
+
ENDINSTRUCTION
|
518 |
+
```
|
519 |
+
|
520 |
+
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.
|
521 |
+
|
522 |
+
*The __only__ prompts that need this closed context formating are closed-context instructions. Normal questions/instructions do not!*
|
523 |
+
|
524 |
+
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.
|
525 |
+
- `BEGININPUT` - denotes a new input block
|
526 |
+
- `BEGINCONTEXT` - denotes the block of context (metadata key/value pairs) to associate with the current input block
|
527 |
+
- `ENDCONTEXT` - denotes the end of the metadata block for the current input
|
528 |
+
- [text] - Insert whatever text you want for the input block, as many paragraphs as can fit in the context.
|
529 |
+
- `ENDINPUT` - denotes the end of the current input block
|
530 |
+
- [repeat as many input blocks in this format as you want]
|
531 |
+
- `BEGININSTRUCTION` - denotes the start of the list (or one) instruction(s) to respond to for all of the input blocks above.
|
532 |
+
- [instruction(s)]
|
533 |
+
- `ENDINSTRUCTION` - denotes the end of instruction set
|
534 |
+
|
535 |
+
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.
|
536 |
+
|
537 |
+
__Use a very low temperature!__
|
538 |
+
|
539 |
+
Here's a trivial, but important example to prove the point:
|
540 |
+
```
|
541 |
+
BEGININPUT
|
542 |
+
BEGINCONTEXT
|
543 |
+
date: 2021-01-01
|
544 |
+
url: https://web.site/123
|
545 |
+
ENDCONTEXT
|
546 |
+
In a shocking turn of events, blueberries are now green, but will be sticking with the same name.
|
547 |
+
ENDINPUT
|
548 |
+
BEGININSTRUCTION
|
549 |
+
What color are bluberries? Source?
|
550 |
+
ENDINSTRUCTION
|
551 |
+
```
|
552 |
+
|
553 |
+
And the response:
|
554 |
+
```
|
555 |
+
Blueberries are now green.
|
556 |
+
Source:
|
557 |
+
date: 2021-01-01
|
558 |
+
url: https://web.site/123
|
559 |
+
```
|
560 |
+
|
561 |
+
#### Summarization
|
562 |
+
|
563 |
+
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:
|
564 |
+
|
565 |
+
```
|
566 |
+
BEGININPUT
|
567 |
+
{text to summarize}
|
568 |
+
ENDINPUT
|
569 |
+
BEGININSTRUCTION
|
570 |
+
Summarize the input in around 130 words.
|
571 |
+
ENDINSTRUCTION
|
572 |
+
```
|
573 |
+
|
574 |
+
#### Getting longer responses
|
575 |
+
|
576 |
+
You can use a few techniques to get longer responses.
|
577 |
+
|
578 |
+
Detailed prompts, with explicit instruction for word count:
|
579 |
+
```
|
580 |
+
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.
|
581 |
+
|
582 |
+
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.
|
583 |
+
|
584 |
+
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.
|
585 |
+
|
586 |
+
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.
|
587 |
+
|
588 |
+
Your response should be approximately 2300 words.
|
589 |
+
```
|
590 |
+
|
591 |
+
Or, a simpler example:
|
592 |
+
```
|
593 |
+
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.
|
594 |
+
```
|
595 |
+
|
596 |
+
There are a few examples of next chapter completion as well, e.g.:
|
597 |
+
```
|
598 |
+
Write the next chapter of a historical fiction novel set in Paris during the 20th century.
|
599 |
+
|
600 |
+
Here's a summary of the previous chapter:
|
601 |
+
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.
|
602 |
+
|
603 |
+
Requirements for the next chapter:
|
604 |
+
|
605 |
+
1. Character Development of Margot and Lucien:
|
606 |
+
- 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.
|
607 |
+
- 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.
|
608 |
+
|
609 |
+
2. Exploration of Paris and the Couture House:
|
610 |
+
- 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.
|
611 |
+
- 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.
|
612 |
+
|
613 |
+
3. Emergence of the Subplot: The Lost Collection:
|
614 |
+
- 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.
|
615 |
+
- Revelation: Capture their shock as they realize the designs were plagiarized, the potential repercussions, and the opportunities it presents for Margot's career.
|
616 |
+
- Twist: End with a twist that suggests there are other stolen collections across Paris, setting up their new mission.
|
617 |
+
|
618 |
+
|
619 |
+
Your response should be approximately 650 words.
|
620 |
+
```
|
621 |
+
|
622 |
+
#### Coding
|
623 |
+
|
624 |
+
You can ask for fairly complex coding instructions with multiple criteria, e.g.:
|
625 |
+
|
626 |
+
```
|
627 |
+
Create a python application with the following requirements:
|
628 |
+
- Asyncio FastAPI webserver
|
629 |
+
- ping endpoint that returns the current date in JSON format
|
630 |
+
- file upload endpoint, which calculates the file's sha256 checksum, and checks postgres to deduplicate
|
631 |
+
```
|
632 |
+
|
633 |
+
Or inline criteria:
|
634 |
+
|
635 |
+
```
|
636 |
+
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.
|
637 |
+
```
|
638 |
+
|
639 |
+
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.:
|
640 |
+
|
641 |
+
```
|
642 |
+
Write a websocket application in node.js. PLAINFORMAT
|
643 |
+
```
|
644 |
+
|
645 |
+
#### Agent/function calling
|
646 |
+
|
647 |
+
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.
|
648 |
+
|
649 |
+
Example prompt:
|
650 |
+
```
|
651 |
+
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.
|
652 |
+
|
653 |
+
Input: I want to know how many times 'Python' is mentioned in my text file.
|
654 |
+
|
655 |
+
Available functions:
|
656 |
+
file_analytics:
|
657 |
+
description: This tool performs various operations on a text file.
|
658 |
+
params:
|
659 |
+
action: The operation we want to perform on the data, such as "count_occurrences", "find_line", etc.
|
660 |
+
filters:
|
661 |
+
keyword: The word or phrase we want to search for.
|
662 |
+
```
|
663 |
+
|
664 |
+
Response:
|
665 |
+
```json
|
666 |
+
{
|
667 |
+
"function": "file_analytics",
|
668 |
+
"params": {
|
669 |
+
"action": "count_occurrences",
|
670 |
+
"filters": {
|
671 |
+
"keyword": "Python"
|
672 |
+
}
|
673 |
+
}
|
674 |
+
}
|
675 |
+
```
|
676 |
+
|
677 |
+
#### Chain-of-thought
|
678 |
+
|
679 |
+
You can ask for several possible responses to a given problem, with a ranking and final answer selection.
|
680 |
+
|
681 |
+
Example prompt:
|
682 |
+
|
683 |
+
```
|
684 |
+
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.
|
685 |
+
```
|
686 |
+
|
687 |
+
Example response:
|
688 |
+
```
|
689 |
+
Solution 1:
|
690 |
+
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).
|
691 |
+
|
692 |
+
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:
|
693 |
+
|
694 |
+
n(n-1)/2 = 45
|
695 |
+
|
696 |
+
Solving this equation gives us n=10.
|
697 |
+
|
698 |
+
Final answer: There were 10 players in the tournament.
|
699 |
+
|
700 |
+
Solution 2:
|
701 |
+
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.
|
702 |
+
|
703 |
+
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.
|
704 |
+
|
705 |
+
Final answer: There were 10 players in the tournament.
|
706 |
+
|
707 |
+
Solution 3:
|
708 |
+
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.
|
709 |
+
|
710 |
+
Final answer: There were 10 players in the tournament.
|
711 |
+
|
712 |
+
Ranking of solutions from best to worst:
|
713 |
+
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.
|
714 |
+
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.
|
715 |
+
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.
|
716 |
+
|
717 |
+
Best and final answer: There were 10 players in the tournament.
|
718 |
+
```
|
719 |
+
|
720 |
+
#### reWOO style execution planning
|
721 |
+
|
722 |
+
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!
|
723 |
+
|
724 |
+
Example prompt:
|
725 |
+
```
|
726 |
+
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
|
727 |
+
that could be the user's question, one or more prior evidence values, or a combination of both.
|
728 |
+
|
729 |
+
Here are the tools available to be called:
|
730 |
+
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.
|
731 |
+
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.
|
732 |
+
HyperlinkExtractor[input]: Extract links from plain text and produces a plain text, newline delimited response of links.
|
733 |
+
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:?
|
734 |
+
|
735 |
+
The output should be in format:
|
736 |
+
Plan: [first action to take based on input question]
|
737 |
+
:evidence0: = [function to call with input parameter]
|
738 |
+
Plan: [next action to take, based on result of :evidence0:]
|
739 |
+
:evidence1: = [next function to call and input parameter, which may include reference to previous evidence, e.g. "Given context :evidence0"]
|
740 |
+
...
|
741 |
+
Answer: [:evidence[n]: containing the final answer.]
|
742 |
+
|
743 |
+
Question: Who won the Nobel Prize in Literature in 2020 and what is their most famous work?
|
744 |
+
```
|
745 |
+
|
746 |
+
Response:
|
747 |
+
```
|
748 |
+
Plan: Begin by conducting a web search to find out who won the Nobel Prize in Literature in 2020.
|
749 |
+
:evidence0: = DuckDuckGo[Nobel Prize in Literature 2020 winner]
|
750 |
+
Plan: Utilize the KnowledgeModel to interpret the search results and find the name of the laureate.
|
751 |
+
:evidence1: = KnowledgeModel[Who won the Nobel Prize in Literature in 2020, given :evidence0:?]
|
752 |
+
Plan: Conduct another web search to find the most famous work of the identified laureate.
|
753 |
+
:evidence2: = DuckDuckGo[Most famous work of :evidence1:]
|
754 |
+
Plan: Extract the relevant links from the DuckDuckGo search results for a more focused search.
|
755 |
+
:evidence3: = HyperlinkExtractor[:evidence2:]
|
756 |
+
Plan: Use the TextScraper tool to extract information from the relevant links.
|
757 |
+
:evidence4: = TextScraper[:evidence3:]
|
758 |
+
Plan: Finally, utilize the KnowledgeModel to identify and summarize the most famous work of the laureate from the extracted information.
|
759 |
+
:evidence5: = KnowledgeModel[What is the most famous work of :evidence1:, given :evidence4:?]
|
760 |
+
Answer: :evidence5:
|
761 |
+
```
|
762 |
+
|
763 |
+
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:
|
764 |
+
|
765 |
+
```python
|
766 |
+
import re
|
767 |
+
import requests
|
768 |
+
|
769 |
+
def inject_context(input_text, **context):
|
770 |
+
for ref in set(re.findall(r"(:evidence[0-9]+:)", input_text, re.I)):
|
771 |
+
input_text = input_text.replace(ref, context.get(ref, ""))
|
772 |
+
return input_text
|
773 |
+
|
774 |
+
def duckduckgo(input_text, **context):
|
775 |
+
search_string = inject_context(input_text, **context)
|
776 |
+
... search via duck duck go using search_string
|
777 |
+
... return text content
|
778 |
+
|
779 |
+
def link_extractor(input_text, **context):
|
780 |
+
input_text = inject_context(input_text, **context)
|
781 |
+
return "\n".join(list(set(re.findall(r"(https?://[^\s]+?\.?)", input_text, re.I))))
|
782 |
+
|
783 |
+
def scrape(input_text, **context):
|
784 |
+
input_text = inject_context(input_text, **context)
|
785 |
+
text = []
|
786 |
+
for link in input_text.splitlines():
|
787 |
+
text.append(requests.get(link).text)
|
788 |
+
return "\n".join(text)
|
789 |
+
|
790 |
+
def infer(input_text, **context)
|
791 |
+
prompt = inject_context(input_text, **context)
|
792 |
+
... call model with prompt, return output
|
793 |
+
|
794 |
+
def parse_plan(plan):
|
795 |
+
method_map = {
|
796 |
+
"DuckDuckGo": duckduckgo,
|
797 |
+
"HyperlinkExtractor": link_extractor,
|
798 |
+
"KnowledgeModel": infer,
|
799 |
+
"TextScraper": scrape,
|
800 |
+
}
|
801 |
+
context = {}
|
802 |
+
for line in plan.strip().splitlines():
|
803 |
+
if line.startswith("Plan:"):
|
804 |
+
print(line)
|
805 |
+
continue
|
806 |
+
parts = re.match("^(:evidence[0-9]+:)\s*=\s*([^\[]+])(\[.*\])\s$", line, re.I)
|
807 |
+
if not parts:
|
808 |
+
if line.startswith("Answer: "):
|
809 |
+
return context.get(line.split(" ")[-1].strip(), "Answer couldn't be generated...")
|
810 |
+
raise RuntimeError("bad format: " + line)
|
811 |
+
context[parts.group(1)] = method_map[parts.group(2)](parts.group(3), **context)
|
812 |
+
```
|
813 |
+
|
814 |
+
### Contribute
|
815 |
+
|
816 |
+
If you're interested in new functionality, particularly a new "instructor" type to generate a specific type of training data,
|
817 |
+
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.
|
818 |
+
|
819 |
+
To help me with the OpenAI/compute costs:
|
820 |
+
|
821 |
+
- https://bmc.link/jondurbin
|
822 |
+
- ETH 0xce914eAFC2fe52FdceE59565Dd92c06f776fcb11
|
823 |
+
- BTC bc1qdwuth4vlg8x37ggntlxu5cjfwgmdy5zaa7pswf
|
824 |
+
|
825 |
+
### Licence and usage restrictions
|
826 |
+
|
827 |
+
The airoboros 3.0 models are built on top of multiple base models, each with their own license/restrictions.
|
828 |
+
|
829 |
+
The models with `-l2` in the name have a custom Meta license:
|
830 |
+
- See the [meta-license/LICENSE.txt](meta-license/LICENSE.txt) file attached for the original license provided by Meta.
|
831 |
+
- 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.
|
832 |
+
|
833 |
+
The models with `-m-` are mistral-7b (apache 2.0)
|
834 |
+
|
835 |
+
The model with `-3b` uses Stability AI, which as a `cc-by-sa-4.0` license.
|
836 |
+
|
837 |
+
The fine-tuning data was mostly generated by OpenAI API calls to gpt-4, via [airoboros](https://github.com/jondurbin/airoboros)
|
838 |
+
|
839 |
+
The ToS for OpenAI API usage has a clause preventing the output from being used to train a model that __competes__ with OpenAI
|
840 |
+
|
841 |
+
- what does *compete* actually mean here?
|
842 |
+
- 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
|
843 |
+
- 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
|
844 |
+
- 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
|
845 |
+
- 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
|
846 |
+
|
847 |
+
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.
|
848 |
+
|
849 |
+
Your best bet is probably to avoid using this commercially due to the OpenAI API usage.
|
850 |
+
|
851 |
+
Either way, by using this model, you agree to completely indemnify me.
|