TheBloke commited on
Commit
fa1d383
1 Parent(s): 89336ec

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +129 -14
README.md CHANGED
@@ -11,8 +11,34 @@ license: apache-2.0
11
  model_creator: Mistral AI_
12
  model_name: Mixtral 8X7B Instruct v0.1
13
  model_type: mixtral
14
- prompt_template: '[INST] {prompt} [/INST]'
 
 
15
  quantized_by: TheBloke
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  ---
17
  <!-- markdownlint-disable MD041 -->
18
 
@@ -42,24 +68,30 @@ quantized_by: TheBloke
42
 
43
  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).
44
 
45
- **MIXTRAL GGUF SUPPORT**
 
 
 
 
 
 
 
 
 
 
46
 
47
- Known to work in:
48
  * llama.cpp as of December 13th
49
  * KoboldCpp 1.52 as later
50
  * LM Studio 0.2.9 and later
51
-
52
- Support for Mixtral was merged into Llama.cpp on December 13th.
53
 
54
  Other clients/libraries, not listed above, may not yet work.
55
 
56
- <!-- description end -->
57
-
58
- <!-- description end -->
59
  <!-- repositories-available start -->
60
  ## Repositories available
61
 
62
- * AWQ coming soon
63
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Mixtral-8x7B-Instruct-v0.1-GPTQ)
64
  * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Mixtral-8x7B-Instruct-v0.1-GGUF)
65
  * [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)
@@ -70,6 +102,7 @@ Other clients/libraries, not listed above, may not yet work.
70
 
71
  ```
72
  [INST] {prompt} [/INST]
 
73
  ```
74
 
75
  <!-- prompt-template end -->
@@ -78,7 +111,7 @@ Other clients/libraries, not listed above, may not yet work.
78
  <!-- compatibility_gguf start -->
79
  ## Compatibility
80
 
81
- PR mentioned above only
82
 
83
  ## Explanation of quantisation methods
84
 
@@ -122,6 +155,17 @@ Refer to the Provided Files table below to see what files use which methods, and
122
 
123
  **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.
124
 
 
 
 
 
 
 
 
 
 
 
 
125
 
126
  ### On the command line, including multiple files at once
127
 
@@ -170,12 +214,12 @@ Windows Command Line users: You can set the environment variable by running `set
170
  Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
171
 
172
  ```shell
173
- ./main -ngl 35 -m mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf --color -c 32768 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "[INST] {prompt} [/INST]"
174
  ```
175
 
176
  Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
177
 
178
- 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.
179
 
180
  If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
181
 
@@ -183,12 +227,83 @@ For other parameters and how to use them, please refer to [the llama.cpp documen
183
 
184
  ## How to run in `text-generation-webui`
185
 
186
- Not currently supported
 
 
187
 
188
  ## How to run from Python code
189
 
190
- Not currently supported
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
 
 
192
 
193
  <!-- footer start -->
194
  <!-- 200823 -->
 
11
  model_creator: Mistral AI_
12
  model_name: Mixtral 8X7B Instruct v0.1
13
  model_type: mixtral
14
+ prompt_template: '[INST] {prompt} [/INST]
15
+
16
+ '
17
  quantized_by: TheBloke
18
+ widget:
19
+ - output:
20
+ text: 'Arr, shiver me timbers! Ye have a llama on yer lawn, ye say? Well, that
21
+ be a new one for me! Here''s what I''d suggest, arr:
22
+
23
+
24
+ 1. Firstly, ensure yer safety. Llamas may look gentle, but they can be protective
25
+ if they feel threatened.
26
+
27
+ 2. Try to make the area less appealing to the llama. Remove any food sources
28
+ or water that might be attracting it.
29
+
30
+ 3. Contact local animal control or a wildlife rescue organization. They be the
31
+ experts and can provide humane ways to remove the llama from yer property.
32
+
33
+ 4. If ye have any experience with animals, you could try to gently herd the
34
+ llama towards a nearby field or open space. But be careful, arr!
35
+
36
+
37
+ Remember, arr, it be important to treat the llama with respect and care. It
38
+ be a creature just trying to survive, like the rest of us.'
39
+ text: '[INST] You are a pirate chatbot who always responds with Arr and pirate speak!
40
+
41
+ There''s a llama on my lawn, how can I get rid of him? [/INST]'
42
  ---
43
  <!-- markdownlint-disable MD041 -->
44
 
 
68
 
69
  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).
70
 
71
+ <!-- description end -->
72
+ <!-- README_GGUF.md-about-gguf start -->
73
+ ### About GGUF
74
+
75
+ 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.
76
+
77
+ ### Mixtral GGUF
78
+
79
+ Support for Mixtral was merged into Llama.cpp on December 13th.
80
+
81
+ These Mixtral GGUFs are known to work in:
82
 
 
83
  * llama.cpp as of December 13th
84
  * KoboldCpp 1.52 as later
85
  * LM Studio 0.2.9 and later
86
+ * llama-cpp-python 0.2.23 and later
 
87
 
88
  Other clients/libraries, not listed above, may not yet work.
89
 
90
+ <!-- README_GGUF.md-about-gguf end -->
 
 
91
  <!-- repositories-available start -->
92
  ## Repositories available
93
 
94
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Mixtral-8x7B-Instruct-v0.1-AWQ)
95
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Mixtral-8x7B-Instruct-v0.1-GPTQ)
96
  * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Mixtral-8x7B-Instruct-v0.1-GGUF)
97
  * [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)
 
102
 
103
  ```
