Update README.md
Browse files
README.md
CHANGED
@@ -42,31 +42,26 @@ quantized_by: TheBloke
|
|
42 |
<!-- description start -->
|
43 |
## Description
|
44 |
|
45 |
-
This repo contains GGUF format model files for [Mistral AI_'s Mixtral 8X7B Instruct v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1).
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
50 |
|
51 |
-
|
52 |
|
53 |
-
|
54 |
|
55 |
-
* [llama.cpp](https://github.com/ggerganov/llama.cpp). The source project for GGUF. Offers a CLI and a server option.
|
56 |
-
* [text-generation-webui](https://github.com/oobabooga/text-generation-webui), the most widely used web UI, with many features and powerful extensions. Supports GPU acceleration.
|
57 |
-
* [KoboldCpp](https://github.com/LostRuins/koboldcpp), a fully featured web UI, with GPU accel across all platforms and GPU architectures. Especially good for story telling.
|
58 |
-
* [GPT4All](https://gpt4all.io/index.html), a free and open source local running GUI, supporting Windows, Linux and macOS with full GPU accel.
|
59 |
-
* [LM Studio](https://lmstudio.ai/), an easy-to-use and powerful local GUI for Windows and macOS (Silicon), with GPU acceleration. Linux available, in beta as of 27/11/2023.
|
60 |
-
* [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui), a great web UI with many interesting and unique features, including a full model library for easy model selection.
|
61 |
-
* [Faraday.dev](https://faraday.dev/), an attractive and easy to use character-based chat GUI for Windows and macOS (both Silicon and Intel), with GPU acceleration.
|
62 |
-
* [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), a Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
|
63 |
-
* [candle](https://github.com/huggingface/candle), a Rust ML framework with a focus on performance, including GPU support, and ease of use.
|
64 |
-
* [ctransformers](https://github.com/marella/ctransformers), a Python library with GPU accel, LangChain support, and OpenAI-compatible AI server. Note, as of time of writing (November 27th 2023), ctransformers has not been updated in a long time and does not support many recent models.
|
65 |
|
66 |
-
<!--
|
|
|
67 |
<!-- repositories-available start -->
|
68 |
## Repositories available
|
69 |
|
|
|
|
|
70 |
* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Mixtral-8x7B-Instruct-v0.1-GGUF)
|
71 |
* [Mistral AI_'s original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1)
|
72 |
<!-- repositories-available end -->
|
@@ -76,36 +71,10 @@ Here is an incomplete list of clients and libraries that are known to support GG
|
|
76 |
|
77 |
```
|
78 |
<s>[INST] {prompt} [/INST]
|
79 |
-
|
80 |
```
|
81 |
|
82 |
<!-- prompt-template end -->
|
83 |
|
84 |
-
|
85 |
-
<!-- compatibility_gguf start -->
|
86 |
-
## Compatibility
|
87 |
-
|
88 |
-
These quantised GGUFv2 files are compatible with llama.cpp from August 27th onwards, as of commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221)
|
89 |
-
|
90 |
-
They are also compatible with many third party UIs and libraries - please see the list at the top of this README.
|
91 |
-
|
92 |
-
## Explanation of quantisation methods
|
93 |
-
|
94 |
-
<details>
|
95 |
-
<summary>Click to see details</summary>
|
96 |
-
|
97 |
-
The new methods available are:
|
98 |
-
|
99 |
-
* GGML_TYPE_Q2_K - "type-1" 2-bit quantization in super-blocks containing 16 blocks, each block having 16 weight. Block scales and mins are quantized with 4 bits. This ends up effectively using 2.5625 bits per weight (bpw)
|
100 |
-
* GGML_TYPE_Q3_K - "type-0" 3-bit quantization in super-blocks containing 16 blocks, each block having 16 weights. Scales are quantized with 6 bits. This end up using 3.4375 bpw.
|
101 |
-
* GGML_TYPE_Q4_K - "type-1" 4-bit quantization in super-blocks containing 8 blocks, each block having 32 weights. Scales and mins are quantized with 6 bits. This ends up using 4.5 bpw.
|
102 |
-
* GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
|
103 |
-
* GGML_TYPE_Q6_K - "type-0" 6-bit quantization. Super-blocks with 16 blocks, each block having 16 weights. Scales are quantized with 8 bits. This ends up using 6.5625 bpw
|
104 |
-
|
105 |
-
Refer to the Provided Files table below to see what files use which methods, and how.
|
106 |
-
</details>
|
107 |
-
<!-- compatibility_gguf end -->
|
108 |
-
|
109 |
<!-- README_GGUF.md-provided-files start -->
|
110 |
## Provided files
|
111 |
|
@@ -131,18 +100,6 @@ Refer to the Provided Files table below to see what files use which methods, and
|
|
131 |
|
132 |
**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.
|
133 |
|
134 |
-
The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
|
135 |
-
|
136 |
-
* LM Studio
|
137 |
-
* LoLLMS Web UI
|
138 |
-
* Faraday.dev
|
139 |
-
|
140 |
-
### In `text-generation-webui`
|
141 |
-
|
142 |
-
Under Download Model, you can enter the model repo: TheBloke/Mixtral-8x7B-Instruct-v0.1-GGUF and below it, a specific filename to download, such as: mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf.
|
143 |
-
|
144 |
-
Then click Download.
|
145 |
-
|
146 |
### On the command line, including multiple files at once
|
147 |
|
148 |
I recommend using the `huggingface-hub` Python library:
|
@@ -154,7 +111,7 @@ pip3 install huggingface-hub
|
|
154 |
Then you can download any individual model file to the current directory, at high speed, with a command like this:
|
155 |
|
156 |
```shell
|
157 |
-
huggingface-cli download TheBloke/Mixtral-8x7B-
|
158 |
```
|
159 |
|
160 |
<details>
|
@@ -163,7 +120,7 @@ huggingface-cli download TheBloke/Mixtral-8x7B-Instruct-v0.1-GGUF mixtral-8x7b-i
|
|
163 |
You can also download multiple files at once with a pattern:
|
164 |
|
165 |
```shell
|
166 |
-
huggingface-cli download TheBloke/Mixtral-8x7B-
|
167 |
```
|
168 |
|
169 |
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).
|
@@ -177,7 +134,7 @@ pip3 install hf_transfer
|
|
177 |
And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
|
178 |
|
179 |
```shell
|
180 |
-
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/Mixtral-8x7B-
|
181 |
```
|
182 |
|
183 |
Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
|
@@ -187,10 +144,10 @@ Windows Command Line users: You can set the environment variable by running `set
|
|
187 |
<!-- README_GGUF.md-how-to-run start -->
|
188 |
## Example `llama.cpp` command
|
189 |
|
190 |
-
Make sure you are using `llama.cpp` from
|
191 |
|
192 |
```shell
|
193 |
-
./main -ngl 35 -m mixtral-8x7b-
|
194 |
```
|
195 |
|
196 |
Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
|
@@ -203,82 +160,11 @@ For other parameters and how to use them, please refer to [the llama.cpp documen
|
|
203 |
|
204 |
## How to run in `text-generation-webui`
|
205 |
|
206 |
-
|
207 |
|
208 |
## How to run from Python code
|
209 |
|
210 |
-
|
211 |
-
|
212 |
-
### How to load this model in Python code, using llama-cpp-python
|
213 |
-
|
214 |
-
For full documentation, please see: [llama-cpp-python docs](https://abetlen.github.io/llama-cpp-python/).
|
215 |
-
|
216 |
-
#### First install the package
|
217 |
-
|
218 |
-
Run one of the following commands, according to your system:
|
219 |
-
|
220 |
-
```shell
|
221 |
-
# Base ctransformers with no GPU acceleration
|
222 |
-
pip install llama-cpp-python
|
223 |
-
# With NVidia CUDA acceleration
|
224 |
-
CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
|
225 |
-
# Or with OpenBLAS acceleration
|
226 |
-
CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
|
227 |
-
# Or with CLBLast acceleration
|
228 |
-
CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
|
229 |
-
# Or with AMD ROCm GPU acceleration (Linux only)
|
230 |
-
CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
|
231 |
-
# Or with Metal GPU acceleration for macOS systems only
|
232 |
-
CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
|
233 |
-
|
234 |
-
# In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
|
235 |
-
$env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
|
236 |
-
pip install llama-cpp-python
|
237 |
-
```
|
238 |
-
|
239 |
-
#### Simple llama-cpp-python example code
|
240 |
-
|
241 |
-
```python
|
242 |
-
from llama_cpp import Llama
|
243 |
-
|
244 |
-
# Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
|
245 |
-
llm = Llama(
|
246 |
-
model_path="./mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf", # Download the model file first
|
247 |
-
n_ctx=32768, # The max sequence length to use - note that longer sequence lengths require much more resources
|
248 |
-
n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
|
249 |
-
n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
|
250 |
-
)
|
251 |
-
|
252 |
-
# Simple inference example
|
253 |
-
output = llm(
|
254 |
-
"<s>[INST] {prompt} [/INST]", # Prompt
|
255 |
-
max_tokens=512, # Generate up to 512 tokens
|
256 |
-
stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
|
257 |
-
echo=True # Whether to echo the prompt
|
258 |
-
)
|
259 |
-
|
260 |
-
# Chat Completion API
|
261 |
-
|
262 |
-
llm = Llama(model_path="./mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf", chat_format="llama-2") # Set chat_format according to the model you are using
|
263 |
-
llm.create_chat_completion(
|
264 |
-
messages = [
|
265 |
-
{"role": "system", "content": "You are a story writing assistant."},
|
266 |
-
{
|
267 |
-
"role": "user",
|
268 |
-
"content": "Write a story about llamas."
|
269 |
-
}
|
270 |
-
]
|
271 |
-
)
|
272 |
-
```
|
273 |
-
|
274 |
-
## How to use with LangChain
|
275 |
-
|
276 |
-
Here are guides on using llama-cpp-python and ctransformers with LangChain:
|
277 |
-
|
278 |
-
* [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
|
279 |
-
* [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
|
280 |
-
|
281 |
-
<!-- README_GGUF.md-how-to-run end -->
|
282 |
|
283 |
<!-- footer start -->
|
284 |
<!-- 200823 -->
|
|
|
42 |
<!-- description start -->
|
43 |
## Description
|
44 |
|
45 |
+
This repo contains **EXPERIMENTAL** GGUF format model files for [Mistral AI_'s Mixtral 8X7B Instruct v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1).
|
46 |
|
47 |
+
## EXPERIMENTAL - REQUIRES LLAMA.CPP PR
|
48 |
+
|
49 |
+
These are experimental GGUF files, created using a llama.cpp PR found here: https://github.com/ggerganov/llama.cpp/pull/4406.
|
50 |
+
|
51 |
+
THEY WILL NOT WORK WITH LLAMA.CPP FROM `main`, OR ANY DOWNSTREAM LLAMA.CPP CLIENT - such as LM Studio, llama-cpp-python, text-generation-webui, etc.
|
52 |
|
53 |
+
To test these GGUFs, please build llama.cpp from the above PR.
|
54 |
|
55 |
+
I have tested CUDA acceleration and it works great. I have not yet tested other forms of GPU acceleration.
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
+
<!-- description end -->
|
59 |
+
|
60 |
<!-- repositories-available start -->
|
61 |
## Repositories available
|
62 |
|
63 |
+
* AWQ: coming soon
|
64 |
+
* GPTQ: coming soon
|
65 |
* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Mixtral-8x7B-Instruct-v0.1-GGUF)
|
66 |
* [Mistral AI_'s original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1)
|
67 |
<!-- repositories-available end -->
|
|
|
71 |
|
72 |
```
|
73 |
<s>[INST] {prompt} [/INST]
|
|
|
74 |
```
|
75 |
|
76 |
<!-- prompt-template end -->
|
77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
<!-- README_GGUF.md-provided-files start -->
|
79 |
## Provided files
|
80 |
|
|
|
100 |
|
101 |
**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.
|
102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
### On the command line, including multiple files at once
|
104 |
|
105 |
I recommend using the `huggingface-hub` Python library:
|
|
|
111 |
Then you can download any individual model file to the current directory, at high speed, with a command like this:
|
112 |
|
113 |
```shell
|
114 |
+
huggingface-cli download TheBloke/Mixtral-8x7B-v0.1-GGUF mixtral-8x7b-v0.1.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
|
115 |
```
|
116 |
|
117 |
<details>
|
|
|
120 |
You can also download multiple files at once with a pattern:
|
121 |
|
122 |
```shell
|
123 |
+
huggingface-cli download TheBloke/Mixtral-8x7B-v0.1-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
|
124 |
```
|
125 |
|
126 |
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).
|
|
|
134 |
And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
|
135 |
|
136 |
```shell
|
137 |
+
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/Mixtral-8x7B-v0.1-GGUF mixtral-8x7b-v0.1.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
|
138 |
```
|
139 |
|
140 |
Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
|
|
|
144 |
<!-- README_GGUF.md-how-to-run start -->
|
145 |
## Example `llama.cpp` command
|
146 |
|
147 |
+
Make sure you are using `llama.cpp` from [PR 4406](https://github.com/ggerganov/llama.cpp/pull/4406)
|
148 |
|
149 |
```shell
|
150 |
+
./main -ngl 35 -m mixtral-8x7b-v0.1.Q4_K_M.gguf --color -c 32768 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "{prompt}"
|
151 |
```
|
152 |
|
153 |
Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
|
|
|
160 |
|
161 |
## How to run in `text-generation-webui`
|
162 |
|
163 |
+
Not currently supported.
|
164 |
|
165 |
## How to run from Python code
|
166 |
|
167 |
+
Not currently supported.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
|
169 |
<!-- footer start -->
|
170 |
<!-- 200823 -->
|