TheBloke commited on
Commit
861d13b
1 Parent(s): 9423cf2

Initial GGML model commit

Browse files
Files changed (1) hide show
  1. README.md +251 -0
README.md ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - conceptofmind/cot_submix_original
4
+ - conceptofmind/flan2021_submix_original
5
+ - conceptofmind/t0_submix_original
6
+ - conceptofmind/niv2_submix_original
7
+ inference: false
8
+ language:
9
+ - en
10
+ license: other
11
+ model_creator: Stability AI
12
+ model_link: https://huggingface.co/stabilityai/StableBeluga-7b
13
+ model_name: StableBeluga 7B
14
+ model_type: llama
15
+ pipeline_tag: text-generation
16
+ quantized_by: TheBloke
17
+ ---
18
+
19
+ <!-- header start -->
20
+ <div style="width: 100%;">
21
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
22
+ </div>
23
+ <div style="display: flex; justify-content: space-between; width: 100%;">
24
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
25
+ <p><a href="https://discord.gg/theblokeai">Chat & support: my new Discord server</a></p>
26
+ </div>
27
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
28
+ <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
29
+ </div>
30
+ </div>
31
+ <!-- header end -->
32
+
33
+ # StableBeluga 7B - GGML
34
+ - Model creator: [Stability AI](https://huggingface.co/stabilityai)
35
+ - Original model: [StableBeluga 7B](https://huggingface.co/stabilityai/StableBeluga-7b)
36
+
37
+ ## Description
38
+
39
+ This repo contains GGML format model files for [Stability AI's StableBeluga 7B](https://huggingface.co/stabilityai/StableBeluga-7b).
40
+
41
+ GGML files are for CPU + GPU inference using [llama.cpp](https://github.com/ggerganov/llama.cpp) and libraries and UIs which support this format, such as:
42
+ * [text-generation-webui](https://github.com/oobabooga/text-generation-webui), the most popular web UI. Supports NVidia CUDA GPU acceleration.
43
+ * [KoboldCpp](https://github.com/LostRuins/koboldcpp), a powerful GGML web UI with GPU acceleration on all platforms (CUDA and OpenCL). Especially good for story telling.
44
+ * [LM Studio](https://lmstudio.ai/), a fully featured local GUI with GPU acceleration on both Windows (NVidia and AMD), and macOS.
45
+ * [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui), a great web UI with CUDA GPU acceleration via the c_transformers backend.
46
+ * [ctransformers](https://github.com/marella/ctransformers), a Python library with GPU accel, LangChain support, and OpenAI-compatible AI server.
47
+ * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), a Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
48
+
49
+ ## Repositories available
50
+
51
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ)
52
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/StableBeluga-7B-GGML)
53
+ * [Stability AI's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/stabilityai/StableBeluga-7b)
54
+
55
+ ## Prompt template: Orca-Hashes
56
+
57
+ ```
58
+ ### System:
59
+ This is a system prompt, please behave and help the user.
60
+
61
+ ### User:
62
+ {prompt}
63
+
64
+ ### Assistant:
65
+ ```
66
+
67
+ <!-- compatibility_ggml start -->
68
+ ## Compatibility
69
+
70
+ ### Original llama.cpp quant methods: `q4_0, q4_1, q5_0, q5_1, q8_0`
71
+
72
+ These are guaranteed to be compatible with any UIs, tools and libraries released since late May. They may be phased out soon, as they are largely superseded by the new k-quant methods.
73
+
74
+ ### New k-quant methods: `q2_K, q3_K_S, q3_K_M, q3_K_L, q4_K_S, q4_K_M, q5_K_S, q6_K`
75
+
76
+ These new quantisation methods are compatible with llama.cpp as of June 6th, commit `2d43387`.
77
+
78
+ They are now also compatible with recent releases of text-generation-webui, KoboldCpp, llama-cpp-python, ctransformers, rustformers and most others. For compatibility with other tools and libraries, please check their documentation.
79
+
80
+ ## Explanation of the new k-quant methods
81
+ <details>
82
+ <summary>Click to see details</summary>
83
+
84
+ The new methods available are:
85
+ * 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)
86
+ * 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.
87
+ * 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.
88
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
89
+ * 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
90
+ * GGML_TYPE_Q8_K - "type-0" 8-bit quantization. Only used for quantizing intermediate results. The difference to the existing Q8_0 is that the block size is 256. All 2-6 bit dot products are implemented for this quantization type.
91
+
92
+ Refer to the Provided Files table below to see what files use which methods, and how.
93
+ </details>
94
+ <!-- compatibility_ggml end -->
95
+
96
+ ## Provided files
97
+
98
+ | Name | Quant method | Bits | Size | Max RAM required | Use case |
99
+ | ---- | ---- | ---- | ---- | ---- | ----- |
100
+ | [stablebeluga-7b.ggmlv3.q2_K.bin](https://huggingface.co/TheBloke/StableBeluga-7B-GGML/blob/main/stablebeluga-7b.ggmlv3.q2_K.bin) | q2_K | 2 | 2.87 GB| 5.37 GB | New k-quant method. Uses GGML_TYPE_Q4_K for the attention.vw and feed_forward.w2 tensors, GGML_TYPE_Q2_K for the other tensors. |
101
+ | [stablebeluga-7b.ggmlv3.q3_K_L.bin](https://huggingface.co/TheBloke/StableBeluga-7B-GGML/blob/main/stablebeluga-7b.ggmlv3.q3_K_L.bin) | q3_K_L | 3 | 3.60 GB| 6.10 GB | New k-quant method. Uses GGML_TYPE_Q5_K for the attention.wv, attention.wo, and feed_forward.w2 tensors, else GGML_TYPE_Q3_K |
102
+ | [stablebeluga-7b.ggmlv3.q3_K_M.bin](https://huggingface.co/TheBloke/StableBeluga-7B-GGML/blob/main/stablebeluga-7b.ggmlv3.q3_K_M.bin) | q3_K_M | 3 | 3.28 GB| 5.78 GB | New k-quant method. Uses GGML_TYPE_Q4_K for the attention.wv, attention.wo, and feed_forward.w2 tensors, else GGML_TYPE_Q3_K |
103
+ | [stablebeluga-7b.ggmlv3.q3_K_S.bin](https://huggingface.co/TheBloke/StableBeluga-7B-GGML/blob/main/stablebeluga-7b.ggmlv3.q3_K_S.bin) | q3_K_S | 3 | 2.95 GB| 5.45 GB | New k-quant method. Uses GGML_TYPE_Q3_K for all tensors |
104
+ | [stablebeluga-7b.ggmlv3.q4_0.bin](https://huggingface.co/TheBloke/StableBeluga-7B-GGML/blob/main/stablebeluga-7b.ggmlv3.q4_0.bin) | q4_0 | 4 | 3.83 GB| 6.33 GB | Original quant method, 4-bit. |
105
+ | [stablebeluga-7b.ggmlv3.q4_1.bin](https://huggingface.co/TheBloke/StableBeluga-7B-GGML/blob/main/stablebeluga-7b.ggmlv3.q4_1.bin) | q4_1 | 4 | 4.24 GB| 6.74 GB | Original quant method, 4-bit. Higher accuracy than q4_0 but not as high as q5_0. However has quicker inference than q5 models. |
106
+ | [stablebeluga-7b.ggmlv3.q4_K_M.bin](https://huggingface.co/TheBloke/StableBeluga-7B-GGML/blob/main/stablebeluga-7b.ggmlv3.q4_K_M.bin) | q4_K_M | 4 | 4.08 GB| 6.58 GB | New k-quant method. Uses GGML_TYPE_Q6_K for half of the attention.wv and feed_forward.w2 tensors, else GGML_TYPE_Q4_K |
107
+ | [stablebeluga-7b.ggmlv3.q4_K_S.bin](https://huggingface.co/TheBloke/StableBeluga-7B-GGML/blob/main/stablebeluga-7b.ggmlv3.q4_K_S.bin) | q4_K_S | 4 | 3.83 GB| 6.33 GB | New k-quant method. Uses GGML_TYPE_Q4_K for all tensors |
108
+ | [stablebeluga-7b.ggmlv3.q5_0.bin](https://huggingface.co/TheBloke/StableBeluga-7B-GGML/blob/main/stablebeluga-7b.ggmlv3.q5_0.bin) | q5_0 | 5 | 4.65 GB| 7.15 GB | Original quant method, 5-bit. Higher accuracy, higher resource usage and slower inference. |
109
+ | [stablebeluga-7b.ggmlv3.q5_1.bin](https://huggingface.co/TheBloke/StableBeluga-7B-GGML/blob/main/stablebeluga-7b.ggmlv3.q5_1.bin) | q5_1 | 5 | 5.06 GB| 7.56 GB | Original quant method, 5-bit. Even higher accuracy, resource usage and slower inference. |
110
+ | [stablebeluga-7b.ggmlv3.q5_K_M.bin](https://huggingface.co/TheBloke/StableBeluga-7B-GGML/blob/main/stablebeluga-7b.ggmlv3.q5_K_M.bin) | q5_K_M | 5 | 4.78 GB| 7.28 GB | New k-quant method. Uses GGML_TYPE_Q6_K for half of the attention.wv and feed_forward.w2 tensors, else GGML_TYPE_Q5_K |
111
+ | [stablebeluga-7b.ggmlv3.q5_K_S.bin](https://huggingface.co/TheBloke/StableBeluga-7B-GGML/blob/main/stablebeluga-7b.ggmlv3.q5_K_S.bin) | q5_K_S | 5 | 4.65 GB| 7.15 GB | New k-quant method. Uses GGML_TYPE_Q5_K for all tensors |
112
+ | [stablebeluga-7b.ggmlv3.q6_K.bin](https://huggingface.co/TheBloke/StableBeluga-7B-GGML/blob/main/stablebeluga-7b.ggmlv3.q6_K.bin) | q6_K | 6 | 5.53 GB| 8.03 GB | New k-quant method. Uses GGML_TYPE_Q8_K for all tensors - 6-bit quantization |
113
+ | [stablebeluga-7b.ggmlv3.q8_0.bin](https://huggingface.co/TheBloke/StableBeluga-7B-GGML/blob/main/stablebeluga-7b.ggmlv3.q8_0.bin) | q8_0 | 8 | 7.13 GB| 9.63 GB | Original quant method, 8-bit. Almost indistinguishable from float16. High resource use and slow. Not recommended for most users. |
114
+
115
+ **Note**: the above RAM figures assume no GPU offloading. If layers are offloaded to the GPU, this will reduce RAM usage and use VRAM instead.
116
+
117
+ ## How to run in `llama.cpp`
118
+
119
+ I use the following command line; adjust for your tastes and needs:
120
+
121
+ ```
122
+ ./main -t 10 -ngl 32 -m stablebeluga-7b.ggmlv3.q4_K_M.bin --color -c 2048 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "### Instruction: Write a story about llamas\n### Response:"
123
+ ```
124
+ Change `-t 10` to the number of physical CPU cores you have. For example if your system has 8 cores/16 threads, use `-t 8`.
125
+
126
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
127
+
128
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
129
+
130
+ ## How to run in `text-generation-webui`
131
+
132
+ Further instructions here: [text-generation-webui/docs/llama.cpp-models.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/llama.cpp-models.md).
133
+
134
+ <!-- footer start -->
135
+ ## Discord
136
+
137
+ For further support, and discussions on these models and AI in general, join us at:
138
+
139
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
140
+
141
+ ## Thanks, and how to contribute.
142
+
143
+ Thanks to the [chirper.ai](https://chirper.ai) team!
144
+
145
+ I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
146
+
147
+ If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
148
+
149
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
150
+
151
+ * Patreon: https://patreon.com/TheBlokeAI
152
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
153
+
154
+ **Special thanks to**: Luke from CarbonQuill, Aemon Algiz.
155
+
156
+ **Patreon special mentions**: Slarti, Chadd, John Detwiler, Pieter, zynix, K, Mano Prime, ReadyPlayerEmma, Ai Maven, Leonard Tan, Edmond Seymore, Joseph William Delisle, Luke @flexchar, Fred von Graf, Viktor Bowallius, Rishabh Srivastava, Nikolai Manek, Matthew Berman, Johann-Peter Hartmann, ya boyyy, Greatston Gnanesh, Femi Adebogun, Talal Aujan, Jonathan Leane, terasurfer, David Flickinger, William Sang, Ajan Kanaga, Vadim, Artur Olbinski, Raven Klaugh, Michael Levine, Oscar Rangel, Randy H, Cory Kujawski, RoA, Dave, Alex, Alexandros Triantafyllidis, Fen Risland, Eugene Pentland, vamX, Elle, Nathan LeClaire, Khalefa Al-Ahmad, Rainer Wilmers, subjectnull, Junyu Yang, Daniel P. Andersen, SuperWojo, LangChain4j, Mandus, Kalila, Illia Dulskyi, Trenton Dambrowitz, Asp the Wyvern, Derek Yates, Jeffrey Morgan, Deep Realms, Imad Khwaja, Pyrater, Preetika Verma, biorpg, Gabriel Tamborski, Stephen Murray, Spiking Neurons AB, Iucharbius, Chris Smitley, Willem Michiel, Luke Pendergrass, Sebastain Graf, senxiiz, Will Dee, Space Cruiser, Karl Bernard, Clay Pascal, Lone Striker, transmissions 11, webtim, WelcomeToTheClub, Sam, theTransient, Pierre Kircher, chris gileta, John Villwock, Sean Connelly, Willian Hasse
157
+
158
+
159
+ Thank you to all my generous patrons and donaters!
160
+
161
+ <!-- footer end -->
162
+
163
+ # Original model card: Stability AI's StableBeluga 7B
164
+
165
+ # Stable Beluga 7B
166
+
167
+ ## Model Description
168
+
169
+ `Stable Beluga 7B` is a Llama2 7B model finetuned on an Orca style Dataset
170
+
171
+ ## Usage
172
+
173
+ Start chatting with `Stable Beluga 7B` using the following code snippet:
174
+
175
+ ```python
176
+ import torch
177
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
178
+
179
+ tokenizer = AutoTokenizer.from_pretrained("stabilityai/StableBeluga-7B", use_fast=False)
180
+ model = AutoModelForCausalLM.from_pretrained("stabilityai/StableBeluga-7B", torch_dtype=torch.float16, low_cpu_mem_usage=True, device_map="auto")
181
+ system_prompt = "### System:\nYou are StableBeluga, an AI that follows instructions extremely well. Help as much as you can. Remember, be safe, and don't do anything illegal.\n\n"
182
+
183
+ message = "Write me a poem please"
184
+ prompt = f"{system_prompt}### User: {message}\n\n### Assistant:\n"
185
+ inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
186
+ output = model.generate(**inputs, do_sample=True, top_p=0.95, top_k=0, max_new_tokens=256)
187
+
188
+ print(tokenizer.decode(output[0], skip_special_tokens=True))
189
+ ```
190
+
191
+ Stable Beluga 7B should be used with this prompt format:
192
+ ```
193
+ ### System:
194
+ This is a system prompt, please behave and help the user.
195
+
196
+ ### User:
197
+ Your prompt here
198
+
199
+ ### Assistant:
200
+ The output of Stable Beluga 7B
201
+ ```
202
+
203
+ ## Model Details
204
+
205
+ * **Developed by**: [Stability AI](https://stability.ai/)
206
+ * **Model type**: Stable Beluga 7B is an auto-regressive language model fine-tuned on Llama2 7B.
207
+ * **Language(s)**: English
208
+ * **Library**: [HuggingFace Transformers](https://github.com/huggingface/transformers)
209
+ * **License**: Fine-tuned checkpoints (`Stable Beluga 7B`) is licensed under the [STABLE BELUGA NON-COMMERCIAL COMMUNITY LICENSE AGREEMENT](https://huggingface.co/stabilityai/StableBeluga-7B/blob/main/LICENSE.txt)
210
+ * **Contact**: For questions and comments about the model, please email `lm@stability.ai`
211
+
212
+ ### Training Dataset
213
+
214
+ ` Stable Beluga 7B` is trained on our internal Orca-style dataset
215
+
216
+ ### Training Procedure
217
+
218
+ Models are learned via supervised fine-tuning on the aforementioned datasets, trained in mixed-precision (BF16), and optimized with AdamW. We outline the following hyperparameters:
219
+
220
+ | Dataset | Batch Size | Learning Rate |Learning Rate Decay| Warm-up | Weight Decay | Betas |
221
+ |-------------------|------------|---------------|-------------------|---------|--------------|-------------|
222
+ | Orca pt1 packed | 256 | 3e-5 | Cosine to 3e-6 | 100 | 1e-6 | (0.9, 0.95) |
223
+ | Orca pt2 unpacked | 512 | 3e-5 | Cosine to 3e-6 | 100 | 1e-6 | (0.9, 0.95) |
224
+
225
+ ## Ethical Considerations and Limitations
226
+
227
+ Beluga is a new technology that carries risks with use. Testing conducted to date has been in English, and has not covered, nor could it cover all scenarios. For these reasons, as with all LLMs, Beluga's potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses to user prompts. Therefore, before deploying any applications of Beluga, developers should perform safety testing and tuning tailored to their specific applications of the model.
228
+
229
+ ## Citations
230
+
231
+ ```bibtext
232
+ @misc{touvron2023llama,
233
+ title={Llama 2: Open Foundation and Fine-Tuned Chat Models},
234
+ author={Hugo Touvron and Louis Martin and Kevin Stone and Peter Albert and Amjad Almahairi and Yasmine Babaei and Nikolay Bashlykov and Soumya Batra and Prajjwal Bhargava and Shruti Bhosale and Dan Bikel and Lukas Blecher and Cristian Canton Ferrer and Moya Chen and Guillem Cucurull and David Esiobu and Jude Fernandes and Jeremy Fu and Wenyin Fu and Brian Fuller and Cynthia Gao and Vedanuj Goswami and Naman Goyal and Anthony Hartshorn and Saghar Hosseini and Rui Hou and Hakan Inan and Marcin Kardas and Viktor Kerkez and Madian Khabsa and Isabel Kloumann and Artem Korenev and Punit Singh Koura and Marie-Anne Lachaux and Thibaut Lavril and Jenya Lee and Diana Liskovich and Yinghai Lu and Yuning Mao and Xavier Martinet and Todor Mihaylov and Pushkar Mishra and Igor Molybog and Yixin Nie and Andrew Poulton and Jeremy Reizenstein and Rashi Rungta and Kalyan Saladi and Alan Schelten and Ruan Silva and Eric Michael Smith and Ranjan Subramanian and Xiaoqing Ellen Tan and Binh Tang and Ross Taylor and Adina Williams and Jian Xiang Kuan and Puxin Xu and Zheng Yan and Iliyan Zarov and Yuchen Zhang and Angela Fan and Melanie Kambadur and Sharan Narang and Aurelien Rodriguez and Robert Stojnic and Sergey Edunov and Thomas Scialom},
235
+ year={2023},
236
+ eprint={2307.09288},
237
+ archivePrefix={arXiv},
238
+ primaryClass={cs.CL}
239
+ }
240
+ ```
241
+
242
+ ```bibtext
243
+ @misc{mukherjee2023orca,
244
+ title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
245
+ author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
246
+ year={2023},
247
+ eprint={2306.02707},
248
+ archivePrefix={arXiv},
249
+ primaryClass={cs.CL}
250
+ }
251
+ ```