Commit
•
d054b49
0
Parent(s):
Duplicate from TheBloke/dolphin-2.0-mistral-7B-GPTQ
Browse filesCo-authored-by: Tom Jobbins <TheBloke@users.noreply.huggingface.co>
- .gitattributes +35 -0
- README.md +409 -0
- config.json +47 -0
- generation_config.json +6 -0
- model.safetensors +3 -0
- quantize_config.json +8 -0
- special_tokens_map.json +6 -0
- tokenizer.json +0 -0
- tokenizer.model +3 -0
- tokenizer_config.json +42 -0
.gitattributes
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,409 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: ehartford/dolphin-2.0-mistral-7b
|
3 |
+
datasets:
|
4 |
+
- ehartford/dolphin
|
5 |
+
- jondurbin/airoboros-2.2.1
|
6 |
+
inference: false
|
7 |
+
language:
|
8 |
+
- en
|
9 |
+
license: apache-2.0
|
10 |
+
model_creator: Eric Hartford
|
11 |
+
model_name: Dolphin 2.0 Mistral 7B
|
12 |
+
model_type: mistral
|
13 |
+
prompt_template: '<|im_start|>system
|
14 |
+
|
15 |
+
{system_message}<|im_end|>
|
16 |
+
|
17 |
+
<|im_start|>user
|
18 |
+
|
19 |
+
{prompt}<|im_end|>
|
20 |
+
|
21 |
+
<|im_start|>assistant
|
22 |
+
|
23 |
+
'
|
24 |
+
quantized_by: TheBloke
|
25 |
+
---
|
26 |
+
|
27 |
+
<!-- header start -->
|
28 |
+
<!-- 200823 -->
|
29 |
+
<div style="width: auto; margin-left: auto; margin-right: auto">
|
30 |
+
<img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
|
31 |
+
</div>
|
32 |
+
<div style="display: flex; justify-content: space-between; width: 100%;">
|
33 |
+
<div style="display: flex; flex-direction: column; align-items: flex-start;">
|
34 |
+
<p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
|
35 |
+
</div>
|
36 |
+
<div style="display: flex; flex-direction: column; align-items: flex-end;">
|
37 |
+
<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>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
<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>
|
41 |
+
<hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
|
42 |
+
<!-- header end -->
|
43 |
+
|
44 |
+
# Dolphin 2.0 Mistral 7B - GPTQ
|
45 |
+
- Model creator: [Eric Hartford](https://huggingface.co/ehartford)
|
46 |
+
- Original model: [Dolphin 2.0 Mistral 7B](https://huggingface.co/ehartford/dolphin-2.0-mistral-7b)
|
47 |
+
|
48 |
+
<!-- description start -->
|
49 |
+
## Description
|
50 |
+
|
51 |
+
This repo contains GPTQ model files for [Eric Hartford's Dolphin 2.0 Mistral 7B](https://huggingface.co/ehartford/dolphin-2.0-mistral-7b).
|
52 |
+
|
53 |
+
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.
|
54 |
+
|
55 |
+
<!-- description end -->
|
56 |
+
<!-- repositories-available start -->
|
57 |
+
## Repositories available
|
58 |
+
|
59 |
+
* [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/dolphin-2.0-mistral-7B-AWQ)
|
60 |
+
* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/dolphin-2.0-mistral-7B-GPTQ)
|
61 |
+
* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/dolphin-2.0-mistral-7B-GGUF)
|
62 |
+
* [Eric Hartford's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/ehartford/dolphin-2.0-mistral-7b)
|
63 |
+
<!-- repositories-available end -->
|
64 |
+
|
65 |
+
<!-- prompt-template start -->
|
66 |
+
## Prompt template: ChatML
|
67 |
+
|
68 |
+
```
|
69 |
+
<|im_start|>system
|
70 |
+
{system_message}<|im_end|>
|
71 |
+
<|im_start|>user
|
72 |
+
{prompt}<|im_end|>
|
73 |
+
<|im_start|>assistant
|
74 |
+
|
75 |
+
```
|
76 |
+
|
77 |
+
<!-- prompt-template end -->
|
78 |
+
|
79 |
+
|
80 |
+
<!-- README_GPTQ.md-provided-files start -->
|
81 |
+
## Provided files, and GPTQ parameters
|
82 |
+
|
83 |
+
Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
|
84 |
+
|
85 |
+
Each separate quant is in a different branch. See below for instructions on fetching from different branches.
|
86 |
+
|
87 |
+
Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
|
88 |
+
|
89 |
+
<details>
|
90 |
+
<summary>Explanation of GPTQ parameters</summary>
|
91 |
+
|
92 |
+
- Bits: The bit size of the quantised model.
|
93 |
+
- GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
|
94 |
+
- 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.
|
95 |
+
- Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
|
96 |
+
- 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).
|
97 |
+
- 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.
|
98 |
+
- ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
|
99 |
+
|
100 |
+
</details>
|
101 |
+
|
102 |
+
| Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
|
103 |
+
| ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
|
104 |
+
| [main](https://huggingface.co/TheBloke/dolphin-2.0-mistral-7B-GPTQ/tree/main) | 4 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.16 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
|
105 |
+
| [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/dolphin-2.0-mistral-7B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.57 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
|
106 |
+
| [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/dolphin-2.0-mistral-7B-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.52 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
|
107 |
+
| [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/dolphin-2.0-mistral-7B-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.68 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
|
108 |
+
| [gptq-8bit-32g-actorder_True](https://huggingface.co/TheBloke/dolphin-2.0-mistral-7B-GPTQ/tree/gptq-8bit-32g-actorder_True) | 8 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 8.17 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. |
|
109 |
+
| [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/dolphin-2.0-mistral-7B-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.29 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
|
110 |
+
|
111 |
+
<!-- README_GPTQ.md-provided-files end -->
|
112 |
+
|
113 |
+
<!-- README_GPTQ.md-download-from-branches start -->
|
114 |
+
## How to download, including from branches
|
115 |
+
|
116 |
+
### In text-generation-webui
|
117 |
+
|
118 |
+
To download from the `main` branch, enter `TheBloke/dolphin-2.0-mistral-7B-GPTQ` in the "Download model" box.
|
119 |
+
|
120 |
+
To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/dolphin-2.0-mistral-7B-GPTQ:gptq-4bit-32g-actorder_True`
|
121 |
+
|
122 |
+
### From the command line
|
123 |
+
|
124 |
+
I recommend using the `huggingface-hub` Python library:
|
125 |
+
|
126 |
+
```shell
|
127 |
+
pip3 install huggingface-hub
|
128 |
+
```
|
129 |
+
|
130 |
+
To download the `main` branch to a folder called `dolphin-2.0-mistral-7B-GPTQ`:
|
131 |
+
|
132 |
+
```shell
|
133 |
+
mkdir dolphin-2.0-mistral-7B-GPTQ
|
134 |
+
huggingface-cli download TheBloke/dolphin-2.0-mistral-7B-GPTQ --local-dir dolphin-2.0-mistral-7B-GPTQ --local-dir-use-symlinks False
|
135 |
+
```
|
136 |
+
|
137 |
+
To download from a different branch, add the `--revision` parameter:
|
138 |
+
|
139 |
+
```shell
|
140 |
+
mkdir dolphin-2.0-mistral-7B-GPTQ
|
141 |
+
huggingface-cli download TheBloke/dolphin-2.0-mistral-7B-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir dolphin-2.0-mistral-7B-GPTQ --local-dir-use-symlinks False
|
142 |
+
```
|
143 |
+
|
144 |
+
<details>
|
145 |
+
<summary>More advanced huggingface-cli download usage</summary>
|
146 |
+
|
147 |
+
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.
|
148 |
+
|
149 |
+
The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
|
150 |
+
|
151 |
+
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).
|
152 |
+
|
153 |
+
To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
|
154 |
+
|
155 |
+
```shell
|
156 |
+
pip3 install hf_transfer
|
157 |
+
```
|
158 |
+
|
159 |
+
And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
|
160 |
+
|
161 |
+
```shell
|
162 |
+
mkdir dolphin-2.0-mistral-7B-GPTQ
|
163 |
+
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/dolphin-2.0-mistral-7B-GPTQ --local-dir dolphin-2.0-mistral-7B-GPTQ --local-dir-use-symlinks False
|
164 |
+
```
|
165 |
+
|
166 |
+
Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
|
167 |
+
</details>
|
168 |
+
|
169 |
+
### With `git` (**not** recommended)
|
170 |
+
|
171 |
+
To clone a specific branch with `git`, use a command like this:
|
172 |
+
|
173 |
+
```shell
|
174 |
+
git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/dolphin-2.0-mistral-7B-GPTQ
|
175 |
+
```
|
176 |
+
|
177 |
+
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.)
|
178 |
+
|
179 |
+
<!-- README_GPTQ.md-download-from-branches end -->
|
180 |
+
<!-- README_GPTQ.md-text-generation-webui start -->
|
181 |
+
## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
|
182 |
+
|
183 |
+
Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
|
184 |
+
|
185 |
+
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.
|
186 |
+
|
187 |
+
1. Click the **Model tab**.
|
188 |
+
2. Under **Download custom model or LoRA**, enter `TheBloke/dolphin-2.0-mistral-7B-GPTQ`.
|
189 |
+
- To download from a specific branch, enter for example `TheBloke/dolphin-2.0-mistral-7B-GPTQ:gptq-4bit-32g-actorder_True`
|
190 |
+
- see Provided Files above for the list of branches for each option.
|
191 |
+
3. Click **Download**.
|
192 |
+
4. The model will start downloading. Once it's finished it will say "Done".
|
193 |
+
5. In the top left, click the refresh icon next to **Model**.
|
194 |
+
6. In the **Model** dropdown, choose the model you just downloaded: `dolphin-2.0-mistral-7B-GPTQ`
|
195 |
+
7. The model will automatically load, and is now ready for use!
|
196 |
+
8. If you want any custom settings, set them and then click **Save settings for this model** followed by **Reload the Model** in the top right.
|
197 |
+
* 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`.
|
198 |
+
9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
|
199 |
+
|
200 |
+
<!-- README_GPTQ.md-text-generation-webui end -->
|
201 |
+
|
202 |
+
<!-- README_GPTQ.md-use-from-tgi start -->
|
203 |
+
## Serving this model from Text Generation Inference (TGI)
|
204 |
+
|
205 |
+
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`
|
206 |
+
|
207 |
+
Example Docker parameters:
|
208 |
+
|
209 |
+
```shell
|
210 |
+
--model-id TheBloke/dolphin-2.0-mistral-7B-GPTQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
|
211 |
+
```
|
212 |
+
|
213 |
+
Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
|
214 |
+
|
215 |
+
```shell
|
216 |
+
pip3 install huggingface-hub
|
217 |
+
```
|
218 |
+
|
219 |
+
```python
|
220 |
+
from huggingface_hub import InferenceClient
|
221 |
+
|
222 |
+
endpoint_url = "https://your-endpoint-url-here"
|
223 |
+
|
224 |
+
prompt = "Tell me about AI"
|
225 |
+
prompt_template=f'''<|im_start|>system
|
226 |
+
{system_message}<|im_end|>
|
227 |
+
<|im_start|>user
|
228 |
+
{prompt}<|im_end|>
|
229 |
+
<|im_start|>assistant
|
230 |
+
'''
|
231 |
+
|
232 |
+
client = InferenceClient(endpoint_url)
|
233 |
+
response = client.text_generation(prompt,
|
234 |
+
max_new_tokens=128,
|
235 |
+
do_sample=True,
|
236 |
+
temperature=0.7,
|
237 |
+
top_p=0.95,
|
238 |
+
top_k=40,
|
239 |
+
repetition_penalty=1.1)
|
240 |
+
|
241 |
+
print(f"Model output: {response}")
|
242 |
+
```
|
243 |
+
<!-- README_GPTQ.md-use-from-tgi end -->
|
244 |
+
<!-- README_GPTQ.md-use-from-python start -->
|
245 |
+
## How to use this GPTQ model from Python code
|
246 |
+
|
247 |
+
### Install the necessary packages
|
248 |
+
|
249 |
+
Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
|
250 |
+
|
251 |
+
```shell
|
252 |
+
pip3 install transformers optimum
|
253 |
+
pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
|
254 |
+
```
|
255 |
+
|
256 |
+
If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
|
257 |
+
|
258 |
+
```shell
|
259 |
+
pip3 uninstall -y auto-gptq
|
260 |
+
git clone https://github.com/PanQiWei/AutoGPTQ
|
261 |
+
cd AutoGPTQ
|
262 |
+
git checkout v0.4.2
|
263 |
+
pip3 install .
|
264 |
+
```
|
265 |
+
|
266 |
+
### You can then use the following code
|
267 |
+
|
268 |
+
```python
|
269 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
270 |
+
|
271 |
+
model_name_or_path = "TheBloke/dolphin-2.0-mistral-7B-GPTQ"
|
272 |
+
# To use a different branch, change revision
|
273 |
+
# For example: revision="gptq-4bit-32g-actorder_True"
|
274 |
+
model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
|
275 |
+
device_map="auto",
|
276 |
+
trust_remote_code=False,
|
277 |
+
revision="main")
|
278 |
+
|
279 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
|
280 |
+
|
281 |
+
prompt = "Tell me about AI"
|
282 |
+
prompt_template=f'''<|im_start|>system
|
283 |
+
{system_message}<|im_end|>
|
284 |
+
<|im_start|>user
|
285 |
+
{prompt}<|im_end|>
|
286 |
+
<|im_start|>assistant
|
287 |
+
'''
|
288 |
+
|
289 |
+
print("\n\n*** Generate:")
|
290 |
+
|
291 |
+
input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
|
292 |
+
output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
|
293 |
+
print(tokenizer.decode(output[0]))
|
294 |
+
|
295 |
+
# Inference can also be done using transformers' pipeline
|
296 |
+
|
297 |
+
print("*** Pipeline:")
|
298 |
+
pipe = pipeline(
|
299 |
+
"text-generation",
|
300 |
+
model=model,
|
301 |
+
tokenizer=tokenizer,
|
302 |
+
max_new_tokens=512,
|
303 |
+
do_sample=True,
|
304 |
+
temperature=0.7,
|
305 |
+
top_p=0.95,
|
306 |
+
top_k=40,
|
307 |
+
repetition_penalty=1.1
|
308 |
+
)
|
309 |
+
|
310 |
+
print(pipe(prompt_template)[0]['generated_text'])
|
311 |
+
```
|
312 |
+
<!-- README_GPTQ.md-use-from-python end -->
|
313 |
+
|
314 |
+
<!-- README_GPTQ.md-compatibility start -->
|
315 |
+
## Compatibility
|
316 |
+
|
317 |
+
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).
|
318 |
+
|
319 |
+
[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.
|
320 |
+
|
321 |
+
[Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
|
322 |
+
<!-- README_GPTQ.md-compatibility end -->
|
323 |
+
|
324 |
+
<!-- footer start -->
|
325 |
+
<!-- 200823 -->
|
326 |
+
## Discord
|
327 |
+
|
328 |
+
For further support, and discussions on these models and AI in general, join us at:
|
329 |
+
|
330 |
+
[TheBloke AI's Discord server](https://discord.gg/theblokeai)
|
331 |
+
|
332 |
+
## Thanks, and how to contribute
|
333 |
+
|
334 |
+
Thanks to the [chirper.ai](https://chirper.ai) team!
|
335 |
+
|
336 |
+
Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
|
337 |
+
|
338 |
+
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.
|
339 |
+
|
340 |
+
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.
|
341 |
+
|
342 |
+
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
|
343 |
+
|
344 |
+
* Patreon: https://patreon.com/TheBlokeAI
|
345 |
+
* Ko-Fi: https://ko-fi.com/TheBlokeAI
|
346 |
+
|
347 |
+
**Special thanks to**: Aemon Algiz.
|
348 |
+
|
349 |
+
**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
|
350 |
+
|
351 |
+
|
352 |
+
Thank you to all my generous patrons and donaters!
|
353 |
+
|
354 |
+
And thank you again to a16z for their generous grant.
|
355 |
+
|
356 |
+
<!-- footer end -->
|
357 |
+
|
358 |
+
# Original model card: Eric Hartford's Dolphin 2.0 Mistral 7B
|
359 |
+
|
360 |
+
|
361 |
+
Dolphin 2.0 🐬
|
362 |
+
https://erichartford.com/dolphin
|
363 |
+
|
364 |
+
Dolphin-2.0-mistral-7b's training was sponsored by [a16z](https://a16z.com/supporting-the-open-source-ai-community/).
|
365 |
+
|
366 |
+
This model is based on mistralAI, so it is suitable for commercial or non-commercial use.
|
367 |
+
|
368 |
+
This model is uncensored. I have filtered the dataset to remove alignment and bias. This makes the model more compliant. You are advised to implement your own alignment layer before exposing the model as a service. It will be highly compliant to any requests, even unethical ones. Please read my blog post about uncensored models. https://erichartford.com/uncensored-models
|
369 |
+
You are responsible for any content you create using this model. Enjoy responsibly.
|
370 |
+
|
371 |
+
## Dataset
|
372 |
+
|
373 |
+
This dataset is Dolphin, an open-source implementation of [Microsoft's Orca](https://www.microsoft.com/en-us/research/publication/orca-progressive-learning-from-complex-explanation-traces-of-gpt-4/)
|
374 |
+
|
375 |
+
I modified the dataset for uncensoring, deduping, cleaning, and quality.
|
376 |
+
|
377 |
+
I added Jon Durbin's excellent Airoboros dataset to increase creativity.
|
378 |
+
|
379 |
+
## Training
|
380 |
+
It took 48 hours to train 10 epochs on 4x A100s.
|
381 |
+
|
382 |
+
Prompt format:
|
383 |
+
This model (and all my future releases) use [ChatML](https://github.com/openai/openai-python/blob/main/chatml.md) prompt format.
|
384 |
+
```
|
385 |
+
<|im_start|>system
|
386 |
+
You are Dolphin, a helpful AI assistant.<|im_end|>
|
387 |
+
<|im_start|>user
|
388 |
+
{prompt}<|im_end|>
|
389 |
+
```
|
390 |
+
|
391 |
+
Example:
|
392 |
+
```
|
393 |
+
<|im_start|>system
|
394 |
+
you are an expert dolphin trainer<|im_end|>
|
395 |
+
<|im_start|>user
|
396 |
+
What is the best way to train a dolphin to obey me? Please answer step by step.<|im_end|>
|
397 |
+
```
|
398 |
+
|
399 |
+
## Gratitude
|
400 |
+
- This model was made possible by the generous sponsorship of a16z.
|
401 |
+
- Thank you to Microsoft for authoring the Orca paper and inspiring this work.
|
402 |
+
- Special thanks to WingLian, and TheBloke for helpful advice
|
403 |
+
- Thank you to all the other people in the Open Source AI community who have taught me and helped me along the way.
|
404 |
+
|
405 |
+
## Example Output
|
406 |
+
|
407 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/63111b2d88942700629f5771/xnz5M1lYd4oGVATSDRkQ-.png)
|
408 |
+
|
409 |
+
[Buy me a coffee](https://www.buymeacoffee.com/ehartford)
|
config.json
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "/workspace/process/ehartford_dolphin-2.0-mistral-7b/source",
|
3 |
+
"architectures": [
|
4 |
+
"MistralForCausalLM"
|
5 |
+
],
|
6 |
+
"bos_token_id": 1,
|
7 |
+
"eos_token_id": 2,
|
8 |
+
"hidden_act": "silu",
|
9 |
+
"hidden_size": 4096,
|
10 |
+
"initializer_range": 0.02,
|
11 |
+
"intermediate_size": 14336,
|
12 |
+
"max_position_embeddings": 32768,
|
13 |
+
"model_type": "mistral",
|
14 |
+
"num_attention_heads": 32,
|
15 |
+
"num_hidden_layers": 32,
|
16 |
+
"num_key_value_heads": 8,
|
17 |
+
"pad_token_id": 0,
|
18 |
+
"pretraining_tp": 1,
|
19 |
+
"quantization_config": {
|
20 |
+
"batch_size": 1,
|
21 |
+
"bits": 4,
|
22 |
+
"block_name_to_quantize": "model.layers",
|
23 |
+
"damp_percent": 0.1,
|
24 |
+
"desc_act": true,
|
25 |
+
"disable_exllama": true,
|
26 |
+
"group_size": 128,
|
27 |
+
"max_input_length": null,
|
28 |
+
"model_seqlen": 4096,
|
29 |
+
"module_name_preceding_first_block": [
|
30 |
+
"model.embed_tokens"
|
31 |
+
],
|
32 |
+
"pad_token_id": null,
|
33 |
+
"quant_method": "gptq",
|
34 |
+
"sym": true,
|
35 |
+
"tokenizer": null,
|
36 |
+
"true_sequential": true,
|
37 |
+
"use_cuda_fp16": true
|
38 |
+
},
|
39 |
+
"rms_norm_eps": 1e-05,
|
40 |
+
"rope_theta": 10000.0,
|
41 |
+
"sliding_window": 4096,
|
42 |
+
"tie_word_embeddings": false,
|
43 |
+
"torch_dtype": "float16",
|
44 |
+
"transformers_version": "4.34.0.dev0",
|
45 |
+
"use_cache": true,
|
46 |
+
"vocab_size": 32000
|
47 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 1,
|
4 |
+
"eos_token_id": 2,
|
5 |
+
"transformers_version": "4.34.0.dev0"
|
6 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9b98560b18e848939c008d3cfb8a507cd89734e6a8adae071278c860d3bcaddc
|
3 |
+
size 4158662096
|
quantize_config.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bits": 4,
|
3 |
+
"group_size": 128,
|
4 |
+
"damp_percent": 0.01,
|
5 |
+
"desc_act": true,
|
6 |
+
"sym": true,
|
7 |
+
"true_sequential": true
|
8 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": "<s>",
|
3 |
+
"eos_token": "</s>",
|
4 |
+
"pad_token": "</s>",
|
5 |
+
"unk_token": "<unk>"
|
6 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dadfd56d766715c61d2ef780a525ab43b8e6da4de6865bda3d95fdef5e134055
|
3 |
+
size 493443
|
tokenizer_config.json
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"added_tokens_decoder": {
|
5 |
+
"0": {
|
6 |
+
"content": "<unk>",
|
7 |
+
"lstrip": false,
|
8 |
+
"normalized": false,
|
9 |
+
"rstrip": false,
|
10 |
+
"single_word": false,
|
11 |
+
"special": true
|
12 |
+
},
|
13 |
+
"1": {
|
14 |
+
"content": "<s>",
|
15 |
+
"lstrip": false,
|
16 |
+
"normalized": false,
|
17 |
+
"rstrip": false,
|
18 |
+
"single_word": false,
|
19 |
+
"special": true
|
20 |
+
},
|
21 |
+
"2": {
|
22 |
+
"content": "</s>",
|
23 |
+
"lstrip": false,
|
24 |
+
"normalized": false,
|
25 |
+
"rstrip": false,
|
26 |
+
"single_word": false,
|
27 |
+
"special": true
|
28 |
+
}
|
29 |
+
},
|
30 |
+
"additional_special_tokens": [],
|
31 |
+
"bos_token": "<s>",
|
32 |
+
"clean_up_tokenization_spaces": false,
|
33 |
+
"eos_token": "</s>",
|
34 |
+
"legacy": true,
|
35 |
+
"model_max_length": 1000000000000000019884624838656,
|
36 |
+
"pad_token": null,
|
37 |
+
"sp_model_kwargs": {},
|
38 |
+
"spaces_between_special_tokens": false,
|
39 |
+
"tokenizer_class": "LlamaTokenizer",
|
40 |
+
"unk_token": "<unk>",
|
41 |
+
"use_default_system_prompt": true
|
42 |
+
}
|