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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- fr
|
4 |
+
- it
|
5 |
+
- de
|
6 |
+
- es
|
7 |
+
- en
|
8 |
+
license: apache-2.0
|
9 |
+
tags:
|
10 |
+
- moe
|
11 |
+
- GGUF
|
12 |
+
model-index:
|
13 |
+
- name: Mixtral-8x22B-v0.1
|
14 |
+
results:
|
15 |
+
- task:
|
16 |
+
type: text-generation
|
17 |
+
name: Text Generation
|
18 |
+
dataset:
|
19 |
+
name: AI2 Reasoning Challenge (25-Shot)
|
20 |
+
type: ai2_arc
|
21 |
+
config: ARC-Challenge
|
22 |
+
split: test
|
23 |
+
args:
|
24 |
+
num_few_shot: 25
|
25 |
+
metrics:
|
26 |
+
- type: acc_norm
|
27 |
+
value: 70.48
|
28 |
+
name: normalized accuracy
|
29 |
+
source:
|
30 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=mistral-community/Mixtral-8x22B-v0.1
|
31 |
+
name: Open LLM Leaderboard
|
32 |
+
- task:
|
33 |
+
type: text-generation
|
34 |
+
name: Text Generation
|
35 |
+
dataset:
|
36 |
+
name: HellaSwag (10-Shot)
|
37 |
+
type: hellaswag
|
38 |
+
split: validation
|
39 |
+
args:
|
40 |
+
num_few_shot: 10
|
41 |
+
metrics:
|
42 |
+
- type: acc_norm
|
43 |
+
value: 88.73
|
44 |
+
name: normalized accuracy
|
45 |
+
source:
|
46 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=mistral-community/Mixtral-8x22B-v0.1
|
47 |
+
name: Open LLM Leaderboard
|
48 |
+
- task:
|
49 |
+
type: text-generation
|
50 |
+
name: Text Generation
|
51 |
+
dataset:
|
52 |
+
name: MMLU (5-Shot)
|
53 |
+
type: cais/mmlu
|
54 |
+
config: all
|
55 |
+
split: test
|
56 |
+
args:
|
57 |
+
num_few_shot: 5
|
58 |
+
metrics:
|
59 |
+
- type: acc
|
60 |
+
value: 77.81
|
61 |
+
name: accuracy
|
62 |
+
source:
|
63 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=mistral-community/Mixtral-8x22B-v0.1
|
64 |
+
name: Open LLM Leaderboard
|
65 |
+
- task:
|
66 |
+
type: text-generation
|
67 |
+
name: Text Generation
|
68 |
+
dataset:
|
69 |
+
name: TruthfulQA (0-shot)
|
70 |
+
type: truthful_qa
|
71 |
+
config: multiple_choice
|
72 |
+
split: validation
|
73 |
+
args:
|
74 |
+
num_few_shot: 0
|
75 |
+
metrics:
|
76 |
+
- type: mc2
|
77 |
+
value: 51.08
|
78 |
+
source:
|
79 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=mistral-community/Mixtral-8x22B-v0.1
|
80 |
+
name: Open LLM Leaderboard
|
81 |
+
- task:
|
82 |
+
type: text-generation
|
83 |
+
name: Text Generation
|
84 |
+
dataset:
|
85 |
+
name: Winogrande (5-shot)
|
86 |
+
type: winogrande
|
87 |
+
config: winogrande_xl
|
88 |
+
split: validation
|
89 |
+
args:
|
90 |
+
num_few_shot: 5
|
91 |
+
metrics:
|
92 |
+
- type: acc
|
93 |
+
value: 84.53
|
94 |
+
name: accuracy
|
95 |
+
source:
|
96 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=mistral-community/Mixtral-8x22B-v0.1
|
97 |
+
name: Open LLM Leaderboard
|
98 |
+
- task:
|
99 |
+
type: text-generation
|
100 |
+
name: Text Generation
|
101 |
+
dataset:
|
102 |
+
name: GSM8k (5-shot)
|
103 |
+
type: gsm8k
|
104 |
+
config: main
|
105 |
+
split: test
|
106 |
+
args:
|
107 |
+
num_few_shot: 5
|
108 |
+
metrics:
|
109 |
+
- type: acc
|
110 |
+
value: 74.15
|
111 |
+
name: accuracy
|
112 |
+
source:
|
113 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=mistral-community/Mixtral-8x22B-v0.1
|
114 |
+
name: Open LLM Leaderboard
|
115 |
+
quantized_by: andrijdavid
|
116 |
+
---
|
117 |
+
# Mixtral-8x22B-v0.1-GGUF
|
118 |
+
- Original model: [Mixtral-8x22B-v0.1](https://huggingface.co/mistral-community/Mixtral-8x22B-v0.1)
|
119 |
+
|
120 |
+
<!-- description start -->
|
121 |
+
## Description
|
122 |
+
|
123 |
+
This repo contains GGUF format model files for [Mixtral-8x22B-v0.1](https://huggingface.co/mistral-community/Mixtral-8x22B-v0.1).
|
124 |
+
|
125 |
+
<!-- description end -->
|
126 |
+
<!-- README_GGUF.md-about-gguf start -->
|
127 |
+
### About GGUF
|
128 |
+
GGUF is a new format introduced by the llama.cpp team on August 21st 2023. It is a replacement for GGML, which is no longer supported by llama.cpp.
|
129 |
+
Here is an incomplete list of clients and libraries that are known to support GGUF:
|
130 |
+
* [llama.cpp](https://github.com/ggerganov/llama.cpp). This is the source project for GGUF, providing both a Command Line Interface (CLI) and a server option.
|
131 |
+
* [text-generation-webui](https://github.com/oobabooga/text-generation-webui), Known as the most widely used web UI, this project boasts numerous features and powerful extensions, and supports GPU acceleration.
|
132 |
+
* [Ollama](https://github.com/jmorganca/ollama) Ollama is a lightweight and extensible framework designed for building and running language models locally. It features a simple API for creating, managing, and executing models, along with a library of pre-built models for use in various applications
|
133 |
+
* [KoboldCpp](https://github.com/LostRuins/koboldcpp), A comprehensive web UI offering GPU acceleration across all platforms and architectures, particularly renowned for storytelling.
|
134 |
+
* [GPT4All](https://gpt4all.io), This is a free and open source GUI that runs locally, supporting Windows, Linux, and macOS with full GPU acceleration.
|
135 |
+
* [LM Studio](https://lmstudio.ai/) An intuitive and powerful local GUI for Windows and macOS (Silicon), featuring GPU acceleration.
|
136 |
+
* [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui). A notable web UI with a variety of unique features, including a comprehensive model library for easy model selection.
|
137 |
+
* [Faraday.dev](https://faraday.dev/), An attractive, user-friendly character-based chat GUI for Windows and macOS (both Silicon and Intel), also offering GPU acceleration.
|
138 |
+
* [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), A Python library equipped with GPU acceleration, LangChain support, and an OpenAI-compatible API server.
|
139 |
+
* [candle](https://github.com/huggingface/candle), A Rust-based ML framework focusing on performance, including GPU support, and designed for ease of use.
|
140 |
+
* [ctransformers](https://github.com/marella/ctransformers), A Python library featuring GPU acceleration, LangChain support, and an OpenAI-compatible AI server.
|
141 |
+
* [localGPT](https://github.com/PromtEngineer/localGPT) An open-source initiative enabling private conversations with documents.
|
142 |
+
<!-- README_GGUF.md-about-gguf end -->
|
143 |
+
|
144 |
+
## How to download GGUF files
|
145 |
+
|
146 |
+
**Note for manual downloaders:** You almost never want to clone the entire repo! Multiple different quantisation formats are provided, and most users only want to pick and download a single file.
|
147 |
+
|
148 |
+
The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
|
149 |
+
|
150 |
+
* LM Studio
|
151 |
+
* LoLLMS Web UI
|
152 |
+
* Faraday.dev
|
153 |
+
|
154 |
+
### In `text-generation-webui`
|
155 |
+
|
156 |
+
Under Download Model, you can enter the model repo: andrijdavid/Mixtral-8x22B-v0.1-GGUF and below it, a specific filename to download, such as: Q2_K/Mixtral-8x22B-v0.1-Q2_K-00001-of-00009.gguf.
|
157 |
+
|
158 |
+
Then click Download.
|
159 |
+
|
160 |
+
### On the command line, including multiple files at once
|
161 |
+
|
162 |
+
I recommend using the `huggingface-hub` Python library:
|
163 |
+
|
164 |
+
```shell
|
165 |
+
pip3 install huggingface-hub
|
166 |
+
```
|
167 |
+
|
168 |
+
Then you can download any individual model file to the current directory, at high speed, with a command like this:
|
169 |
+
|
170 |
+
```shell
|
171 |
+
huggingface-cli download andrijdavid/Mixtral-8x22B-v0.1-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
|
172 |
+
```
|
173 |
+
|
174 |
+
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).
|
175 |
+
|
176 |
+
To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
|
177 |
+
|
178 |
+
```shell
|
179 |
+
pip3 install hf_transfer
|
180 |
+
```
|
181 |
+
|
182 |
+
And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
|
183 |
+
|
184 |
+
```shell
|
185 |
+
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download andrijdavid/Mixtral-8x22B-v0.1-GGUF Q2_K/Mixtral-8x22B-v0.1-Q2_K-00001-of-00009.gguf --local-dir . --local-dir-use-symlinks False
|
186 |
+
```
|
187 |
+
|
188 |
+
Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
|
189 |
+
|
190 |
+
<!-- README_GGUF.md-how-to-download end -->
|
191 |
+
<!-- README_GGUF.md-how-to-run start -->
|
192 |
+
## Example `llama.cpp` command
|
193 |
+
|
194 |
+
Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
|
195 |
+
|
196 |
+
```shell
|
197 |
+
./main -ngl 35 -m Q2_K/Mixtral-8x22B-v0.1-Q2_K-00001-of-00009.gguf --color --temp 0.7 --repeat_penalty 1.1 -n -1 -p "<PROMPT>"
|
198 |
+
```
|
199 |
+
|
200 |
+
Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
|
201 |
+
|
202 |
+
Change `-c {{context_size}}` to the desired sequence length. For extended sequence models - eg 8K, 16K, 32K - the necessary RoPE scaling parameters are read from the GGUF file and set by llama.cpp automatically. Note that longer sequence lengths require much more resources, so you may need to reduce this value.
|
203 |
+
|
204 |
+
If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
|
205 |
+
|
206 |
+
For other parameters and how to use them, please refer to [the llama.cpp documentation](https://github.com/ggerganov/llama.cpp/blob/master/examples/main/README.md)
|
207 |
+
|
208 |
+
## How to run in `text-generation-webui`
|
209 |
+
|
210 |
+
Further instructions can be found in the text-generation-webui documentation, here: [text-generation-webui/docs/04 ‐ Model Tab.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/04%20%E2%80%90%20Model%20Tab.md#llamacpp).
|
211 |
+
|
212 |
+
## How to run from Python code
|
213 |
+
|
214 |
+
You can use GGUF models from Python using the [llama-cpp-python](https://github.com/abetlen/llama-cpp-python) or [ctransformers](https://github.com/marella/ctransformers) libraries. Note that at the time of writing (Nov 27th 2023), ctransformers has not been updated for some time and is not compatible with some recent models. Therefore I recommend you use llama-cpp-python.
|
215 |
+
|
216 |
+
### How to load this model in Python code, using llama-cpp-python
|
217 |
+
|
218 |
+
For full documentation, please see: [llama-cpp-python docs](https://abetlen.github.io/llama-cpp-python/).
|
219 |
+
|
220 |
+
#### First install the package
|
221 |
+
|
222 |
+
Run one of the following commands, according to your system:
|
223 |
+
|
224 |
+
```shell
|
225 |
+
# Base ctransformers with no GPU acceleration
|
226 |
+
pip install llama-cpp-python
|
227 |
+
# With NVidia CUDA acceleration
|
228 |
+
CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
|
229 |
+
# Or with OpenBLAS acceleration
|
230 |
+
CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
|
231 |
+
# Or with CLBLast acceleration
|
232 |
+
CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
|
233 |
+
# Or with AMD ROCm GPU acceleration (Linux only)
|
234 |
+
CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
|
235 |
+
# Or with Metal GPU acceleration for macOS systems only
|
236 |
+
CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
|
237 |
+
# In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
|
238 |
+
$env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
|
239 |
+
pip install llama-cpp-python
|
240 |
+
```
|
241 |
+
|
242 |
+
#### Simple llama-cpp-python example code
|
243 |
+
|
244 |
+
```python
|
245 |
+
from llama_cpp import Llama
|
246 |
+
# Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
|
247 |
+
llm = Llama(
|
248 |
+
model_path="./Q2_K/Mixtral-8x22B-v0.1-Q2_K-00001-of-00009.gguf", # Download the model file first
|
249 |
+
n_ctx=32768, # The max sequence length to use - note that longer sequence lengths require much more resources
|
250 |
+
n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
|
251 |
+
n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
|
252 |
+
)
|
253 |
+
# Simple inference example
|
254 |
+
output = llm(
|
255 |
+
"<PROMPT>", # Prompt
|
256 |
+
max_tokens=512, # Generate up to 512 tokens
|
257 |
+
stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
|
258 |
+
echo=True # Whether to echo the prompt
|
259 |
+
)
|
260 |
+
# Chat Completion API
|
261 |
+
llm = Llama(model_path="./Q2_K/Mixtral-8x22B-v0.1-Q2_K-00001-of-00009.gguf", chat_format="llama-2") # Set chat_format according to the model you are using
|
262 |
+
llm.create_chat_completion(
|
263 |
+
messages = [
|
264 |
+
{"role": "system", "content": "You are a story writing assistant."},
|
265 |
+
{
|
266 |
+
"role": "user",
|
267 |
+
"content": "Write a story about llamas."
|
268 |
+
}
|
269 |
+
]
|
270 |
+
)
|
271 |
+
```
|
272 |
+
|
273 |
+
## How to use with LangChain
|
274 |
+
|
275 |
+
Here are guides on using llama-cpp-python and ctransformers with LangChain:
|
276 |
+
|
277 |
+
* [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
|
278 |
+
* [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
|
279 |
+
|
280 |
+
<!-- README_GGUF.md-how-to-run end -->
|
281 |
+
|
282 |
+
<!-- footer end -->
|