Upload README.md
Browse files
README.md
ADDED
@@ -0,0 +1,445 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: perlthoughts/Falkor-8x7B-MoE
|
3 |
+
inference: false
|
4 |
+
license: apache-2.0
|
5 |
+
model_creator: Ray Hernandez
|
6 |
+
model_name: Falkor 8X7B MoE
|
7 |
+
model_type: mixtral
|
8 |
+
prompt_template: '<human>: {prompt}
|
9 |
+
|
10 |
+
<bot>:
|
11 |
+
|
12 |
+
'
|
13 |
+
quantized_by: TheBloke
|
14 |
+
---
|
15 |
+
<!-- markdownlint-disable MD041 -->
|
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 |
+
# Falkor 8X7B MoE - GPTQ
|
35 |
+
- Model creator: [Ray Hernandez](https://huggingface.co/perlthoughts)
|
36 |
+
- Original model: [Falkor 8X7B MoE](https://huggingface.co/perlthoughts/Falkor-8x7B-MoE)
|
37 |
+
|
38 |
+
<!-- description start -->
|
39 |
+
# Description
|
40 |
+
|
41 |
+
This repo contains GPTQ model files for [Ray Hernandez's Falkor 8X7B MoE](https://huggingface.co/perlthoughts/Falkor-8x7B-MoE).
|
42 |
+
|
43 |
+
Mixtral GPTQs currently require:
|
44 |
+
* Transformers 4.36.0 or later
|
45 |
+
* either, AutoGPTQ 0.6 compiled from source, or
|
46 |
+
* Transformers 4.37.0.dev0 compiled from Github with: `pip3 install git+https://github.com/huggingface/transformers`
|
47 |
+
|
48 |
+
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.
|
49 |
+
|
50 |
+
<!-- description end -->
|
51 |
+
<!-- repositories-available start -->
|
52 |
+
## Repositories available
|
53 |
+
|
54 |
+
* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Falkor-8x7B-MoE-GPTQ)
|
55 |
+
* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Falkor-8x7B-MoE-GGUF)
|
56 |
+
* [Ray Hernandez's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/perlthoughts/Falkor-8x7B-MoE)
|
57 |
+
<!-- repositories-available end -->
|
58 |
+
|
59 |
+
<!-- prompt-template start -->
|
60 |
+
## Prompt template: human-bot
|
61 |
+
|
62 |
+
```
|
63 |
+
<human>: {prompt}
|
64 |
+
<bot>:
|
65 |
+
|
66 |
+
```
|
67 |
+
|
68 |
+
<!-- prompt-template end -->
|
69 |
+
|
70 |
+
|
71 |
+
|
72 |
+
<!-- README_GPTQ.md-compatible clients start -->
|
73 |
+
## Known compatible clients / servers
|
74 |
+
|
75 |
+
GPTQ models are currently supported on Linux (NVidia/AMD) and Windows (NVidia only). macOS users: please use GGUF models.
|
76 |
+
|
77 |
+
Mixtral GPTQs currently have special requirements - see Description above.
|
78 |
+
|
79 |
+
<!-- README_GPTQ.md-compatible clients end -->
|
80 |
+
|
81 |
+
<!-- README_GPTQ.md-provided-files start -->
|
82 |
+
## Provided files, and GPTQ parameters
|
83 |
+
|
84 |
+
Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
|
85 |
+
|
86 |
+
Each separate quant is in a different branch. See below for instructions on fetching from different branches.
|
87 |
+
|
88 |
+
Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
|
89 |
+
|
90 |
+
<details>
|
91 |
+
<summary>Explanation of GPTQ parameters</summary>
|
92 |
+
|
93 |
+
- Bits: The bit size of the quantised model.
|
94 |
+
- GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
|
95 |
+
- 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.
|
96 |
+
- Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
|
97 |
+
- 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).
|
98 |
+
- 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.
|
99 |
+
- ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
|
100 |
+
|
101 |
+
</details>
|
102 |
+
|
103 |
+
| Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
|
104 |
+
| ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
|
105 |
+
| [main](https://huggingface.co/TheBloke/Falkor-8x7B-MoE-GPTQ/tree/main) | 4 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 23.81 GB | No | 4-bit, with Act Order. No group size, to lower VRAM requirements. |
|
106 |
+
| [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/Falkor-8x7B-MoE-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 24.70 GB | No | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
|
107 |
+
| [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/Falkor-8x7B-MoE-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 27.42 GB | No | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
|
108 |
+
| [gptq-3bit--1g-actorder_True](https://huggingface.co/TheBloke/Falkor-8x7B-MoE-GPTQ/tree/gptq-3bit--1g-actorder_True) | 3 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 18.01 GB | No | 3-bit, with Act Order and no group size. Lowest possible VRAM requirements. May be lower quality than 3-bit 128g. |
|
109 |
+
| [gptq-3bit-128g-actorder_True](https://huggingface.co/TheBloke/Falkor-8x7B-MoE-GPTQ/tree/gptq-3bit-128g-actorder_True) | 3 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 18.85 GB | No | 3-bit, with group size 128g and act-order. Higher quality than 128g-False. |
|
110 |
+
| [gptq-3bit-32g-actorder_True](https://huggingface.co/TheBloke/Falkor-8x7B-MoE-GPTQ/tree/gptq-3bit-32g-actorder_True) | 3 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 21.43 GB | No | 3-bit, with group size 64g and act-order. Highest quality 3-bit option. |
|
111 |
+
| [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/Falkor-8x7B-MoE-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 47.04 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
|
112 |
+
| [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/Falkor-8x7B-MoE-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 8192 | 48.10 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
|
113 |
+
|
114 |
+
<!-- README_GPTQ.md-provided-files end -->
|
115 |
+
|
116 |
+
<!-- README_GPTQ.md-download-from-branches start -->
|
117 |
+
## How to download, including from branches
|
118 |
+
|
119 |
+
### In text-generation-webui
|
120 |
+
|
121 |
+
To download from the `main` branch, enter `TheBloke/Falkor-8x7B-MoE-GPTQ` in the "Download model" box.
|
122 |
+
|
123 |
+
To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/Falkor-8x7B-MoE-GPTQ:gptq-4bit-128g-actorder_True`
|
124 |
+
|
125 |
+
### From the command line
|
126 |
+
|
127 |
+
I recommend using the `huggingface-hub` Python library:
|
128 |
+
|
129 |
+
```shell
|
130 |
+
pip3 install huggingface-hub
|
131 |
+
```
|
132 |
+
|
133 |
+
To download the `main` branch to a folder called `Falkor-8x7B-MoE-GPTQ`:
|
134 |
+
|
135 |
+
```shell
|
136 |
+
mkdir Falkor-8x7B-MoE-GPTQ
|
137 |
+
huggingface-cli download TheBloke/Falkor-8x7B-MoE-GPTQ --local-dir Falkor-8x7B-MoE-GPTQ --local-dir-use-symlinks False
|
138 |
+
```
|
139 |
+
|
140 |
+
To download from a different branch, add the `--revision` parameter:
|
141 |
+
|
142 |
+
```shell
|
143 |
+
mkdir Falkor-8x7B-MoE-GPTQ
|
144 |
+
huggingface-cli download TheBloke/Falkor-8x7B-MoE-GPTQ --revision gptq-4bit-128g-actorder_True --local-dir Falkor-8x7B-MoE-GPTQ --local-dir-use-symlinks False
|
145 |
+
```
|
146 |
+
|
147 |
+
<details>
|
148 |
+
<summary>More advanced huggingface-cli download usage</summary>
|
149 |
+
|
150 |
+
If you remove the `--local-dir-use-symlinks False` parameter, the files will instead be stored in the central Hugging Face cache directory (default location on Linux is: `~/.cache/huggingface`), and symlinks will be added to the specified `--local-dir`, pointing to their real location in the cache. This allows for interrupted downloads to be resumed, and allows you to quickly clone the repo to multiple places on disk without triggering a download again. The downside, and the reason why I don't list that as the default option, is that the files are then hidden away in a cache folder and it's harder to know where your disk space is being used, and to clear it up if/when you want to remove a download model.
|
151 |
+
|
152 |
+
The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
|
153 |
+
|
154 |
+
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).
|
155 |
+
|
156 |
+
To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
|
157 |
+
|
158 |
+
```shell
|
159 |
+
pip3 install hf_transfer
|
160 |
+
```
|
161 |
+
|
162 |
+
And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
|
163 |
+
|
164 |
+
```shell
|
165 |
+
mkdir Falkor-8x7B-MoE-GPTQ
|
166 |
+
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/Falkor-8x7B-MoE-GPTQ --local-dir Falkor-8x7B-MoE-GPTQ --local-dir-use-symlinks False
|
167 |
+
```
|
168 |
+
|
169 |
+
Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
|
170 |
+
</details>
|
171 |
+
|
172 |
+
### With `git` (**not** recommended)
|
173 |
+
|
174 |
+
To clone a specific branch with `git`, use a command like this:
|
175 |
+
|
176 |
+
```shell
|
177 |
+
git clone --single-branch --branch gptq-4bit-128g-actorder_True https://huggingface.co/TheBloke/Falkor-8x7B-MoE-GPTQ
|
178 |
+
```
|
179 |
+
|
180 |
+
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.)
|
181 |
+
|
182 |
+
<!-- README_GPTQ.md-download-from-branches end -->
|
183 |
+
<!-- README_GPTQ.md-text-generation-webui start -->
|
184 |
+
## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
|
185 |
+
|
186 |
+
**NOTE**: Requires:
|
187 |
+
|
188 |
+
* Transformers 4.36.0, or Transformers 4.37.0.dev0 from Github
|
189 |
+
* Either AutoGPTQ 0.6 compiled from source and `Loader: AutoGPTQ`,
|
190 |
+
* or, `Loader: Transformers`, if you installed Transformers from Github: `pip3 install git+https://github.com/huggingface/transformers`
|
191 |
+
|
192 |
+
Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
|
193 |
+
|
194 |
+
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.
|
195 |
+
|
196 |
+
1. Click the **Model tab**.
|
197 |
+
2. Under **Download custom model or LoRA**, enter `TheBloke/Falkor-8x7B-MoE-GPTQ`.
|
198 |
+
|
199 |
+
- To download from a specific branch, enter for example `TheBloke/Falkor-8x7B-MoE-GPTQ:gptq-4bit-128g-actorder_True`
|
200 |
+
- see Provided Files above for the list of branches for each option.
|
201 |
+
|
202 |
+
3. Click **Download**.
|
203 |
+
4. The model will start downloading. Once it's finished it will say "Done".
|
204 |
+
5. In the top left, click the refresh icon next to **Model**.
|
205 |
+
6. In the **Model** dropdown, choose the model you just downloaded: `Falkor-8x7B-MoE-GPTQ`
|
206 |
+
7. The model will automatically load, and is now ready for use!
|
207 |
+
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.
|
208 |
+
|
209 |
+
- 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`.
|
210 |
+
|
211 |
+
9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
|
212 |
+
|
213 |
+
<!-- README_GPTQ.md-text-generation-webui end -->
|
214 |
+
|
215 |
+
<!-- README_GPTQ.md-use-from-tgi start -->
|
216 |
+
## Serving this model from Text Generation Inference (TGI)
|
217 |
+
|
218 |
+
Not currently supported for Mixtral models.
|
219 |
+
|
220 |
+
<!-- README_GPTQ.md-use-from-tgi end -->
|
221 |
+
<!-- README_GPTQ.md-use-from-python start -->
|
222 |
+
## Python code example: inference from this GPTQ model
|
223 |
+
|
224 |
+
### Install the necessary packages
|
225 |
+
|
226 |
+
Requires: Transformers 4.37.0.dev0 from Github, Optimum 1.16.0 or later, and AutoGPTQ 0.5.1 or later.
|
227 |
+
|
228 |
+
```shell
|
229 |
+
pip3 install --upgrade "git+https://github.com/huggingface/transformers" optimum
|
230 |
+
# If using PyTorch 2.1 + CUDA 12.x:
|
231 |
+
pip3 install --upgrade auto-gptq
|
232 |
+
# or, if using PyTorch 2.1 + CUDA 11.x:
|
233 |
+
pip3 install --upgrade auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/
|
234 |
+
```
|
235 |
+
|
236 |
+
If you are using PyTorch 2.0, you will need to install AutoGPTQ from source. Likewise if you have problems with the pre-built wheels, you should try building from source:
|
237 |
+
|
238 |
+
```shell
|
239 |
+
pip3 uninstall -y auto-gptq
|
240 |
+
git clone https://github.com/PanQiWei/AutoGPTQ
|
241 |
+
cd AutoGPTQ
|
242 |
+
DISABLE_QIGEN=1 pip3 install .
|
243 |
+
```
|
244 |
+
|
245 |
+
### Example Python code
|
246 |
+
|
247 |
+
```python
|
248 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
249 |
+
|
250 |
+
model_name_or_path = "TheBloke/Falkor-8x7B-MoE-GPTQ"
|
251 |
+
# To use a different branch, change revision
|
252 |
+
# For example: revision="gptq-4bit-128g-actorder_True"
|
253 |
+
model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
|
254 |
+
device_map="auto",
|
255 |
+
trust_remote_code=False,
|
256 |
+
revision="main")
|
257 |
+
|
258 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
|
259 |
+
|
260 |
+
prompt = "Write a story about llamas"
|
261 |
+
system_message = "You are a story writing assistant"
|
262 |
+
prompt_template=f'''<human>: {prompt}
|
263 |
+
<bot>:
|
264 |
+
'''
|
265 |
+
|
266 |
+
print("\n\n*** Generate:")
|
267 |
+
|
268 |
+
input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
|
269 |
+
output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
|
270 |
+
print(tokenizer.decode(output[0]))
|
271 |
+
|
272 |
+
# Inference can also be done using transformers' pipeline
|
273 |
+
|
274 |
+
print("*** Pipeline:")
|
275 |
+
pipe = pipeline(
|
276 |
+
"text-generation",
|
277 |
+
model=model,
|
278 |
+
tokenizer=tokenizer,
|
279 |
+
max_new_tokens=512,
|
280 |
+
do_sample=True,
|
281 |
+
temperature=0.7,
|
282 |
+
top_p=0.95,
|
283 |
+
top_k=40,
|
284 |
+
repetition_penalty=1.1
|
285 |
+
)
|
286 |
+
|
287 |
+
print(pipe(prompt_template)[0]['generated_text'])
|
288 |
+
```
|
289 |
+
<!-- README_GPTQ.md-use-from-python end -->
|
290 |
+
|
291 |
+
<!-- README_GPTQ.md-compatibility start -->
|
292 |
+
## Compatibility
|
293 |
+
|
294 |
+
The files provided are tested to work with AutoGPTQ 0.6 (compiled from source) and Transformers 4.37.0 (installed from Github).
|
295 |
+
|
296 |
+
<!-- README_GPTQ.md-compatibility end -->
|
297 |
+
|
298 |
+
<!-- footer start -->
|
299 |
+
<!-- 200823 -->
|
300 |
+
## Discord
|
301 |
+
|
302 |
+
For further support, and discussions on these models and AI in general, join us at:
|
303 |
+
|
304 |
+
[TheBloke AI's Discord server](https://discord.gg/theblokeai)
|
305 |
+
|
306 |
+
## Thanks, and how to contribute
|
307 |
+
|
308 |
+
Thanks to the [chirper.ai](https://chirper.ai) team!
|
309 |
+
|
310 |
+
Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
|
311 |
+
|
312 |
+
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.
|
313 |
+
|
314 |
+
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.
|
315 |
+
|
316 |
+
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
|
317 |
+
|
318 |
+
* Patreon: https://patreon.com/TheBlokeAI
|
319 |
+
* Ko-Fi: https://ko-fi.com/TheBlokeAI
|
320 |
+
|
321 |
+
**Special thanks to**: Aemon Algiz.
|
322 |
+
|
323 |
+
**Patreon special mentions**: Michael Levine, 阿明, Trailburnt, Nikolai Manek, John Detwiler, Randy H, Will Dee, Sebastain Graf, NimbleBox.ai, Eugene Pentland, Emad Mostaque, Ai Maven, Jim Angel, Jeff Scroggin, Michael Davis, Manuel Alberto Morcote, Stephen Murray, Robert, Justin Joy, Luke @flexchar, Brandon Frisco, Elijah Stavena, S_X, Dan Guido, Undi ., Komninos Chatzipapas, Shadi, theTransient, Lone Striker, Raven Klaugh, jjj, Cap'n Zoog, Michel-Marie MAUDET (LINAGORA), Matthew Berman, David, Fen Risland, Omer Bin Jawed, Luke Pendergrass, Kalila, OG, Erik Bjäreholt, Rooh Singh, Joseph William Delisle, Dan Lewis, TL, John Villwock, AzureBlack, Brad, Pedro Madruga, Caitlyn Gatomon, K, jinyuan sun, Mano Prime, Alex, Jeffrey Morgan, Alicia Loh, Illia Dulskyi, Chadd, transmissions 11, fincy, Rainer Wilmers, ReadyPlayerEmma, knownsqashed, Mandus, biorpg, Deo Leter, Brandon Phillips, SuperWojo, Sean Connelly, Iucharbius, Jack West, Harry Royden McLaughlin, Nicholas, terasurfer, Vitor Caleffi, Duane Dunston, Johann-Peter Hartmann, David Ziegler, Olakabola, Ken Nordquist, Trenton Dambrowitz, Tom X Nguyen, Vadim, Ajan Kanaga, Leonard Tan, Clay Pascal, Alexandros Triantafyllidis, JM33133, Xule, vamX, ya boyyy, subjectnull, Talal Aujan, Alps Aficionado, wassieverse, Ari Malik, James Bentley, Woland, Spencer Kim, Michael Dempsey, Fred von Graf, Elle, zynix, William Richards, Stanislav Ovsiannikov, Edmond Seymore, Jonathan Leane, Martin Kemka, usrbinkat, Enrico Ros
|
324 |
+
|
325 |
+
|
326 |
+
Thank you to all my generous patrons and donaters!
|
327 |
+
|
328 |
+
And thank you again to a16z for their generous grant.
|
329 |
+
|
330 |
+
<!-- footer end -->
|
331 |
+
|
332 |
+
# Original model card: Ray Hernandez's Falkor 8X7B MoE
|
333 |
+
|
334 |
+
|
335 |
+
# Falkor 7B MoE 8x7B Experts
|
336 |
+
|
337 |
+
<img src="falkor.png" width="300">
|
338 |
+
|
339 |
+
Model merge between Chupacabra, openchat, and dragon-mistral-7b-v0.
|
340 |
+
|
341 |
+
- ---> [Theme Song](https://www.youtube.com/watch?v=lHytjEj7B9g) <---
|
342 |
+
|
343 |
+
# Original Model Card for dragon-mistral-7b-v0
|
344 |
+
|
345 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
346 |
+
|
347 |
+
dragon-mistral-7b-v0 part of the dRAGon ("Delivering RAG On ...") model series, RAG-instruct trained on top of a Mistral-7B base model.
|
348 |
+
|
349 |
+
DRAGON models have been fine-tuned with the specific objective of fact-based question-answering over complex business and legal documents with an emphasis on reducing hallucinations and providing short, clear answers for workflow automation.
|
350 |
+
|
351 |
+
### Benchmark Tests
|
352 |
+
|
353 |
+
Evaluated against the benchmark test: [RAG-Instruct-Benchmark-Tester](https://www.huggingface.co/datasets/llmware/rag_instruct_benchmark_tester)
|
354 |
+
Average of 2 Test Runs with 1 point for correct answer, 0.5 point for partial correct or blank / NF, 0.0 points for incorrect, and -1 points for hallucinations.
|
355 |
+
|
356 |
+
--**Accuracy Score**: **96.50** correct out of 100
|
357 |
+
--Not Found Classification: 92.50%
|
358 |
+
--Boolean: 97.50%
|
359 |
+
--Math/Logic: 81.25%
|
360 |
+
--Complex Questions (1-5): 4 (Medium-High - table-reading, multiple-choice, causal)
|
361 |
+
--Summarization Quality (1-5): 4 (Coherent, extractive)
|
362 |
+
--Hallucinations: No hallucinations observed in test runs.
|
363 |
+
|
364 |
+
For test run results (and good indicator of target use cases), please see the files ("core_rag_test" and "answer_sheet" in this repo).
|
365 |
+
|
366 |
+
### Model Description
|
367 |
+
|
368 |
+
<!-- Provide a longer summary of what this model is. -->
|
369 |
+
|
370 |
+
- **Developed by:** llmware
|
371 |
+
- **Model type:** Mistral-7B
|
372 |
+
- **Language(s) (NLP):** English
|
373 |
+
- **License:** Apache 2.0
|
374 |
+
- **Finetuned from model:** Mistral-7B-Base
|
375 |
+
|
376 |
+
### Direct Use
|
377 |
+
|
378 |
+
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
379 |
+
|
380 |
+
DRAGON is designed for enterprise automation use cases, especially in knowledge-intensive industries, such as financial services,
|
381 |
+
legal and regulatory industries with complex information sources.
|
382 |
+
|
383 |
+
DRAGON models have been trained for common RAG scenarios, specifically: question-answering, key-value extraction, and basic summarization as the core instruction types
|
384 |
+
without the need for a lot of complex instruction verbiage - provide a text passage context, ask questions, and get clear fact-based responses.
|
385 |
+
|
386 |
+
|
387 |
+
## Bias, Risks, and Limitations
|
388 |
+
|
389 |
+
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
390 |
+
|
391 |
+
Any model can provide inaccurate or incomplete information, and should be used in conjunction with appropriate safeguards and fact-checking mechanisms.
|
392 |
+
|
393 |
+
|
394 |
+
## How to Get Started with the Model
|
395 |
+
|
396 |
+
The fastest way to get started with dRAGon is through direct import in transformers:
|
397 |
+
|
398 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
399 |
+
tokenizer = AutoTokenizer.from_pretrained("dragon-mistral-7b-v0")
|
400 |
+
model = AutoModelForCausalLM.from_pretrained("dragon-mistral-7b-v0")
|
401 |
+
|
402 |
+
Please refer to the generation_test .py files in the Files repository, which includes 200 samples and script to test the model. The **generation_test_llmware_script.py** includes built-in llmware capabilities for fact-checking, as well as easy integration with document parsing and actual retrieval to swap out the test set for RAG workflow consisting of business documents.
|
403 |
+
|
404 |
+
The dRAGon model was fine-tuned with a simple "\<human> and \<bot> wrapper", so to get the best results, wrap inference entries as:
|
405 |
+
|
406 |
+
full_prompt = "<human>: " + my_prompt + "\n" + "<bot>:"
|
407 |
+
|
408 |
+
The BLING model was fine-tuned with closed-context samples, which assume generally that the prompt consists of two sub-parts:
|
409 |
+
|
410 |
+
1. Text Passage Context, and
|
411 |
+
2. Specific question or instruction based on the text passage
|
412 |
+
|
413 |
+
To get the best results, package "my_prompt" as follows:
|
414 |
+
|
415 |
+
my_prompt = {{text_passage}} + "\n" + {{question/instruction}}
|
416 |
+
|
417 |
+
|
418 |
+
If you are using a HuggingFace generation script:
|
419 |
+
|
420 |
+
# prepare prompt packaging used in fine-tuning process
|
421 |
+
new_prompt = "<human>: " + entries["context"] + "\n" + entries["query"] + "\n" + "<bot>:"
|
422 |
+
|
423 |
+
inputs = tokenizer(new_prompt, return_tensors="pt")
|
424 |
+
start_of_output = len(inputs.input_ids[0])
|
425 |
+
|
426 |
+
# temperature: set at 0.3 for consistency of output
|
427 |
+
# max_new_tokens: set at 100 - may prematurely stop a few of the summaries
|
428 |
+
|
429 |
+
outputs = model.generate(
|
430 |
+
inputs.input_ids.to(device),
|
431 |
+
eos_token_id=tokenizer.eos_token_id,
|
432 |
+
pad_token_id=tokenizer.eos_token_id,
|
433 |
+
do_sample=True,
|
434 |
+
temperature=0.3,
|
435 |
+
max_new_tokens=100,
|
436 |
+
)
|
437 |
+
|
438 |
+
output_only = tokenizer.decode(outputs[0][start_of_output:],skip_special_tokens=True)
|
439 |
+
|
440 |
+
|
441 |
+
## Model Card Contact
|
442 |
+
|
443 |
+
Darren Oberst & llmware team
|
444 |
+
|
445 |
+
|