TheBloke commited on
Commit
38762de
1 Parent(s): 4d37e71

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +98 -12
README.md CHANGED
@@ -44,23 +44,30 @@ quantized_by: TheBloke
44
 
45
  This repo contains GGUF format model files for [Mistral AI_'s Mixtral 8X7B v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-v0.1).
46
 
47
- **MIXTRAL GGUF SUPPORT**
 
 
 
 
 
 
 
 
 
 
48
 
49
- Known to work in:
50
  * llama.cpp as of December 13th
51
  * KoboldCpp 1.52 as later
52
  * LM Studio 0.2.9 and later
53
-
54
- Support for Mixtral was merged into Llama.cpp on December 13th.
55
 
56
  Other clients/libraries, not listed above, may not yet work.
57
 
58
- <!-- description end -->
59
-
60
  <!-- repositories-available start -->
61
  ## Repositories available
62
 
63
- * AWQ coming soon
64
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ)
65
  * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Mixtral-8x7B-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-v0.1)
@@ -71,12 +78,16 @@ Other clients/libraries, not listed above, may not yet work.
71
 
72
  ```
73
  {prompt}
 
74
  ```
75
 
76
  <!-- prompt-template end -->
77
 
78
 
79
  <!-- compatibility_gguf start -->
 
 
 
80
 
81
  ## Explanation of quantisation methods
82
 
@@ -104,7 +115,6 @@ Refer to the Provided Files table below to see what files use which methods, and
104
  | [mixtral-8x7b-v0.1.Q3_K_M.gguf](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GGUF/blob/main/mixtral-8x7b-v0.1.Q3_K_M.gguf) | Q3_K_M | 3 | 20.36 GB| 22.86 GB | very small, high quality loss |
105
  | [mixtral-8x7b-v0.1.Q4_0.gguf](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GGUF/blob/main/mixtral-8x7b-v0.1.Q4_0.gguf) | Q4_0 | 4 | 26.44 GB| 28.94 GB | legacy; small, very high quality loss - prefer using Q3_K_M |
106
  | [mixtral-8x7b-v0.1.Q4_K_M.gguf](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GGUF/blob/main/mixtral-8x7b-v0.1.Q4_K_M.gguf) | Q4_K_M | 4 | 26.44 GB| 28.94 GB | medium, balanced quality - recommended |
107
- | [mixtral-8x7b-v0.1.Q5_K.gguf](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GGUF/blob/main/mixtral-8x7b-v0.1.Q5_K.gguf) | Q5_K | 5 | 32.23 GB| 34.73 GB | alias for Q5_K_M |
108
  | [mixtral-8x7b-v0.1.Q5_0.gguf](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GGUF/blob/main/mixtral-8x7b-v0.1.Q5_0.gguf) | Q5_0 | 5 | 32.23 GB| 34.73 GB | legacy; medium, balanced quality - prefer using Q4_K_M |
109
  | [mixtral-8x7b-v0.1.Q5_K_M.gguf](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GGUF/blob/main/mixtral-8x7b-v0.1.Q5_K_M.gguf) | Q5_K_M | 5 | 32.23 GB| 34.73 GB | large, very low quality loss - recommended |
110
  | [mixtral-8x7b-v0.1.Q6_K.gguf](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GGUF/blob/main/mixtral-8x7b-v0.1.Q6_K.gguf) | Q6_K | 6 | 38.38 GB| 40.88 GB | very large, extremely low quality loss |
@@ -127,6 +137,11 @@ The following clients/libraries will automatically download models for you, prov
127
  * LoLLMS Web UI
128
  * Faraday.dev
129
 
 
 
 
 
 
130
 
131
  ### On the command line, including multiple files at once
132
 
@@ -175,12 +190,12 @@ Windows Command Line users: You can set the environment variable by running `set
175
  Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
176
 
177
  ```shell
178
- ./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}"
179
  ```
180
 
181
  Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
182
 
183
- Change `-c 32768` 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.
184
 
185
  If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
186
 
@@ -188,12 +203,83 @@ For other parameters and how to use them, please refer to [the llama.cpp documen
188
 
189
  ## How to run in `text-generation-webui`
190
 
191
- Not supported yet
 
 
192
 
193
  ## How to run from Python code
194
 
195
- Not supported yet
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
 
 
197
 
198
  <!-- footer start -->
199
  <!-- 200823 -->
 
44
 
45
  This repo contains GGUF format model files for [Mistral AI_'s Mixtral 8X7B v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-v0.1).
46
 
47
+ <!-- description end -->
48
+ <!-- README_GGUF.md-about-gguf start -->
49
+ ### About GGUF
50
+
51
+ 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.
52
+
53
+ ### Mixtral GGUF
54
+
55
+ Support for Mixtral was merged into Llama.cpp on December 13th.
56
+
57
+ These Mixtral GGUFs are known to work in:
58
 
 
59
  * llama.cpp as of December 13th
60
  * KoboldCpp 1.52 as later
61
  * LM Studio 0.2.9 and later
62
+ * llama-cpp-python 0.2.23 and later
 
63
 
64
  Other clients/libraries, not listed above, may not yet work.
65
 
66
+ <!-- README_GGUF.md-about-gguf end -->
 
67
  <!-- repositories-available start -->
68
  ## Repositories available
69
 
70
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/mixtral-8x7b-v0.1-AWQ)
71
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GPTQ)
72
  * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GGUF)
73
  * [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)
 
78
 
79
  ```
