p-christ TheBloke commited on
Commit
7e448d5
0 Parent(s):

Duplicate from TheBloke/Mixtral-8x7B-v0.1-GPTQ

Browse files

Co-authored-by: Tom Jobbins <[email protected]>

.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,436 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: mistralai/Mixtral-8x7B-v0.1
3
+ inference: false
4
+ language:
5
+ - fr
6
+ - it
7
+ - de
8
+ - es
9
+ - en
10
+ license: apache-2.0
11
+ model_creator: Mistral AI_
12
+ model_name: Mixtral 8X7B v0.1
13
+ model_type: mixtral
14
+ prompt_template: '{prompt}
15
+
16
+ '
17
+ quantized_by: TheBloke
18
+ ---
19
+ <!-- markdownlint-disable MD041 -->
20
+
21
+ <!-- header start -->
22
+ <!-- 200823 -->
23
+ <div style="width: auto; margin-left: auto; margin-right: auto">
24
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
25
+ </div>
26
+ <div style="display: flex; justify-content: space-between; width: 100%;">
27
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
28
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
29
+ </div>
30
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
31
+ <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>
32
+ </div>
33
+ </div>
34
+ <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>
35
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
36
+ <!-- header end -->
37
+
38
+ # Mixtral 8X7B v0.1 - GPTQ
39
+ - Model creator: [Mistral AI_](https://huggingface.co/mistralai)
40
+ - Original model: [Mixtral 8X7B v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-v0.1)
41
+
42
+ <!-- description start -->
43
+ # Description
44
+
45
+ This repo contains GPTQ model files for [Mistral AI_'s Mixtral 8X7B v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-v0.1).
46
+
47
+ Mixtral GPTQs currently require:
48
+ * Transformers 4.36.0 or later
49
+ * either, AutoGPTQ 0.6 compiled from source, or
50
+ * Transformers 4.37.0.dev0 compiled from Github with: `pip3 install git+https://github.com/huggingface/transformers`
51
+
52
+ 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.
53
+
54
+ <!-- description end -->
55
+ <!-- repositories-available start -->
56
+ ## Repositories available
57
+
58
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/mixtral-8x7b-v0.1-AWQ)
59
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ)
60
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GGUF)
61
+ * [Mistral AI_'s original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/mistralai/Mixtral-8x7B-v0.1)
62
+ <!-- repositories-available end -->
63
+
64
+ <!-- prompt-template start -->
65
+ ## Prompt template: None
66
+
67
+ ```
68
+ {prompt}
69
+
70
+ ```
71
+
72
+ <!-- prompt-template end -->
73
+
74
+
75
+
76
+ <!-- README_GPTQ.md-compatible clients start -->
77
+ ## Known compatible clients / servers
78
+
79
+ GPTQ models are currently supported on Linux (NVidia/AMD) and Windows (NVidia only). macOS users: please use GGUF models.
80
+
81
+ Mixtral GPTQs currently have special requirements - see Description above.
82
+
83
+ <!-- README_GPTQ.md-compatible clients end -->
84
+
85
+ <!-- README_GPTQ.md-provided-files start -->
86
+ ## Provided files, and GPTQ parameters
87
+
88
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
89
+
90
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
91
+
92
+ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
93
+
94
+ <details>
95
+ <summary>Explanation of GPTQ parameters</summary>
96
+
97
+ - Bits: The bit size of the quantised model.
98
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
99
+ - 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.
100
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
101
+ - 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).
102
+ - 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.
103
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
104
+
105
+ </details>
106
+
107
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
108
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
109
+ | [main](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ/tree/main) | 4 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 23.81 GB | No | 4-bit, with Act Order. No group size, to lower VRAM requirements. |
110
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 24.70 GB | No | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
111
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 27.42 GB | No | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
112
+ | [gptq-3bit--1g-actorder_True](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ/tree/gptq-3bit--1g-actorder_True) | 3 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 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. |
113
+ | [gptq-3bit-128g-actorder_True](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ/tree/gptq-3bit-128g-actorder_True) | 3 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 18.85 GB | No | 3-bit, with group size 128g and act-order. Higher quality than 128g-False. |
114
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 47.04 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
115
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [VMware Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 48.10 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
116
+
117
+ <!-- README_GPTQ.md-provided-files end -->
118
+
119
+ <!-- README_GPTQ.md-download-from-branches start -->
120
+ ## How to download, including from branches
121
+
122
+ ### In text-generation-webui
123
+
124
+ To download from the `main` branch, enter `TheBloke/Mixtral-8x7B-v0.1-GPTQ` in the "Download model" box.
125
+
126
+ To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/Mixtral-8x7B-v0.1-GPTQ:gptq-4bit-128g-actorder_True`
127
+
128
+ ### From the command line
129
+
130
+ I recommend using the `huggingface-hub` Python library:
131
+
132
+ ```shell
133
+ pip3 install huggingface-hub
134
+ ```
135
+
136
+ To download the `main` branch to a folder called `Mixtral-8x7B-v0.1-GPTQ`:
137
+
138
+ ```shell
139
+ mkdir Mixtral-8x7B-v0.1-GPTQ
140
+ huggingface-cli download TheBloke/Mixtral-8x7B-v0.1-GPTQ --local-dir Mixtral-8x7B-v0.1-GPTQ --local-dir-use-symlinks False
141
+ ```
142
+
143
+ To download from a different branch, add the `--revision` parameter:
144
+
145
+ ```shell
146
+ mkdir Mixtral-8x7B-v0.1-GPTQ
147
+ huggingface-cli download TheBloke/Mixtral-8x7B-v0.1-GPTQ --revision gptq-4bit-128g-actorder_True --local-dir Mixtral-8x7B-v0.1-GPTQ --local-dir-use-symlinks False
148
+ ```
149
+
150
+ <details>
151
+ <summary>More advanced huggingface-cli download usage</summary>
152
+
153
+ 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.
154
+
155
+ The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
156
+
157
+ 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).
158
+
159
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
160
+
161
+ ```shell
162
+ pip3 install hf_transfer
163
+ ```
164
+
165
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
166
+
167
+ ```shell
168
+ mkdir Mixtral-8x7B-v0.1-GPTQ
169
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/Mixtral-8x7B-v0.1-GPTQ --local-dir Mixtral-8x7B-v0.1-GPTQ --local-dir-use-symlinks False
170
+ ```
171
+
172
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
173
+ </details>
174
+
175
+ ### With `git` (**not** recommended)
176
+
177
+ To clone a specific branch with `git`, use a command like this:
178
+
179
+ ```shell
180
+ git clone --single-branch --branch gptq-4bit-128g-actorder_True https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ
181
+ ```
182
+
183
+ 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.)
184
+
185
+ <!-- README_GPTQ.md-download-from-branches end -->
186
+ <!-- README_GPTQ.md-text-generation-webui start -->
187
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
188
+
189
+ **NOTE**: Requires:
190
+
191
+ * Transformers 4.36.0, or Transformers 4.37.0.dev0 from Github
192
+ * Either AutoGPTQ 0.6 compiled from source and `Loader: AutoGPTQ`,
193
+ * or, `Loader: Transformers`, if you installed Transformers from Github: `pip3 install git+https://github.com/huggingface/transformers`
194
+
195
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
196
+
197
+ 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.
198
+
199
+ 1. Click the **Model tab**.
200
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/Mixtral-8x7B-v0.1-GPTQ`.
201
+
202
+ - To download from a specific branch, enter for example `TheBloke/Mixtral-8x7B-v0.1-GPTQ:gptq-4bit-128g-actorder_True`
203
+ - see Provided Files above for the list of branches for each option.
204
+
205
+ 3. Click **Download**.
206
+ 4. The model will start downloading. Once it's finished it will say "Done".
207
+ 5. In the top left, click the refresh icon next to **Model**.
208
+ 6. In the **Model** dropdown, choose the model you just downloaded: `Mixtral-8x7B-v0.1-GPTQ`
209
+ 7. The model will automatically load, and is now ready for use!
210
+ 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.
211
+
212
+ - 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`.
213
+
214
+ 9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
215
+
216
+ <!-- README_GPTQ.md-text-generation-webui end -->
217
+
218
+ <!-- README_GPTQ.md-use-from-tgi start -->
219
+ ## Serving this model from Text Generation Inference (TGI)
220
+
221
+ Not currently supported for Mixtral models.
222
+
223
+ <!-- README_GPTQ.md-use-from-tgi end -->
224
+ <!-- README_GPTQ.md-use-from-python start -->
225
+ ## Python code example: inference from this GPTQ model
226
+
227
+ ### Install the necessary packages
228
+
229
+ Requires: Transformers 4.37.0.dev0 from Github, Optimum 1.16.0 or later, and AutoGPTQ 0.5.1 or later.
230
+
231
+ ```shell
232
+ pip3 install --upgrade "git+https://github.com/huggingface/transformers" optimum
233
+ # If using PyTorch 2.1 + CUDA 12.x:
234
+ pip3 install --upgrade auto-gptq
235
+ # or, if using PyTorch 2.1 + CUDA 11.x:
236
+ pip3 install --upgrade auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/
237
+ ```
238
+
239
+ 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:
240
+
241
+ ```shell
242
+ pip3 uninstall -y auto-gptq
243
+ git clone https://github.com/PanQiWei/AutoGPTQ
244
+ cd AutoGPTQ
245
+ DISABLE_QIGEN=1 pip3 install .
246
+ ```
247
+
248
+ ### Example Python code
249
+
250
+ ```python
251
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
252
+
253
+ model_name_or_path = "TheBloke/Mixtral-8x7B-v0.1-GPTQ"
254
+ # To use a different branch, change revision
255
+ # For example: revision="gptq-4bit-128g-actorder_True"
256
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
257
+ device_map="auto",
258
+ trust_remote_code=False,
259
+ revision="main")
260
+
261
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
262
+
263
+ prompt = "Write a story about llamas"
264
+ system_message = "You are a story writing assistant"
265
+ prompt_template=f'''{prompt}
266
+ '''
267
+
268
+ print("\n\n*** Generate:")
269
+
270
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
271
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
272
+ print(tokenizer.decode(output[0]))
273
+
274
+ # Inference can also be done using transformers' pipeline
275
+
276
+ print("*** Pipeline:")
277
+ pipe = pipeline(
278
+ "text-generation",
279
+ model=model,
280
+ tokenizer=tokenizer,
281
+ max_new_tokens=512,
282
+ do_sample=True,
283
+ temperature=0.7,
284
+ top_p=0.95,
285
+ top_k=40,
286
+ repetition_penalty=1.1
287
+ )
288
+
289
+ print(pipe(prompt_template)[0]['generated_text'])
290
+ ```
291
+ <!-- README_GPTQ.md-use-from-python end -->
292
+
293
+ <!-- README_GPTQ.md-compatibility start -->
294
+ ## Compatibility
295
+
296
+ The files provided are tested to work with AutoGPTQ 0.6 (compiled from source) and Transformers 4.37.0 (installed from Github).
297
+
298
+ <!-- README_GPTQ.md-compatibility end -->
299
+
300
+ <!-- footer start -->
301
+ <!-- 200823 -->
302
+ ## Discord
303
+
304
+ For further support, and discussions on these models and AI in general, join us at:
305
+
306
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
307
+
308
+ ## Thanks, and how to contribute
309
+
310
+ Thanks to the [chirper.ai](https://chirper.ai) team!
311
+
312
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
313
+
314
+ 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.
315
+
316
+ 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.
317
+
318
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
319
+
320
+ * Patreon: https://patreon.com/TheBlokeAI
321
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
322
+
323
+ **Special thanks to**: Aemon Algiz.
324
+
325
+ **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
326
+
327
+
328
+ Thank you to all my generous patrons and donaters!
329
+
330
+ And thank you again to a16z for their generous grant.
331
+
332
+ <!-- footer end -->
333
+
334
+ # Original model card: Mistral AI_'s Mixtral 8X7B v0.1
335
+
336
+ # Model Card for Mixtral-8x7B
337
+ The Mixtral-8x7B Large Language Model (LLM) is a pretrained generative Sparse Mixture of Experts. The Mistral-8x7B outperforms Llama 2 70B on most benchmarks we tested.
338
+
339
+ For full details of this model please read our [release blog post](https://mistral.ai/news/mixtral-of-experts/).
340
+
341
+ ## Warning
342
+ This repo contains weights that are compatible with [vLLM](https://github.com/vllm-project/vllm) serving of the model as well as Hugging Face [transformers](https://github.com/huggingface/transformers) library. It is based on the original Mixtral [torrent release](magnet:?xt=urn:btih:5546272da9065eddeb6fcd7ffddeef5b75be79a7&dn=mixtral-8x7b-32kseqlen&tr=udp%3A%2F%http://2Fopentracker.i2p.rocks%3A6969%2Fannounce&tr=http%3A%2F%http://2Ftracker.openbittorrent.com%3A80%2Fannounce), but the file format and parameter names are different. Please note that model cannot (yet) be instantiated with HF.
343
+
344
+ ## Run the model
345
+
346
+
347
+ ```python
348
+ from transformers import AutoModelForCausalLM, AutoTokenizer
349
+
350
+ model_id = "mistralai/Mixtral-8x7B-v0.1"
351
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
352
+
353
+ model = AutoModelForCausalLM.from_pretrained(model_id)
354
+
355
+ text = "Hello my name is"
356
+ inputs = tokenizer(text, return_tensors="pt")
357
+
358
+ outputs = model.generate(**inputs, max_new_tokens=20)
359
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
360
+ ```
361
+
362
+ By default, transformers will load the model in full precision. Therefore you might be interested to further reduce down the memory requirements to run the model through the optimizations we offer in HF ecosystem:
363
+
364
+ ### In half-precision
365
+
366
+ Note `float16` precision only works on GPU devices
367
+
368
+ <details>
369
+ <summary> Click to expand </summary>
370
+
371
+ ```diff
372
+ + import torch
373
+ from transformers import AutoModelForCausalLM, AutoTokenizer
374
+
375
+ model_id = "mistralai/Mixtral-8x7B-v0.1"
376
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
377
+
378
+ + model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16).to(0)
379
+
380
+ text = "Hello my name is"
381
+ + inputs = tokenizer(text, return_tensors="pt").to(0)
382
+
383
+ outputs = model.generate(**inputs, max_new_tokens=20)
384
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
385
+ ```
386
+ </details>
387
+
388
+ ### Lower precision using (8-bit & 4-bit) using `bitsandbytes`
389
+
390
+ <details>
391
+ <summary> Click to expand </summary>
392
+
393
+ ```diff
394
+ + import torch
395
+ from transformers import AutoModelForCausalLM, AutoTokenizer
396
+
397
+ model_id = "mistralai/Mixtral-8x7B-v0.1"
398
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
399
+
400
+ + model = AutoModelForCausalLM.from_pretrained(model_id, load_in_4bit=True)
401
+
402
+ text = "Hello my name is"
403
+ + inputs = tokenizer(text, return_tensors="pt").to(0)
404
+
405
+ outputs = model.generate(**inputs, max_new_tokens=20)
406
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
407
+ ```
408
+ </details>
409
+
410
+ ### Load the model with Flash Attention 2
411
+
412
+ <details>
413
+ <summary> Click to expand </summary>
414
+
415
+ ```diff
416
+ + import torch
417
+ from transformers import AutoModelForCausalLM, AutoTokenizer
418
+
419
+ model_id = "mistralai/Mixtral-8x7B-v0.1"
420
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
421
+
422
+ + model = AutoModelForCausalLM.from_pretrained(model_id, use_flash_attention_2=True)
423
+
424
+ text = "Hello my name is"
425
+ + inputs = tokenizer(text, return_tensors="pt").to(0)
426
+
427
+ outputs = model.generate(**inputs, max_new_tokens=20)
428
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
429
+ ```
430
+ </details>
431
+
432
+ ## Notice
433
+ Mixtral-8x7B is a pretrained base model and therefore does not have any moderation mechanisms.
434
+
435
+ # The Mistral AI Team
436
+ Albert Jiang, Alexandre Sablayrolles, Arthur Mensch, Blanche Savary, Chris Bamford, Devendra Singh Chaplot, Diego de las Casas, Emma Bou Hanna, Florian Bressand, Gianna Lengyel, Guillaume Bour, Guillaume Lample, Lélio Renard Lavaud, Louis Ternon, Lucile Saulnier, Marie-Anne Lachaux, Pierre Stock, Teven Le Scao, Théophile Gervet, Thibaut Lavril, Thomas Wang, Timothée Lacroix, William El Sayed.
config.json ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/workspace/process/mistralai_mixtral-8x7b-v0.1/source",
3
+ "architectures": [
4
+ "MixtralForCausalLM"
5
+ ],
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 1,
8
+ "eos_token_id": 2,
9
+ "hidden_act": "silu",
10
+ "hidden_size": 4096,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 14336,
13
+ "max_position_embeddings": 32768,
14
+ "model_type": "mixtral",
15
+ "num_attention_heads": 32,
16
+ "num_experts_per_tok": 2,
17
+ "num_hidden_layers": 32,
18
+ "num_key_value_heads": 8,
19
+ "num_local_experts": 8,
20
+ "output_router_logits": false,
21
+ "pad_token_id": 0,
22
+ "pretraining_tp": 1,
23
+ "rms_norm_eps": 1e-05,
24
+ "rope_theta": 1000000.0,
25
+ "router_aux_loss_coef": 0.02,
26
+ "sliding_window": 4096,
27
+ "tie_word_embeddings": false,
28
+ "torch_dtype": "bfloat16",
29
+ "transformers_version": "4.36.0",
30
+ "use_cache": true,
31
+ "vocab_size": 32000,
32
+ "quantization_config": {
33
+ "bits": 4,
34
+ "modules_in_block_to_quantize" : [
35
+ ["self_attn.k_proj", "self_attn.v_proj", "self_attn.q_proj"],
36
+ ["self_attn.o_proj"],
37
+ ["block_sparse_moe.experts.0.w1", "block_sparse_moe.experts.0.w2", "block_sparse_moe.experts.0.w3"],
38
+ ["block_sparse_moe.experts.1.w1", "block_sparse_moe.experts.1.w2", "block_sparse_moe.experts.1.w3"],
39
+ ["block_sparse_moe.experts.2.w1", "block_sparse_moe.experts.2.w2", "block_sparse_moe.experts.2.w3"],
40
+ ["block_sparse_moe.experts.3.w1", "block_sparse_moe.experts.3.w2", "block_sparse_moe.experts.3.w3"],
41
+ ["block_sparse_moe.experts.4.w1", "block_sparse_moe.experts.4.w2", "block_sparse_moe.experts.4.w3"],
42
+ ["block_sparse_moe.experts.5.w1", "block_sparse_moe.experts.5.w2", "block_sparse_moe.experts.5.w3"],
43
+ ["block_sparse_moe.experts.6.w1", "block_sparse_moe.experts.6.w2", "block_sparse_moe.experts.6.w3"],
44
+ ["block_sparse_moe.experts.7.w1", "block_sparse_moe.experts.7.w2", "block_sparse_moe.experts.7.w3"]],
45
+ "group_size": -1,
46
+ "damp_percent": 0.1,
47
+ "desc_act": true,
48
+ "sym": true,
49
+ "true_sequential": true,
50
+ "model_name_or_path": null,
51
+ "model_file_base_name": "model",
52
+ "quant_method": "gptq"
53
+ }
54
+ }
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.36.0.dev0"
6
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:06350f6e939a9ab5abef54a8eae0cbf5d7d04236f2e60f8f53c6c6589ec231a4
3
+ size 23811549344
quantize_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bits": 4,
3
+ "group_size": -1,
4
+ "damp_percent": 0.1,
5
+ "desc_act": true,
6
+ "sym": true,
7
+ "true_sequential": true,
8
+ "model_name_or_path": null,
9
+ "model_file_base_name": "model"
10
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "eos_token": "</s>",
4
+ "unk_token": "<unk>"
5
+ }
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": false
42
+ }