104
  [INST] {prompt} [/INST]
105
+
106
  ```
107
 
108
  <!-- prompt-template end -->
 
111
  <!-- compatibility_gguf start -->
112
  ## Compatibility
113
 
114
+ These Mixtral GGUFs are compatible with llama.cpp from December 13th onwards. Other clients/libraries may not work yet.
115
 
116
  ## Explanation of quantisation methods
117
 
 
155
 
156
  **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.
157
 
158
+ The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
159
+
160
+ * LM Studio
161
+ * LoLLMS Web UI
162
+ * Faraday.dev
163
+
164
+ ### In `text-generation-webui`
165
+
166
+ 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.
167
+
168
+ Then click Download.
169
 
170
  ### On the command line, including multiple files at once
171
 
 
214
  Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
215
 
216
  ```shell
217
+ ./main -ngl 35 -m mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf --color -c 2048 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "[INST] {prompt} [/INST]"
218
  ```
219
 
220
  Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
221
 
222
+ 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.
223
 
224
  If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
225
 
 
227
 
228
  ## How to run in `text-generation-webui`
229
 
230
+ Note that text-generation-webui may not yet be compatible with Mixtral GGUFs. Please check compatibility first.
231
+
232
+ 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).
233
 
234
  ## How to run from Python code
235
 
236
+ 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.
237
+
238
+ ### How to load this model in Python code, using llama-cpp-python
239
+
240
+ For full documentation, please see: [llama-cpp-python docs](https://abetlen.github.io/llama-cpp-python/).
241
+
242
+ #### First install the package
243
+
244
+ Run one of the following commands, according to your system:
245
+
246
+ ```shell
247
+ # Base ctransformers with no GPU acceleration
248
+ pip install llama-cpp-python
249
+ # With NVidia CUDA acceleration
250
+ CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
251
+ # Or with OpenBLAS acceleration
252
+ CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
253
+ # Or with CLBLast acceleration
254
+ CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
255
+ # Or with AMD ROCm GPU acceleration (Linux only)
256
+ CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
257
+ # Or with Metal GPU acceleration for macOS systems only
258
+ CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
259
+
260
+ # In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
261
+ $env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
262
+ pip install llama-cpp-python
263
+ ```
264
+
265
+ #### Simple llama-cpp-python example code
266
+
267
+ ```python
268
+ from llama_cpp import Llama
269
+
270
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
271
+ llm = Llama(
272
+ model_path="./mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf", # Download the model file first
273
+ n_ctx=2048, # The max sequence length to use - note that longer sequence lengths require much more resources
274
+ n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
275
+ n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
276
+ )
277
+
278
+ # Simple inference example
279
+ output = llm(
280
+ "[INST] {prompt} [/INST]", # Prompt
281
+ max_tokens=512, # Generate up to 512 tokens
282
+ stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
283
+ echo=True # Whether to echo the prompt
284
+ )
285
+
286
+ # Chat Completion API
287
+
288
+ 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
289
+ llm.create_chat_completion(
290
+ messages = [
291
+ {"role": "system", "content": "You are a story writing assistant."},
292
+ {
293
+ "role": "user",
294
+ "content": "Write a story about llamas."
295
+ }
296
+ ]
297
+ )
298
+ ```
299
+
300
+ ## How to use with LangChain
301
+
302
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
303
+
304
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
305
 
306
+ <!-- README_GGUF.md-how-to-run end -->
307
 
308
  <!-- footer start -->
309
  <!-- 200823 -->