80
  {prompt}
81
+
82
  ```
83
 
84
  <!-- prompt-template end -->
85
 
86
 
87
  <!-- compatibility_gguf start -->
88
+ ## Compatibility
89
+
90
+ These Mixtral GGUFs are compatible with llama.cpp from December 13th onwards. Other clients/libraries may not work yet.
91
 
92
  ## Explanation of quantisation methods
93
 
 
115
  | [mixtral-8x7b-v0.1.Q3_K_M.gguf](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GGUF/blob/main/mixtral-8x7b-v0.1.Q3_K_M.gguf) | Q3_K_M | 3 | 20.36 GB| 22.86 GB | very small, high quality loss |
116
  | [mixtral-8x7b-v0.1.Q4_0.gguf](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GGUF/blob/main/mixtral-8x7b-v0.1.Q4_0.gguf) | Q4_0 | 4 | 26.44 GB| 28.94 GB | legacy; small, very high quality loss - prefer using Q3_K_M |
117
  | [mixtral-8x7b-v0.1.Q4_K_M.gguf](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GGUF/blob/main/mixtral-8x7b-v0.1.Q4_K_M.gguf) | Q4_K_M | 4 | 26.44 GB| 28.94 GB | medium, balanced quality - recommended |
 
118
  | [mixtral-8x7b-v0.1.Q5_0.gguf](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GGUF/blob/main/mixtral-8x7b-v0.1.Q5_0.gguf) | Q5_0 | 5 | 32.23 GB| 34.73 GB | legacy; medium, balanced quality - prefer using Q4_K_M |
119
  | [mixtral-8x7b-v0.1.Q5_K_M.gguf](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GGUF/blob/main/mixtral-8x7b-v0.1.Q5_K_M.gguf) | Q5_K_M | 5 | 32.23 GB| 34.73 GB | large, very low quality loss - recommended |
120
  | [mixtral-8x7b-v0.1.Q6_K.gguf](https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GGUF/blob/main/mixtral-8x7b-v0.1.Q6_K.gguf) | Q6_K | 6 | 38.38 GB| 40.88 GB | very large, extremely low quality loss |
 
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-v0.1-GGUF and below it, a specific filename to download, such as: mixtral-8x7b-v0.1.Q4_K_M.gguf.
143
+
144
+ Then click Download.
145
 
146
  ### On the command line, including multiple files at once
147
 
 
190
  Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
191
 
192
  ```shell
193
+ ./main -ngl 35 -m mixtral-8x7b-v0.1.Q4_K_M.gguf --color -c 2048 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "{prompt}"
194
  ```
195
 
196
  Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
197
 
198
+ Change `-c 2048` 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.
199
 
200
  If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
201
 
 
203
 
204
  ## How to run in `text-generation-webui`
205
 
206
+ Note that text-generation-webui may not yet be compatible with Mixtral GGUFs. Please check compatibility first.
207
+
208
+ 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).
209
 
210
  ## How to run from Python code
211
 
212
+ You can use GGUF models from Python using the [llama-cpp-python](https://github.com/abetlen/llama-cpp-python) version 0.2.23 and later.
213
+
214
+ ### How to load this model in Python code, using llama-cpp-python
215
+
216
+ For full documentation, please see: [llama-cpp-python docs](https://abetlen.github.io/llama-cpp-python/).
217
+
218
+ #### First install the package
219
+
220
+ Run one of the following commands, according to your system:
221
+
222
+ ```shell
223
+ # Base ctransformers with no GPU acceleration
224
+ pip install llama-cpp-python
225
+ # With NVidia CUDA acceleration
226
+ CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
227
+ # Or with OpenBLAS acceleration
228
+ CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
229
+ # Or with CLBLast acceleration
230
+ CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
231
+ # Or with AMD ROCm GPU acceleration (Linux only)
232
+ CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
233
+ # Or with Metal GPU acceleration for macOS systems only
234
+ CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
235
+
236
+ # In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
237
+ $env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
238
+ pip install llama-cpp-python
239
+ ```
240
+
241
+ #### Simple llama-cpp-python example code
242
+
243
+ ```python
244
+ from llama_cpp import Llama
245
+
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="./mixtral-8x7b-v0.1.Q4_K_M.gguf", # Download the model file first
249
+ n_ctx=2048, # 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
+
254
+ # Simple inference example
255
+ output = llm(
256
+ "{prompt}", # Prompt
257
+ max_tokens=512, # Generate up to 512 tokens
258
+ stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
259
+ echo=True # Whether to echo the prompt
260
+ )
261
+
262
+ # Chat Completion API
263
+
264
+ llm = Llama(model_path="./mixtral-8x7b-v0.1.Q4_K_M.gguf", chat_format="llama-2") # Set chat_format according to the model you are using
265
+ llm.create_chat_completion(
266
+ messages = [
267
+ {"role": "system", "content": "You are a story writing assistant."},
268
+ {
269
+ "role": "user",
270
+ "content": "Write a story about llamas."
271
+ }
272
+ ]
273
+ )
274
+ ```
275
+
276
+ ## How to use with LangChain
277
+
278
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
279
+
280
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
281
 
282
+ <!-- README_GGUF.md-how-to-run end -->
283
 
284
  <!-- footer start -->
285
  <!-- 200823 -->