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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: brucethemoose/Yi-34B-200K-DARE-megamerge-v8
|
3 |
+
inference: false
|
4 |
+
language:
|
5 |
+
- en
|
6 |
+
library_name: transformers
|
7 |
+
license: other
|
8 |
+
license_link: https://huggingface.co/01-ai/Yi-34B/blob/main/LICENSE
|
9 |
+
license_name: yi-license
|
10 |
+
model_creator: brucethemoose
|
11 |
+
model_name: Yi 34B 200K DARE MegaMerge V8
|
12 |
+
model_type: yi
|
13 |
+
prompt_template: 'SYSTEM: {system_message}
|
14 |
+
|
15 |
+
USER: {prompt}
|
16 |
+
|
17 |
+
ASSISTANT:
|
18 |
+
|
19 |
+
'
|
20 |
+
quantized_by: TheBloke
|
21 |
+
tags:
|
22 |
+
- mergekit
|
23 |
+
- merge
|
24 |
+
- Yi
|
25 |
+
---
|
26 |
+
<!-- markdownlint-disable MD041 -->
|
27 |
+
|
28 |
+
<!-- header start -->
|
29 |
+
<!-- 200823 -->
|
30 |
+
<div style="width: auto; margin-left: auto; margin-right: auto">
|
31 |
+
<img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
|
32 |
+
</div>
|
33 |
+
<div style="display: flex; justify-content: space-between; width: 100%;">
|
34 |
+
<div style="display: flex; flex-direction: column; align-items: flex-start;">
|
35 |
+
<p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
|
36 |
+
</div>
|
37 |
+
<div style="display: flex; flex-direction: column; align-items: flex-end;">
|
38 |
+
<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>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
<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>
|
42 |
+
<hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
|
43 |
+
<!-- header end -->
|
44 |
+
|
45 |
+
# Yi 34B 200K DARE MegaMerge V8 - GPTQ
|
46 |
+
- Model creator: [brucethemoose](https://huggingface.co/brucethemoose)
|
47 |
+
- Original model: [Yi 34B 200K DARE MegaMerge V8](https://huggingface.co/brucethemoose/Yi-34B-200K-DARE-megamerge-v8)
|
48 |
+
|
49 |
+
<!-- description start -->
|
50 |
+
# Description
|
51 |
+
|
52 |
+
This repo contains GPTQ model files for [brucethemoose's Yi 34B 200K DARE MegaMerge V8](https://huggingface.co/brucethemoose/Yi-34B-200K-DARE-megamerge-v8).
|
53 |
+
|
54 |
+
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.
|
55 |
+
|
56 |
+
<!-- description end -->
|
57 |
+
<!-- repositories-available start -->
|
58 |
+
## Repositories available
|
59 |
+
|
60 |
+
* [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Yi-34B-200K-DARE-megamerge-v8-AWQ)
|
61 |
+
* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Yi-34B-200K-DARE-megamerge-v8-GPTQ)
|
62 |
+
* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Yi-34B-200K-DARE-megamerge-v8-GGUF)
|
63 |
+
* [brucethemoose's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/brucethemoose/Yi-34B-200K-DARE-megamerge-v8)
|
64 |
+
<!-- repositories-available end -->
|
65 |
+
|
66 |
+
<!-- prompt-template start -->
|
67 |
+
## Prompt template: Orca-Vicuna
|
68 |
+
|
69 |
+
```
|
70 |
+
SYSTEM: {system_message}
|
71 |
+
USER: {prompt}
|
72 |
+
ASSISTANT:
|
73 |
+
|
74 |
+
```
|
75 |
+
|
76 |
+
<!-- prompt-template end -->
|
77 |
+
|
78 |
+
|
79 |
+
|
80 |
+
<!-- README_GPTQ.md-compatible clients start -->
|
81 |
+
## Known compatible clients / servers
|
82 |
+
|
83 |
+
GPTQ models are currently supported on Linux (NVidia/AMD) and Windows (NVidia only). macOS users: please use GGUF models.
|
84 |
+
|
85 |
+
These GPTQ models are known to work in the following inference servers/webuis.
|
86 |
+
|
87 |
+
- [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
|
88 |
+
- [KoboldAI United](https://github.com/henk717/koboldai)
|
89 |
+
- [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui)
|
90 |
+
- [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
|
91 |
+
|
92 |
+
This may not be a complete list; if you know of others, please let me know!
|
93 |
+
<!-- README_GPTQ.md-compatible clients end -->
|
94 |
+
|
95 |
+
<!-- README_GPTQ.md-provided-files start -->
|
96 |
+
## Provided files, and GPTQ parameters
|
97 |
+
|
98 |
+
Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
|
99 |
+
|
100 |
+
Each separate quant is in a different branch. See below for instructions on fetching from different branches.
|
101 |
+
|
102 |
+
Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
|
103 |
+
|
104 |
+
<details>
|
105 |
+
<summary>Explanation of GPTQ parameters</summary>
|
106 |
+
|
107 |
+
- Bits: The bit size of the quantised model.
|
108 |
+
- GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
|
109 |
+
- 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.
|
110 |
+
- Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
|
111 |
+
- 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).
|
112 |
+
- 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.
|
113 |
+
- ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
|
114 |
+
|
115 |
+
</details>
|
116 |
+
|
117 |
+
| Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
|
118 |
+
| ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
|
119 |
+
| [main](https://huggingface.co/TheBloke/Yi-34B-200K-DARE-megamerge-v8-GPTQ/tree/main) | 4 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 18.60 GB | Yes | 4-bit, with Act Order. No group size, to lower VRAM requirements. |
|
120 |
+
| [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/Yi-34B-200K-DARE-megamerge-v8-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 19.25 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
|
121 |
+
| [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/Yi-34B-200K-DARE-megamerge-v8-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 21.21 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
|
122 |
+
| [gptq-3bit-128g-actorder_True](https://huggingface.co/TheBloke/Yi-34B-200K-DARE-megamerge-v8-GPTQ/tree/gptq-3bit-128g-actorder_True) | 3 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 15.03 GB | No | 3-bit, with group size 128g and act-order. Higher quality than 128g-False. |
|
123 |
+
| [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/Yi-34B-200K-DARE-megamerge-v8-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 35.34 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
|
124 |
+
| [gptq-3bit-32g-actorder_True](https://huggingface.co/TheBloke/Yi-34B-200K-DARE-megamerge-v8-GPTQ/tree/gptq-3bit-32g-actorder_True) | 3 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 16.90 GB | No | 3-bit, with group size 64g and act-order. Highest quality 3-bit option. |
|
125 |
+
| [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/Yi-34B-200K-DARE-megamerge-v8-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 36.12 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
|
126 |
+
|
127 |
+
<!-- README_GPTQ.md-provided-files end -->
|
128 |
+
|
129 |
+
<!-- README_GPTQ.md-download-from-branches start -->
|
130 |
+
## How to download, including from branches
|
131 |
+
|
132 |
+
### In text-generation-webui
|
133 |
+
|
134 |
+
To download from the `main` branch, enter `TheBloke/Yi-34B-200K-DARE-megamerge-v8-GPTQ` in the "Download model" box.
|
135 |
+
|
136 |
+
To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/Yi-34B-200K-DARE-megamerge-v8-GPTQ:gptq-4bit-128g-actorder_True`
|
137 |
+
|
138 |
+
### From the command line
|
139 |
+
|
140 |
+
I recommend using the `huggingface-hub` Python library:
|
141 |
+
|
142 |
+
```shell
|
143 |
+
pip3 install huggingface-hub
|
144 |
+
```
|
145 |
+
|
146 |
+
To download the `main` branch to a folder called `Yi-34B-200K-DARE-megamerge-v8-GPTQ`:
|
147 |
+
|
148 |
+
```shell
|
149 |
+
mkdir Yi-34B-200K-DARE-megamerge-v8-GPTQ
|
150 |
+
huggingface-cli download TheBloke/Yi-34B-200K-DARE-megamerge-v8-GPTQ --local-dir Yi-34B-200K-DARE-megamerge-v8-GPTQ --local-dir-use-symlinks False
|
151 |
+
```
|
152 |
+
|
153 |
+
To download from a different branch, add the `--revision` parameter:
|
154 |
+
|
155 |
+
```shell
|
156 |
+
mkdir Yi-34B-200K-DARE-megamerge-v8-GPTQ
|
157 |
+
huggingface-cli download TheBloke/Yi-34B-200K-DARE-megamerge-v8-GPTQ --revision gptq-4bit-128g-actorder_True --local-dir Yi-34B-200K-DARE-megamerge-v8-GPTQ --local-dir-use-symlinks False
|
158 |
+
```
|
159 |
+
|
160 |
+
<details>
|
161 |
+
<summary>More advanced huggingface-cli download usage</summary>
|
162 |
+
|
163 |
+
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.
|
164 |
+
|
165 |
+
The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
|
166 |
+
|
167 |
+
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).
|
168 |
+
|
169 |
+
To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
|
170 |
+
|
171 |
+
```shell
|
172 |
+
pip3 install hf_transfer
|
173 |
+
```
|
174 |
+
|
175 |
+
And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
|
176 |
+
|
177 |
+
```shell
|
178 |
+
mkdir Yi-34B-200K-DARE-megamerge-v8-GPTQ
|
179 |
+
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/Yi-34B-200K-DARE-megamerge-v8-GPTQ --local-dir Yi-34B-200K-DARE-megamerge-v8-GPTQ --local-dir-use-symlinks False
|
180 |
+
```
|
181 |
+
|
182 |
+
Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
|
183 |
+
</details>
|
184 |
+
|
185 |
+
### With `git` (**not** recommended)
|
186 |
+
|
187 |
+
To clone a specific branch with `git`, use a command like this:
|
188 |
+
|
189 |
+
```shell
|
190 |
+
git clone --single-branch --branch gptq-4bit-128g-actorder_True https://huggingface.co/TheBloke/Yi-34B-200K-DARE-megamerge-v8-GPTQ
|
191 |
+
```
|
192 |
+
|
193 |
+
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.)
|
194 |
+
|
195 |
+
<!-- README_GPTQ.md-download-from-branches end -->
|
196 |
+
<!-- README_GPTQ.md-text-generation-webui start -->
|
197 |
+
## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
|
198 |
+
|
199 |
+
Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
|
200 |
+
|
201 |
+
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.
|
202 |
+
|
203 |
+
1. Click the **Model tab**.
|
204 |
+
2. Under **Download custom model or LoRA**, enter `TheBloke/Yi-34B-200K-DARE-megamerge-v8-GPTQ`.
|
205 |
+
|
206 |
+
- To download from a specific branch, enter for example `TheBloke/Yi-34B-200K-DARE-megamerge-v8-GPTQ:gptq-4bit-128g-actorder_True`
|
207 |
+
- see Provided Files above for the list of branches for each option.
|
208 |
+
|
209 |
+
3. Click **Download**.
|
210 |
+
4. The model will start downloading. Once it's finished it will say "Done".
|
211 |
+
5. In the top left, click the refresh icon next to **Model**.
|
212 |
+
6. In the **Model** dropdown, choose the model you just downloaded: `Yi-34B-200K-DARE-megamerge-v8-GPTQ`
|
213 |
+
7. The model will automatically load, and is now ready for use!
|
214 |
+
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.
|
215 |
+
|
216 |
+
- 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`.
|
217 |
+
|
218 |
+
9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
|
219 |
+
|
220 |
+
<!-- README_GPTQ.md-text-generation-webui end -->
|
221 |
+
|
222 |
+
<!-- README_GPTQ.md-use-from-tgi start -->
|
223 |
+
## Serving this model from Text Generation Inference (TGI)
|
224 |
+
|
225 |
+
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`
|
226 |
+
|
227 |
+
Example Docker parameters:
|
228 |
+
|
229 |
+
```shell
|
230 |
+
--model-id TheBloke/Yi-34B-200K-DARE-megamerge-v8-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
|
231 |
+
```
|
232 |
+
|
233 |
+
Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
|
234 |
+
|
235 |
+
```shell
|
236 |
+
pip3 install huggingface-hub
|
237 |
+
```
|
238 |
+
|
239 |
+
```python
|
240 |
+
from huggingface_hub import InferenceClient
|
241 |
+
|
242 |
+
endpoint_url = "https://your-endpoint-url-here"
|
243 |
+
|
244 |
+
prompt = "Tell me about AI"
|
245 |
+
prompt_template=f'''SYSTEM: {system_message}
|
246 |
+
USER: {prompt}
|
247 |
+
ASSISTANT:
|
248 |
+
'''
|
249 |
+
|
250 |
+
client = InferenceClient(endpoint_url)
|
251 |
+
response = client.text_generation(
|
252 |
+
prompt_template,
|
253 |
+
max_new_tokens=128,
|
254 |
+
do_sample=True,
|
255 |
+
temperature=0.7,
|
256 |
+
top_p=0.95,
|
257 |
+
top_k=40,
|
258 |
+
repetition_penalty=1.1
|
259 |
+
)
|
260 |
+
|
261 |
+
print(f"Model output: {response}")
|
262 |
+
```
|
263 |
+
<!-- README_GPTQ.md-use-from-tgi end -->
|
264 |
+
<!-- README_GPTQ.md-use-from-python start -->
|
265 |
+
## Python code example: inference from this GPTQ model
|
266 |
+
|
267 |
+
### Install the necessary packages
|
268 |
+
|
269 |
+
Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
|
270 |
+
|
271 |
+
```shell
|
272 |
+
pip3 install --upgrade transformers optimum
|
273 |
+
# If using PyTorch 2.1 + CUDA 12.x:
|
274 |
+
pip3 install --upgrade auto-gptq
|
275 |
+
# or, if using PyTorch 2.1 + CUDA 11.x:
|
276 |
+
pip3 install --upgrade auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/
|
277 |
+
```
|
278 |
+
|
279 |
+
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:
|
280 |
+
|
281 |
+
```shell
|
282 |
+
pip3 uninstall -y auto-gptq
|
283 |
+
git clone https://github.com/PanQiWei/AutoGPTQ
|
284 |
+
cd AutoGPTQ
|
285 |
+
git checkout v0.5.1
|
286 |
+
pip3 install .
|
287 |
+
```
|
288 |
+
|
289 |
+
### Example Python code
|
290 |
+
|
291 |
+
```python
|
292 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
293 |
+
|
294 |
+
model_name_or_path = "TheBloke/Yi-34B-200K-DARE-megamerge-v8-GPTQ"
|
295 |
+
# To use a different branch, change revision
|
296 |
+
# For example: revision="gptq-4bit-128g-actorder_True"
|
297 |
+
model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
|
298 |
+
device_map="auto",
|
299 |
+
trust_remote_code=False,
|
300 |
+
revision="main")
|
301 |
+
|
302 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
|
303 |
+
|
304 |
+
prompt = "Write a story about llamas"
|
305 |
+
system_message = "You are a story writing assistant"
|
306 |
+
prompt_template=f'''SYSTEM: {system_message}
|
307 |
+
USER: {prompt}
|
308 |
+
ASSISTANT:
|
309 |
+
'''
|
310 |
+
|
311 |
+
print("\n\n*** Generate:")
|
312 |
+
|
313 |
+
input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
|
314 |
+
output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
|
315 |
+
print(tokenizer.decode(output[0]))
|
316 |
+
|
317 |
+
# Inference can also be done using transformers' pipeline
|
318 |
+
|
319 |
+
print("*** Pipeline:")
|
320 |
+
pipe = pipeline(
|
321 |
+
"text-generation",
|
322 |
+
model=model,
|
323 |
+
tokenizer=tokenizer,
|
324 |
+
max_new_tokens=512,
|
325 |
+
do_sample=True,
|
326 |
+
temperature=0.7,
|
327 |
+
top_p=0.95,
|
328 |
+
top_k=40,
|
329 |
+
repetition_penalty=1.1
|
330 |
+
)
|
331 |
+
|
332 |
+
print(pipe(prompt_template)[0]['generated_text'])
|
333 |
+
```
|
334 |
+
<!-- README_GPTQ.md-use-from-python end -->
|
335 |
+
|
336 |
+
<!-- README_GPTQ.md-compatibility start -->
|
337 |
+
## Compatibility
|
338 |
+
|
339 |
+
The files provided are tested to work with Transformers. For non-Mistral models, AutoGPTQ can also be used directly.
|
340 |
+
|
341 |
+
[ExLlama](https://github.com/turboderp/exllama) is compatible with Llama architecture models (including Mistral, Yi, DeepSeek, SOLAR, etc) in 4-bit. Please see the Provided Files table above for per-file compatibility.
|
342 |
+
|
343 |
+
For a list of clients/servers, please see "Known compatible clients / servers", above.
|
344 |
+
<!-- README_GPTQ.md-compatibility end -->
|
345 |
+
|
346 |
+
<!-- footer start -->
|
347 |
+
<!-- 200823 -->
|
348 |
+
## Discord
|
349 |
+
|
350 |
+
For further support, and discussions on these models and AI in general, join us at:
|
351 |
+
|
352 |
+
[TheBloke AI's Discord server](https://discord.gg/theblokeai)
|
353 |
+
|
354 |
+
## Thanks, and how to contribute
|
355 |
+
|
356 |
+
Thanks to the [chirper.ai](https://chirper.ai) team!
|
357 |
+
|
358 |
+
Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
|
359 |
+
|
360 |
+
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.
|
361 |
+
|
362 |
+
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.
|
363 |
+
|
364 |
+
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
|
365 |
+
|
366 |
+
* Patreon: https://patreon.com/TheBlokeAI
|
367 |
+
* Ko-Fi: https://ko-fi.com/TheBlokeAI
|
368 |
+
|
369 |
+
**Special thanks to**: Aemon Algiz.
|
370 |
+
|
371 |
+
**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
|
372 |
+
|
373 |
+
|
374 |
+
Thank you to all my generous patrons and donaters!
|
375 |
+
|
376 |
+
And thank you again to a16z for their generous grant.
|
377 |
+
|
378 |
+
<!-- footer end -->
|
379 |
+
|
380 |
+
# Original model card: brucethemoose's Yi 34B 200K DARE MegaMerge V8
|
381 |
+
|
382 |
+
# Yi 34B 200K DARE Merge v8
|
383 |
+
|
384 |
+
A merge of many Yi 34B 200K models using the new DARE Ties method via mergekit. The goal is to create a merge model that excels at 32K+ context performance, without any additional finetuning.
|
385 |
+
|
386 |
+
## Prompt template: Orca-Vicuna
|
387 |
+
```
|
388 |
+
SYSTEM: {system_message}
|
389 |
+
USER: {prompt}
|
390 |
+
ASSISTANT:
|
391 |
+
```
|
392 |
+
It might recognize ChatML, and possibly Alpaca-like formats. Raw prompting as described here is also effective: https://old.reddit.com/r/LocalLLaMA/comments/18zqy4s/the_secret_to_writing_quality_stories_with_llms/
|
393 |
+
|
394 |
+
|
395 |
+
|
396 |
+
## Running
|
397 |
+
Being a Yi model, run a lower temperature with 0.05 or higher MinP, a little repetition penalty, maybe mirostat with a low tau, and no other samplers. Yi tends to run "hot" by default, and it really needs a low temperature + MinP to cull Yi's huge vocabulary. See the explanation here: https://github.com/ggerganov/llama.cpp/pull/3841
|
398 |
+
|
399 |
+
24GB GPUs can efficiently run Yi-34B-200K models at **40K-90K context** with exllamav2, and performant UIs like [exui](https://github.com/turboderp/exui). I go into more detail in this [post](https://old.reddit.com/r/LocalLLaMA/comments/1896igc/how_i_run_34b_models_at_75k_context_on_24gb_fast/). 16GB GPUs can still run the high context with aggressive quantization.
|
400 |
+
|
401 |
+
I recommend exl2 quantizations profiled on data similar to the desired task. It is especially sensitive to the quantization data at low bpw. I've upload my own fiction-oriented quantizations here: https://huggingface.co/collections/brucethemoose/most-recent-merge-65742644ca03b6c514afa204
|
402 |
+
|
403 |
+
To load/train this in full-context backends like transformers, you *must* change `max_position_embeddings` in config.json to a lower value than 200,000, otherwise you will OOM! I do not recommend running high context without context-efficient backends like exllamav2, litellm or unsloth.
|
404 |
+
|
405 |
+
|
406 |
+
## Testing Notes
|
407 |
+
|
408 |
+
See: https://huggingface.co/brucethemoose/Yi-34B-200K-DARE-merge-v5#testing-notes
|
409 |
+
|
410 |
+
An intermediate merge model was created to try and extend the context of several 4k models before adding them to the main merge, as seen in the "megamerge" recipe below. I can upload this upon request
|
411 |
+
|
412 |
+
In addition, the weight gradients are biased towards Vicuna-format models in the first few layers to try and "emphasize" the Orca-Vicuna prompt template. How sucessful this is remains to be seen.
|
413 |
+
|
414 |
+
|
415 |
+
|
416 |
+
## Merge Details
|
417 |
+
### Merge Method
|
418 |
+
|
419 |
+
This model was merged using the [DARE](https://arxiv.org/abs/2311.03099) [TIES](https://arxiv.org/abs/2306.01708) merge method using /home/alpha/Storage/Models/Raw/chargoddard_Yi-34B-200K-Llama as a base.
|
420 |
+
|
421 |
+
### Models Merged
|
422 |
+
|
423 |
+
The following models were included in the merge:
|
424 |
+
* https://huggingface.co/kyujinpy/PlatYi-34B-200k-Q-FastChat
|
425 |
+
* https://huggingface.co/jondurbin/bagel-34b-v0.2
|
426 |
+
* https://huggingface.co/migtissera/Tess-M-Creative-v1.0
|
427 |
+
* https://huggingface.co/brucethemoose/SUS-Bagel-200K-DARE-Test
|
428 |
+
* https://huggingface.co/Mihaiii/Pallas-0.5
|
429 |
+
* https://huggingface.co/bhenrym14/airoboros-3_1-yi-34b-200k
|
430 |
+
* https://huggingface.co/adamo1139/Yi-34B-200K-AEZAKMI-v2
|
431 |
+
* https://huggingface.co/migtissera/Tess-34B-v1.4
|
432 |
+
* https://huggingface.co/SUSTech/SUS-Chat-34B
|
433 |
+
* https://huggingface.co/jondurbin/bagel-dpo-34b-v0.2
|
434 |
+
* https://huggingface.co/bhenrym14/platypus-yi-34b
|
435 |
+
* https://huggingface.co/Weyaxi/Nous-Hermes-2-SUS-Chat-34B-Slerp
|
436 |
+
* https://huggingface.co/TriadParty/deepsex-34b
|
437 |
+
* https://huggingface.co/TriadParty/deepmoney-34b-200k-base
|
438 |
+
* https://huggingface.co/chargoddard/Yi-34B-200K-Llama
|
439 |
+
* https://huggingface.co/chargoddard/Yi-34B-Llama
|
440 |
+
|
441 |
+
### Configuration
|
442 |
+
|
443 |
+
The following YAML configuration was used to produce this model:
|
444 |
+
|
445 |
+
```yaml
|
446 |
+
models:
|
447 |
+
- model: /home/alpha/Models/Raw/chargoddard_Yi-34B-Llama
|
448 |
+
# No parameters necessary for base model
|
449 |
+
- model: /home/alpha/Storage/Models/Raw/chargoddard_Yi-34B-200K-Llama
|
450 |
+
#200K base to extend the context of 4K models, max density as we *want* it to 'interfere'
|
451 |
+
parameters:
|
452 |
+
weight: 0.33
|
453 |
+
density: 1
|
454 |
+
- model: /home/alpha/Models/Raw/Weyaxi_Nous-Hermes-2-SUS-Chat-34B-Slerp
|
455 |
+
parameters:
|
456 |
+
weight: 0.15
|
457 |
+
density: 0.36
|
458 |
+
- model: /home/alpha/Models/Raw/jondurbin_bagel-dpo-34b-v0.2
|
459 |
+
#Mix dpo with sft to tone down dpo
|
460 |
+
parameters:
|
461 |
+
weight: 0.06
|
462 |
+
density: 0.36
|
463 |
+
- model: /home/alpha/Models/Raw/jondurbin_bagel-34b-v0.2
|
464 |
+
parameters:
|
465 |
+
weight: 0.06
|
466 |
+
density: 0.41
|
467 |
+
- model: /home/alpha/Models/Raw/bhenrym14_platypus-yi-34b
|
468 |
+
#Vicuna format
|
469 |
+
parameters:
|
470 |
+
weight: 0.19
|
471 |
+
density: 0.41
|
472 |
+
# - model: /home/alpha/Models/Raw/01-ai_Yi-34B-Chat #+/home/alpha/Models/Raw/Doctor-Shotgun_limarpv3-yi-llama-34b-lora
|
473 |
+
# #Can't get lora OR base model to work without erroring out?
|
474 |
+
# parameters:
|
475 |
+
# weight: 0.04
|
476 |
+
# density: 0.36
|
477 |
+
- model: /home/alpha/Models/Raw/TriadParty_deepsex-34b
|
478 |
+
#Base model with no prompt
|
479 |
+
parameters:
|
480 |
+
weight: 0.21
|
481 |
+
density: 0.39
|
482 |
+
merge_method: dare_ties
|
483 |
+
tokenizer_source: union
|
484 |
+
base_model: /home/alpha/Models/Raw/chargoddard_Yi-34B-Llama
|
485 |
+
parameters:
|
486 |
+
int8_mask: true
|
487 |
+
dtype: bfloat16
|
488 |
+
name: 4kmerge-v2
|
489 |
+
---
|
490 |
+
models:
|
491 |
+
- model: /home/alpha/Storage/Models/Raw/chargoddard_Yi-34B-200K-Llama
|
492 |
+
# No parameters necessary for base model
|
493 |
+
- model: /home/alpha/Storage/Models/Raw/migtissera_Tess-34B-v1.4
|
494 |
+
#Emphasize the beginning of Vicuna format models
|
495 |
+
parameters:
|
496 |
+
weight: [0.22, 0.113, 0.113, 0.113, 0.113, 0.113]
|
497 |
+
density: 0.61
|
498 |
+
- model: /home/alpha/Models/Raw/Mihaiii_Pallas-0.5
|
499 |
+
# Vicuna format
|
500 |
+
parameters:
|
501 |
+
weight: [0.22, 0.113, 0.113, 0.113, 0.113, 0.113]
|
502 |
+
density: 0.61
|
503 |
+
- model: /home/alpha//Storage/Models/Raw/bhenrym14_airoboros-3_1-yi-34b-200k
|
504 |
+
parameters:
|
505 |
+
weight: [0.02, 0.081, 0.081, 0.081, 0.081, 0.081]
|
506 |
+
density: 0.59
|
507 |
+
- model: /home/alpha/Storage/Models/Raw/jondurbin_bagel-34b-v0.2
|
508 |
+
#Only the SFT in the main merge since the DPO version seems to have no long context ability at all, and some overfitting(?) issues
|
509 |
+
parameters:
|
510 |
+
weight: [0.02, 0.093, 0.093, 0.093, 0.093, 0.093]
|
511 |
+
density: 0.4
|
512 |
+
- model: /home/alpha/Storage/Models/Raw/kyujinpy_PlatYi-34B-200k-Q-FastChat
|
513 |
+
parameters:
|
514 |
+
weight: [0.02, 0.081, 0.081, 0.081, 0.081, 0.081]
|
515 |
+
density: 0.59
|
516 |
+
#- model: /home/alpha/Storage/Models/Raw/ehartford_dolphin-2.2-yi-34b-200k
|
517 |
+
# Dolphin 200K seems to be funky according to multiple leaderboards and perplexity tests?
|
518 |
+
# parameters:
|
519 |
+
# weight: 0.15
|
520 |
+
# density: 0.6
|
521 |
+
- model: /home/alpha/Models/Raw/adamo1139_Yi-34B-200K-AEZAKMI-v2
|
522 |
+
parameters:
|
523 |
+
weight: [0.02, 0.096, 0.096, 0.096, 0.096, 0.096]
|
524 |
+
density: 0.59
|
525 |
+
- model: /home/alpha/Storage/Models/Raw/Nous-Capybara-34B
|
526 |
+
parameters:
|
527 |
+
weight: [0.21, 0.115, 0.115, 0.115, 0.115, 0.115]
|
528 |
+
density: 0.59
|
529 |
+
- model: 4kmerge-v2
|
530 |
+
#Previous merge
|
531 |
+
parameters:
|
532 |
+
weight: [0.02, 0.115, 0.115, 0.115, 0.115, 0.115]
|
533 |
+
density: 0.4
|
534 |
+
- model: /home/alpha/Models/Raw/migtissera_Tess-M-Creative-v1.0
|
535 |
+
# Vicuna format
|
536 |
+
parameters:
|
537 |
+
weight: [0.21, 0.09, 0.09, 0.09, 0.09, 0.09]
|
538 |
+
density: 0.61
|
539 |
+
- model: /home/alpha/Models/Raw/TriadParty_deepmoney-34b-200k-base
|
540 |
+
# No prompt format, native long context full finetune
|
541 |
+
parameters:
|
542 |
+
weight: [0.04, 0.103, 0.103, 0.103, 0.103, 0.103]
|
543 |
+
density: 0.61
|
544 |
+
merge_method: dare_ties
|
545 |
+
tokenizer_source: union
|
546 |
+
base_model: /home/alpha/Storage/Models/Raw/chargoddard_Yi-34B-200K-Llama
|
547 |
+
parameters:
|
548 |
+
int8_mask: true
|
549 |
+
dtype: bfloat16
|
550 |
+
```
|