Upload README.md
Browse files
README.md
ADDED
@@ -0,0 +1,412 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: Nexusflow/NexusRaven-13B
|
3 |
+
inference: false
|
4 |
+
license: llama2
|
5 |
+
model-index:
|
6 |
+
- name: NexusRaven-13B
|
7 |
+
results: []
|
8 |
+
model_creator: Nexusflow
|
9 |
+
model_name: Nexusraven 13B
|
10 |
+
model_type: llama
|
11 |
+
prompt_template: '{prompt}
|
12 |
+
|
13 |
+
'
|
14 |
+
quantized_by: TheBloke
|
15 |
+
---
|
16 |
+
|
17 |
+
<!-- header start -->
|
18 |
+
<!-- 200823 -->
|
19 |
+
<div style="width: auto; margin-left: auto; margin-right: auto">
|
20 |
+
<img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
|
21 |
+
</div>
|
22 |
+
<div style="display: flex; justify-content: space-between; width: 100%;">
|
23 |
+
<div style="display: flex; flex-direction: column; align-items: flex-start;">
|
24 |
+
<p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
|
25 |
+
</div>
|
26 |
+
<div style="display: flex; flex-direction: column; align-items: flex-end;">
|
27 |
+
<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>
|
28 |
+
</div>
|
29 |
+
</div>
|
30 |
+
<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>
|
31 |
+
<hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
|
32 |
+
<!-- header end -->
|
33 |
+
|
34 |
+
# Nexusraven 13B - GPTQ
|
35 |
+
- Model creator: [Nexusflow](https://huggingface.co/Nexusflow)
|
36 |
+
- Original model: [Nexusraven 13B](https://huggingface.co/Nexusflow/NexusRaven-13B)
|
37 |
+
|
38 |
+
<!-- description start -->
|
39 |
+
## Description
|
40 |
+
|
41 |
+
This repo contains GPTQ model files for [Nexusflow's Nexusraven 13B](https://huggingface.co/Nexusflow/NexusRaven-13B).
|
42 |
+
|
43 |
+
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.
|
44 |
+
|
45 |
+
<!-- description end -->
|
46 |
+
<!-- repositories-available start -->
|
47 |
+
## Repositories available
|
48 |
+
|
49 |
+
* [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/NexusRaven-13B-AWQ)
|
50 |
+
* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/NexusRaven-13B-GPTQ)
|
51 |
+
* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/NexusRaven-13B-GGUF)
|
52 |
+
* [Nexusflow's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Nexusflow/NexusRaven-13B)
|
53 |
+
<!-- repositories-available end -->
|
54 |
+
|
55 |
+
<!-- prompt-template start -->
|
56 |
+
## Prompt template: Unknown
|
57 |
+
|
58 |
+
```
|
59 |
+
{prompt}
|
60 |
+
|
61 |
+
```
|
62 |
+
|
63 |
+
<!-- prompt-template end -->
|
64 |
+
|
65 |
+
|
66 |
+
<!-- README_GPTQ.md-provided-files start -->
|
67 |
+
## Provided files, and GPTQ parameters
|
68 |
+
|
69 |
+
Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
|
70 |
+
|
71 |
+
Each separate quant is in a different branch. See below for instructions on fetching from different branches.
|
72 |
+
|
73 |
+
All recent GPTQ files are made with AutoGPTQ, and all files in non-main branches are made with AutoGPTQ. Files in the `main` branch which were uploaded before August 2023 were made with GPTQ-for-LLaMa.
|
74 |
+
|
75 |
+
<details>
|
76 |
+
<summary>Explanation of GPTQ parameters</summary>
|
77 |
+
|
78 |
+
- Bits: The bit size of the quantised model.
|
79 |
+
- GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
|
80 |
+
- 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.
|
81 |
+
- Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
|
82 |
+
- 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).
|
83 |
+
- 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.
|
84 |
+
- ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
|
85 |
+
|
86 |
+
</details>
|
87 |
+
|
88 |
+
| Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
|
89 |
+
| ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
|
90 |
+
| [main](https://huggingface.co/TheBloke/NexusRaven-13B-GPTQ/tree/main) | 4 | 128 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 16384 | 7.26 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
|
91 |
+
| [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/NexusRaven-13B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 16384 | 8.00 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
|
92 |
+
| [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/NexusRaven-13B-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 16384 | 13.65 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
|
93 |
+
| [gptq-8bit-32g-actorder_True](https://huggingface.co/TheBloke/NexusRaven-13B-GPTQ/tree/gptq-8bit-32g-actorder_True) | 8 | 32 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 16384 | 14.55 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. |
|
94 |
+
| [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/NexusRaven-13B-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 16384 | 7.51 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
|
95 |
+
|
96 |
+
<!-- README_GPTQ.md-provided-files end -->
|
97 |
+
|
98 |
+
<!-- README_GPTQ.md-download-from-branches start -->
|
99 |
+
## How to download, including from branches
|
100 |
+
|
101 |
+
### In text-generation-webui
|
102 |
+
|
103 |
+
To download from the `main` branch, enter `TheBloke/NexusRaven-13B-GPTQ` in the "Download model" box.
|
104 |
+
|
105 |
+
To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/NexusRaven-13B-GPTQ:gptq-4bit-32g-actorder_True`
|
106 |
+
|
107 |
+
### From the command line
|
108 |
+
|
109 |
+
I recommend using the `huggingface-hub` Python library:
|
110 |
+
|
111 |
+
```shell
|
112 |
+
pip3 install huggingface-hub
|
113 |
+
```
|
114 |
+
|
115 |
+
To download the `main` branch to a folder called `NexusRaven-13B-GPTQ`:
|
116 |
+
|
117 |
+
```shell
|
118 |
+
mkdir NexusRaven-13B-GPTQ
|
119 |
+
huggingface-cli download TheBloke/NexusRaven-13B-GPTQ --local-dir NexusRaven-13B-GPTQ --local-dir-use-symlinks False
|
120 |
+
```
|
121 |
+
|
122 |
+
To download from a different branch, add the `--revision` parameter:
|
123 |
+
|
124 |
+
```shell
|
125 |
+
mkdir NexusRaven-13B-GPTQ
|
126 |
+
huggingface-cli download TheBloke/NexusRaven-13B-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir NexusRaven-13B-GPTQ --local-dir-use-symlinks False
|
127 |
+
```
|
128 |
+
|
129 |
+
<details>
|
130 |
+
<summary>More advanced huggingface-cli download usage</summary>
|
131 |
+
|
132 |
+
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.
|
133 |
+
|
134 |
+
The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
|
135 |
+
|
136 |
+
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).
|
137 |
+
|
138 |
+
To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
|
139 |
+
|
140 |
+
```shell
|
141 |
+
pip3 install hf_transfer
|
142 |
+
```
|
143 |
+
|
144 |
+
And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
|
145 |
+
|
146 |
+
```shell
|
147 |
+
mkdir NexusRaven-13B-GPTQ
|
148 |
+
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/NexusRaven-13B-GPTQ --local-dir NexusRaven-13B-GPTQ --local-dir-use-symlinks False
|
149 |
+
```
|
150 |
+
|
151 |
+
Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
|
152 |
+
</details>
|
153 |
+
|
154 |
+
### With `git` (**not** recommended)
|
155 |
+
|
156 |
+
To clone a specific branch with `git`, use a command like this:
|
157 |
+
|
158 |
+
```shell
|
159 |
+
git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/NexusRaven-13B-GPTQ
|
160 |
+
```
|
161 |
+
|
162 |
+
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.)
|
163 |
+
|
164 |
+
<!-- README_GPTQ.md-download-from-branches end -->
|
165 |
+
<!-- README_GPTQ.md-text-generation-webui start -->
|
166 |
+
## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
|
167 |
+
|
168 |
+
Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
|
169 |
+
|
170 |
+
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.
|
171 |
+
|
172 |
+
1. Click the **Model tab**.
|
173 |
+
2. Under **Download custom model or LoRA**, enter `TheBloke/NexusRaven-13B-GPTQ`.
|
174 |
+
- To download from a specific branch, enter for example `TheBloke/NexusRaven-13B-GPTQ:gptq-4bit-32g-actorder_True`
|
175 |
+
- see Provided Files above for the list of branches for each option.
|
176 |
+
3. Click **Download**.
|
177 |
+
4. The model will start downloading. Once it's finished it will say "Done".
|
178 |
+
5. In the top left, click the refresh icon next to **Model**.
|
179 |
+
6. In the **Model** dropdown, choose the model you just downloaded: `NexusRaven-13B-GPTQ`
|
180 |
+
7. The model will automatically load, and is now ready for use!
|
181 |
+
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.
|
182 |
+
* 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`.
|
183 |
+
9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
|
184 |
+
<!-- README_GPTQ.md-text-generation-webui end -->
|
185 |
+
|
186 |
+
<!-- README_GPTQ.md-use-from-python start -->
|
187 |
+
## How to use this GPTQ model from Python code
|
188 |
+
|
189 |
+
### Install the necessary packages
|
190 |
+
|
191 |
+
Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
|
192 |
+
|
193 |
+
```shell
|
194 |
+
pip3 install transformers optimum
|
195 |
+
pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
|
196 |
+
```
|
197 |
+
|
198 |
+
If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
|
199 |
+
|
200 |
+
```shell
|
201 |
+
pip3 uninstall -y auto-gptq
|
202 |
+
git clone https://github.com/PanQiWei/AutoGPTQ
|
203 |
+
cd AutoGPTQ
|
204 |
+
git checkout v0.4.2
|
205 |
+
pip3 install .
|
206 |
+
```
|
207 |
+
|
208 |
+
### You can then use the following code
|
209 |
+
|
210 |
+
```python
|
211 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
212 |
+
|
213 |
+
model_name_or_path = "TheBloke/NexusRaven-13B-GPTQ"
|
214 |
+
# To use a different branch, change revision
|
215 |
+
# For example: revision="gptq-4bit-32g-actorder_True"
|
216 |
+
model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
|
217 |
+
device_map="auto",
|
218 |
+
trust_remote_code=False,
|
219 |
+
revision="main")
|
220 |
+
|
221 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
|
222 |
+
|
223 |
+
prompt = "Tell me about AI"
|
224 |
+
prompt_template=f'''{prompt}
|
225 |
+
'''
|
226 |
+
|
227 |
+
print("\n\n*** Generate:")
|
228 |
+
|
229 |
+
input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
|
230 |
+
output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
|
231 |
+
print(tokenizer.decode(output[0]))
|
232 |
+
|
233 |
+
# Inference can also be done using transformers' pipeline
|
234 |
+
|
235 |
+
print("*** Pipeline:")
|
236 |
+
pipe = pipeline(
|
237 |
+
"text-generation",
|
238 |
+
model=model,
|
239 |
+
tokenizer=tokenizer,
|
240 |
+
max_new_tokens=512,
|
241 |
+
do_sample=True,
|
242 |
+
temperature=0.7,
|
243 |
+
top_p=0.95,
|
244 |
+
top_k=40,
|
245 |
+
repetition_penalty=1.1
|
246 |
+
)
|
247 |
+
|
248 |
+
print(pipe(prompt_template)[0]['generated_text'])
|
249 |
+
```
|
250 |
+
<!-- README_GPTQ.md-use-from-python end -->
|
251 |
+
|
252 |
+
<!-- README_GPTQ.md-compatibility start -->
|
253 |
+
## Compatibility
|
254 |
+
|
255 |
+
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).
|
256 |
+
|
257 |
+
[ExLlama](https://github.com/turboderp/exllama) is compatible with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
|
258 |
+
|
259 |
+
[Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
|
260 |
+
<!-- README_GPTQ.md-compatibility end -->
|
261 |
+
|
262 |
+
<!-- footer start -->
|
263 |
+
<!-- 200823 -->
|
264 |
+
## Discord
|
265 |
+
|
266 |
+
For further support, and discussions on these models and AI in general, join us at:
|
267 |
+
|
268 |
+
[TheBloke AI's Discord server](https://discord.gg/theblokeai)
|
269 |
+
|
270 |
+
## Thanks, and how to contribute
|
271 |
+
|
272 |
+
Thanks to the [chirper.ai](https://chirper.ai) team!
|
273 |
+
|
274 |
+
Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
|
275 |
+
|
276 |
+
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.
|
277 |
+
|
278 |
+
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.
|
279 |
+
|
280 |
+
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
|
281 |
+
|
282 |
+
* Patreon: https://patreon.com/TheBlokeAI
|
283 |
+
* Ko-Fi: https://ko-fi.com/TheBlokeAI
|
284 |
+
|
285 |
+
**Special thanks to**: Aemon Algiz.
|
286 |
+
|
287 |
+
**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
|
288 |
+
|
289 |
+
|
290 |
+
Thank you to all my generous patrons and donaters!
|
291 |
+
|
292 |
+
And thank you again to a16z for their generous grant.
|
293 |
+
|
294 |
+
<!-- footer end -->
|
295 |
+
|
296 |
+
# Original model card: Nexusflow's Nexusraven 13B
|
297 |
+
|
298 |
+
# NexusRaven-13B: Surpassing the state-of-the-art in open-source function calling LLMs.
|
299 |
+
|
300 |
+
<p align="center">
|
301 |
+
<a href="https://huggingface.co/Nexusflow" target="_blank">Nexusflow HF</a> - <a href="http://nexusflow.ai/blog" target="_blank">NexusRaven blog post</a> - <a href="https://huggingface.co/Nexusflow/NexusRaven-13B" target="_blank">NexusRaven-13B</a> - <a href="https://x.com/NexusflowX/status/1707470614012035561?s=20" target="_blank">NexusRaven-13B Twitter Thread</a> - <a href="https://github.com/nexusflowai/NexusRaven/" target="_blank">NexusRaven-13B Github</a> - <a href="https://huggingface.co/datasets/Nexusflow/NexusRaven_API_evaluation" target="_blank">NexusRaven API evaluation dataset</a>
|
302 |
+
</p>
|
303 |
+
|
304 |
+
<p align="center" width="100%">
|
305 |
+
<a><img src="NexusRaven.png" alt="NexusRaven" style="width: 40%; min-width: 300px; display: block; margin: auto;"></a>
|
306 |
+
</p>
|
307 |
+
|
308 |
+
Table of contents
|
309 |
+
- [NexusRaven-13B: Surpassing the state-of-the-art in open-source function calling LLMs.](#nexusraven-13b-surpassing-the-state-of-the-art-in-open-source-function-calling-llms)
|
310 |
+
- [Introducing NexusRaven-13B](#introducing-nexusraven-13b)
|
311 |
+
- [NexusRaven model usage](#nexusraven-model-usage)
|
312 |
+
- [Training procedure](#training-procedure)
|
313 |
+
- [Training hyperparameters](#training-hyperparameters)
|
314 |
+
- [Framework versions](#framework-versions)
|
315 |
+
- [Limitations](#limitations)
|
316 |
+
- [License](#license)
|
317 |
+
- [References](#references)
|
318 |
+
- [Citation](#citation)
|
319 |
+
- [Contact](#contact)
|
320 |
+
|
321 |
+
|
322 |
+
This model is a fine-tuned version of [codellama/CodeLlama-13b-Instruct-hf](https://huggingface.co/codellama/CodeLlama-13b-Instruct-hf).
|
323 |
+
|
324 |
+
## Introducing NexusRaven-13B
|
325 |
+
NexusRaven is an open-source and commercially viable function calling LLM that surpasses the state-of-the-art in function calling capabilities.
|
326 |
+
|
327 |
+
📊 Performance Highlights: With our demonstration retrieval system, NexusRaven-13B achieves a 95% success rate in using cybersecurity tools such as CVE/CPE Search and VirusTotal, while prompting GPT-4 achieves 64%. It has significantly lower cost and faster inference speed compared to GPT-4.
|
328 |
+
|
329 |
+
🔧 Generalization to the Unseen: NexusRaven-13B generalizes to tools never seen during model training, achieving a success rate comparable with GPT-3.5 in zero-shot setting, significantly outperforming all other open-source LLMs of similar sizes.
|
330 |
+
|
331 |
+
🔥 Commercially Permissive: The training of NexusRaven-13B does not involve any data generated by proprietary LLMs such as GPT-4. You have full control of the model when deployed in commercial applications.
|
332 |
+
|
333 |
+
<p align="center" width="100%">
|
334 |
+
<a><img src="Retrieval-augmented_Evaluation.png" alt="NexusRaven" style="width: 80%; min-width: 300px; display: block; margin: auto;"></a>
|
335 |
+
<a><img src="Zero-shot_Evaluation.png" alt="NexusRaven" style="width: 80%; min-width: 300px; display: block; margin: auto;"></a>
|
336 |
+
</p>
|
337 |
+
|
338 |
+
|
339 |
+
## NexusRaven model usage
|
340 |
+
NexusRaven accepts a list of python functions. These python functions can do anything (including sending GET/POST requests to external APIs!). The two requirements include the python function signature and the appropriate docstring to generate the function call.
|
341 |
+
|
342 |
+
NexusRaven is highly compatible with langchain. See [langchain_example.py](https://huggingface.co/Nexusflow/NexusRaven-13B/blob/main/langchain_example.py). An example without langchain can be found in [non_langchain_example.py](https://huggingface.co/Nexusflow/NexusRaven-13B/blob/main/non_langchain_example.py)
|
343 |
+
|
344 |
+
Please note that the model will reflect on the answer sometimes, so we highly recommend stopping the model generation at a stopping criteria of `["\nReflection:"]`, to avoid spending unnecessary tokens during inference, but the reflection might help in some rare cases. This is reflected in our langchain example.
|
345 |
+
|
346 |
+
The "Initial Answer" can be executed to run the function.
|
347 |
+
|
348 |
+
|
349 |
+
## Training procedure
|
350 |
+
|
351 |
+
### Training hyperparameters
|
352 |
+
|
353 |
+
The following hyperparameters were used during training:
|
354 |
+
- learning_rate: 3e-05
|
355 |
+
- train_batch_size: 1
|
356 |
+
- eval_batch_size: 1
|
357 |
+
- seed: 42
|
358 |
+
- distributed_type: multi-GPU
|
359 |
+
- num_devices: 8
|
360 |
+
- gradient_accumulation_steps: 16
|
361 |
+
- total_train_batch_size: 128
|
362 |
+
- total_eval_batch_size: 8
|
363 |
+
- optimizer: Adam with betas=(0.9,0.95) and epsilon=1e-08
|
364 |
+
- lr_scheduler_type: constant
|
365 |
+
- num_epochs: 2.0
|
366 |
+
|
367 |
+
|
368 |
+
### Framework versions
|
369 |
+
|
370 |
+
- Transformers 4.33.2
|
371 |
+
- Pytorch 2.0.1+cu118
|
372 |
+
- Datasets 2.14.5
|
373 |
+
- Tokenizers 0.13.3
|
374 |
+
|
375 |
+
|
376 |
+
# Limitations
|
377 |
+
1. We highly recommend using a stop criteria of `["\nReflection:"]`. The model was trained to first generate an answer and then reflect on its answer to either improve the answer or keep the answer the same. However, this "chain of thought" is often not helpful, and the final answer is seldom better than the initial call. Therefore, we strongly recommend using the Initial Call as the main call to execute.
|
378 |
+
2. The model works best when it is connected with a retriever when there are a multitude of functions, as a large number of functions will saturate the context window of this model.
|
379 |
+
3. The model can be prone to generate incorrect calls. Please ensure proper guardrails to capture errant behavior is in place.
|
380 |
+
|
381 |
+
|
382 |
+
## License
|
383 |
+
This model was trained on commercially viable data and is licensed under the [Llama 2 community license](https://huggingface.co/codellama/CodeLlama-13b-hf/blob/main/LICENSE) following the original [CodeLlama-13b-hf](https://huggingface.co/codellama/CodeLlama-13b-hf/) model.
|
384 |
+
|
385 |
+
|
386 |
+
## References
|
387 |
+
We thank the CodeLlama team for their amazing models!
|
388 |
+
|
389 |
+
```
|
390 |
+
@misc{rozière2023code,
|
391 |
+
title={Code Llama: Open Foundation Models for Code},
|
392 |
+
author={Baptiste Rozière and Jonas Gehring and Fabian Gloeckle and Sten Sootla and Itai Gat and Xiaoqing Ellen Tan and Yossi Adi and Jingyu Liu and Tal Remez and Jérémy Rapin and Artyom Kozhevnikov and Ivan Evtimov and Joanna Bitton and Manish Bhatt and Cristian Canton Ferrer and Aaron Grattafiori and Wenhan Xiong and Alexandre Défossez and Jade Copet and Faisal Azhar and Hugo Touvron and Louis Martin and Nicolas Usunier and Thomas Scialom and Gabriel Synnaeve},
|
393 |
+
year={2023},
|
394 |
+
eprint={2308.12950},
|
395 |
+
archivePrefix={arXiv},
|
396 |
+
primaryClass={cs.CL}
|
397 |
+
}
|
398 |
+
```
|
399 |
+
|
400 |
+
|
401 |
+
## Citation
|
402 |
+
```
|
403 |
+
@misc{nexusraven,
|
404 |
+
title={NexusRaven: Surpassing the state-of-the-art in open-source function calling LLMs},
|
405 |
+
author={Nexusflow.ai team},
|
406 |
+
year={2023},
|
407 |
+
url={http://nexusflow.ai/blog}
|
408 |
+
}
|
409 |
+
```
|
410 |
+
|
411 |
+
## Contact
|
412 |
+
Please reach out to info@nexusflow.ai for any questions!
|