GGUF
GGUF
andrijdavid commited on
Commit
7a72f2f
β€’
1 Parent(s): 2f2ea0c

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +305 -0
README.md ADDED
@@ -0,0 +1,305 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - GGUF
5
+ quantized_by: andrijdavid
6
+ ---
7
+ # WizardLM-2-8x22B-GGUF
8
+ - Original model: [WizardLM-2-8x22B](https://huggingface.co/alpindale/WizardLM-2-8x22B)
9
+
10
+ <!-- description start -->
11
+ ## Description
12
+
13
+ This repo contains GGUF format model files for [WizardLM-2-8x22B](https://huggingface.co/alpindale/WizardLM-2-8x22B).
14
+
15
+ <!-- description end -->
16
+ <!-- README_GGUF.md-about-gguf start -->
17
+ ### About GGUF
18
+ 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.
19
+ Here is an incomplete list of clients and libraries that are known to support GGUF:
20
+ * [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.
21
+ * [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.
22
+ * [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​
23
+ * [KoboldCpp](https://github.com/LostRuins/koboldcpp), A comprehensive web UI offering GPU acceleration across all platforms and architectures, particularly renowned for storytelling.
24
+ * [GPT4All](https://gpt4all.io), This is a free and open source GUI that runs locally, supporting Windows, Linux, and macOS with full GPU acceleration.
25
+ * [LM Studio](https://lmstudio.ai/) An intuitive and powerful local GUI for Windows and macOS (Silicon), featuring GPU acceleration.
26
+ * [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.
27
+ * [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.
28
+ * [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.
29
+ * [candle](https://github.com/huggingface/candle), A Rust-based ML framework focusing on performance, including GPU support, and designed for ease of use.
30
+ * [ctransformers](https://github.com/marella/ctransformers), A Python library featuring GPU acceleration, LangChain support, and an OpenAI-compatible AI server.
31
+ * [localGPT](https://github.com/PromtEngineer/localGPT) An open-source initiative enabling private conversations with documents.
32
+ <!-- README_GGUF.md-about-gguf end -->
33
+
34
+ <!-- compatibility_gguf start -->
35
+ ## Explanation of quantisation methods
36
+ <details>
37
+ <summary>Click to see details</summary>
38
+ The new methods available are:
39
+
40
+ * 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)
41
+ * 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.
42
+ * 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.
43
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
44
+ * 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.
45
+ </details>
46
+ <!-- compatibility_gguf end -->
47
+
48
+ <!-- README_GGUF.md-how-to-download start -->
49
+ ## How to download GGUF files
50
+
51
+ **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.
52
+
53
+ The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
54
+
55
+ * LM Studio
56
+ * LoLLMS Web UI
57
+ * Faraday.dev
58
+
59
+ ### In `text-generation-webui`
60
+
61
+ Under Download Model, you can enter the model repo: LiteLLMs/WizardLM-2-8x22B-GGUF and below it, a specific filename to download, such as: Q4_0/Q4_0-00001-of-00009.gguf.
62
+
63
+ Then click Download.
64
+
65
+ ### On the command line, including multiple files at once
66
+
67
+ I recommend using the `huggingface-hub` Python library:
68
+
69
+ ```shell
70
+ pip3 install huggingface-hub
71
+ ```
72
+
73
+ Then you can download any individual model file to the current directory, at high speed, with a command like this:
74
+
75
+ ```shell
76
+ huggingface-cli download LiteLLMs/WizardLM-2-8x22B-GGUF Q4_0/Q4_0-00001-of-00009.gguf --local-dir . --local-dir-use-symlinks False
77
+ ```
78
+
79
+ <details>
80
+ <summary>More advanced huggingface-cli download usage (click to read)</summary>
81
+
82
+ You can also download multiple files at once with a pattern:
83
+
84
+ ```shell
85
+ huggingface-cli download LiteLLMs/WizardLM-2-8x22B-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
86
+ ```
87
+
88
+ 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).
89
+
90
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
91
+
92
+ ```shell
93
+ pip3 install huggingface_hub[hf_transfer]
94
+ ```
95
+
96
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
97
+
98
+ ```shell
99
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download LiteLLMs/WizardLM-2-8x22B-GGUF Q4_0/Q4_0-00001-of-00009.gguf --local-dir . --local-dir-use-symlinks False
100
+ ```
101
+
102
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
103
+ </details>
104
+ <!-- README_GGUF.md-how-to-download end -->
105
+ <!-- README_GGUF.md-how-to-run start -->
106
+ ## Example `llama.cpp` command
107
+
108
+ Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
109
+
110
+ ```shell
111
+ ./main -ngl 35 -m Q4_0/Q4_0-00001-of-00009.gguf --color -c 65536 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "<PROMPT>"
112
+ ```
113
+
114
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
115
+
116
+ Change `-c 65536` 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.
117
+
118
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
119
+
120
+ 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)
121
+
122
+ ## How to run in `text-generation-webui`
123
+
124
+ 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).
125
+
126
+ ## How to run from Python code
127
+
128
+ 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.
129
+
130
+ ### How to load this model in Python code, using llama-cpp-python
131
+
132
+ For full documentation, please see: [llama-cpp-python docs](https://abetlen.github.io/llama-cpp-python/).
133
+
134
+ #### First install the package
135
+
136
+ Run one of the following commands, according to your system:
137
+
138
+ ```shell
139
+ # Base ctransformers with no GPU acceleration
140
+ pip install llama-cpp-python
141
+ # With NVidia CUDA acceleration
142
+ CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
143
+ # Or with OpenBLAS acceleration
144
+ CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
145
+ # Or with CLBLast acceleration
146
+ CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
147
+ # Or with AMD ROCm GPU acceleration (Linux only)
148
+ CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
149
+ # Or with Metal GPU acceleration for macOS systems only
150
+ CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
151
+ # In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
152
+ $env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
153
+ pip install llama-cpp-python
154
+ ```
155
+
156
+ #### Simple llama-cpp-python example code
157
+
158
+ ```python
159
+ from llama_cpp import Llama
160
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
161
+ llm = Llama(
162
+ model_path="./Q4_0/Q4_0-00001-of-00009.gguf", # Download the model file first
163
+ n_ctx=32768, # The max sequence length to use - note that longer sequence lengths require much more resources
164
+ n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
165
+ n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
166
+ )
167
+ # Simple inference example
168
+ output = llm(
169
+ "<PROMPT>", # Prompt
170
+ max_tokens=512, # Generate up to 512 tokens
171
+ stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
172
+ echo=True # Whether to echo the prompt
173
+ )
174
+ # Chat Completion API
175
+ llm = Llama(model_path="./Q4_0/Q4_0-00001-of-00009.gguf", chat_format="llama-2") # Set chat_format according to the model you are using
176
+ llm.create_chat_completion(
177
+ messages = [
178
+ {"role": "system", "content": "You are a story writing assistant."},
179
+ {
180
+ "role": "user",
181
+ "content": "Write a story about llamas."
182
+ }
183
+ ]
184
+ )
185
+ ```
186
+
187
+ ## How to use with LangChain
188
+
189
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
190
+
191
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
192
+ * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
193
+
194
+ <!-- README_GGUF.md-how-to-run end -->
195
+
196
+ <!-- footer end -->
197
+
198
+ <!-- original-model-card start -->
199
+ # Original model card: WizardLM-2-8x22B
200
+
201
+
202
+
203
+
204
+ <p style="font-size:20px;" align="center">
205
+ 🏠 <a href="https://wizardlm.github.io/WizardLM2" target="_blank">WizardLM-2 Release Blog</a> </p>
206
+ <p align="center">
207
+ πŸ€— <a href="https://huggingface.co/collections/microsoft/wizardlm-2-661d403f71e6c8257dbd598a" target="_blank">HF Repo</a> β€’πŸ± <a href="https://github.com/victorsungo/WizardLM/tree/main/WizardLM-2" target="_blank">Github Repo</a> β€’ 🐦 <a href="https://twitter.com/WizardLM_AI" target="_blank">Twitter</a> β€’ πŸ“ƒ <a href="https://arxiv.org/abs/2304.12244" target="_blank">[WizardLM]</a> β€’ πŸ“ƒ <a href="https://arxiv.org/abs/2306.08568" target="_blank">[WizardCoder]</a> β€’ πŸ“ƒ <a href="https://arxiv.org/abs/2308.09583" target="_blank">[WizardMath]</a> <br>
208
+ </p>
209
+ <p align="center">
210
+ πŸ‘‹ Join our <a href="https://discord.gg/VZjjHtWrKs" target="_blank">Discord</a>
211
+ </p>
212
+
213
+ ## See [here](https://huggingface.co/lucyknada/microsoft_WizardLM-2-7B) for the WizardLM-2-7B re-upload.
214
+
215
+ ## News πŸ”₯πŸ”₯πŸ”₯ [2024/04/15]
216
+
217
+ We introduce and opensource WizardLM-2, our next generation state-of-the-art large language models,
218
+ which have improved performance on complex chat, multilingual, reasoning and agent.
219
+ New family includes three cutting-edge models: WizardLM-2 8x22B, WizardLM-2 70B, and WizardLM-2 7B.
220
+
221
+ - WizardLM-2 8x22B is our most advanced model, demonstrates highly competitive performance compared to those leading proprietary works
222
+ and consistently outperforms all the existing state-of-the-art opensource models.
223
+ - WizardLM-2 70B reaches top-tier reasoning capabilities and is the first choice in the same size.
224
+ - WizardLM-2 7B is the fastest and achieves comparable performance with existing 10x larger opensource leading models.
225
+
226
+ For more details of WizardLM-2 please read our [release blog post](https://web.archive.org/web/20240415221214/https://wizardlm.github.io/WizardLM2/) and upcoming paper.
227
+
228
+
229
+ ## Model Details
230
+
231
+ * **Model name**: WizardLM-2 8x22B
232
+ * **Developed by**: WizardLM@Microsoft AI
233
+ * **Model type**: Mixture of Experts (MoE)
234
+ * **Base model**: [mistral-community/Mixtral-8x22B-v0.1](https://huggingface.co/mistral-community/Mixtral-8x22B-v0.1)
235
+ * **Parameters**: 141B
236
+ * **Language(s)**: Multilingual
237
+ * **Blog**: [Introducing WizardLM-2](https://web.archive.org/web/20240415221214/https://wizardlm.github.io/WizardLM2/)
238
+ * **Repository**: [https://github.com/nlpxucan/WizardLM](https://github.com/nlpxucan/WizardLM)
239
+ * **Paper**: WizardLM-2 (Upcoming)
240
+ * **License**: Apache2.0
241
+
242
+ ## Model Capacities
243
+
244
+
245
+ **MT-Bench**
246
+
247
+ We also adopt the automatic MT-Bench evaluation framework based on GPT-4 proposed by lmsys to assess the performance of models.
248
+ The WizardLM-2 8x22B even demonstrates highly competitive performance compared to the most advanced proprietary models.
249
+ Meanwhile, WizardLM-2 7B and WizardLM-2 70B are all the top-performing models among the other leading baselines at 7B to 70B model scales.
250
+
251
+ <p align="center" width="100%">
252
+ <a ><img src="https://web.archive.org/web/20240415175608im_/https://wizardlm.github.io/WizardLM2/static/images/mtbench.png" alt="MTBench" style="width: 96%; min-width: 300px; display: block; margin: auto;"></a>
253
+ </p>
254
+
255
+
256
+ **Human Preferences Evaluation**
257
+
258
+ We carefully collected a complex and challenging set consisting of real-world instructions, which includes main requirements of humanity, such as writing, coding, math, reasoning, agent, and multilingual.
259
+ We report the win:loss rate without tie:
260
+
261
+ - WizardLM-2 8x22B is just slightly falling behind GPT-4-1106-preview, and significantly stronger than Command R Plus and GPT4-0314.
262
+ - WizardLM-2 70B is better than GPT4-0613, Mistral-Large, and Qwen1.5-72B-Chat.
263
+ - WizardLM-2 7B is comparable with Qwen1.5-32B-Chat, and surpasses Qwen1.5-14B-Chat and Starling-LM-7B-beta.
264
+
265
+ <p align="center" width="100%">
266
+ <a ><img src="https://web.archive.org/web/20240415163303im_/https://wizardlm.github.io/WizardLM2/static/images/winall.png" alt="Win" style="width: 96%; min-width: 300px; display: block; margin: auto;"></a>
267
+ </p>
268
+
269
+
270
+
271
+
272
+
273
+ ## Method Overview
274
+ We built a **fully AI powered synthetic training system** to train WizardLM-2 models, please refer to our [blog](https://web.archive.org/web/20240415221214/https://wizardlm.github.io/WizardLM2/) for more details of this system.
275
+
276
+ <p align="center" width="100%">
277
+ <a ><img src="https://web.archive.org/web/20240415163303im_/https://wizardlm.github.io/WizardLM2/static/images/exp_1.png" alt="Method" style="width: 96%; min-width: 300px; display: block; margin: auto;"></a>
278
+ </p>
279
+
280
+
281
+
282
+
283
+
284
+ ## Usage
285
+
286
+ ❗<b>Note for model system prompts usage:</b>
287
+
288
+
289
+ <b>WizardLM-2</b> adopts the prompt format from <b>Vicuna</b> and supports **multi-turn** conversation. The prompt should be as following:
290
+
291
+ ```
292
+ A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful,
293
+ detailed, and polite answers to the user's questions. USER: Hi ASSISTANT: Hello.</s>
294
+ USER: Who are you? ASSISTANT: I am WizardLM.</s>......
295
+ ```
296
+
297
+ <b> Inference WizardLM-2 Demo Script</b>
298
+
299
+ We provide a WizardLM-2 inference demo [code](https://github.com/nlpxucan/WizardLM/tree/main/demo) on our github.
300
+
301
+
302
+
303
+
304
+
305
+ <!-- original-model-card end -->