Initial GGML model commit
Browse files
README.md
ADDED
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
inference: false
|
3 |
+
license: other
|
4 |
+
model_type: llama
|
5 |
+
---
|
6 |
+
|
7 |
+
<!-- header start -->
|
8 |
+
<div style="width: 100%;">
|
9 |
+
<img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
|
10 |
+
</div>
|
11 |
+
<div style="display: flex; justify-content: space-between; width: 100%;">
|
12 |
+
<div style="display: flex; flex-direction: column; align-items: flex-start;">
|
13 |
+
<p><a href="https://discord.gg/theblokeai">Chat & support: my new Discord server</a></p>
|
14 |
+
</div>
|
15 |
+
<div style="display: flex; flex-direction: column; align-items: flex-end;">
|
16 |
+
<p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
|
17 |
+
</div>
|
18 |
+
</div>
|
19 |
+
<!-- header end -->
|
20 |
+
|
21 |
+
# ConceptofMind's LLongMA 2 7B GGML
|
22 |
+
|
23 |
+
These files are GGML format model files for [ConceptofMind's LLongMA 2 7B](https://huggingface.co/conceptofmind/LLongMA-2-7b).
|
24 |
+
|
25 |
+
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:
|
26 |
+
* [KoboldCpp](https://github.com/LostRuins/koboldcpp), a powerful GGML web UI with full GPU acceleration out of the box. Especially good for story telling.
|
27 |
+
* [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui), a great web UI with GPU acceleration via the c_transformers backend.
|
28 |
+
* [LM Studio](https://lmstudio.ai/), a fully featured local GUI. Supports full GPU accel on macOS. Also supports Windows, without GPU accel.
|
29 |
+
* [text-generation-webui](https://github.com/oobabooga/text-generation-webui), the most popular web UI. Requires extra steps to enable GPU accel via llama.cpp backend.
|
30 |
+
* [ctransformers](https://github.com/marella/ctransformers), a Python library with LangChain support and OpenAI-compatible AI server.
|
31 |
+
* [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), a Python library with OpenAI-compatible API server.
|
32 |
+
|
33 |
+
|
34 |
+
## Repositories available
|
35 |
+
|
36 |
+
* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/LLongMA-2-7B-GPTQ)
|
37 |
+
* [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/LLongMA-2-7B-GGML)
|
38 |
+
* [Original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/conceptofmind/LLongMA-2-7b)
|
39 |
+
|
40 |
+
## Prompt template: Unknown
|
41 |
+
|
42 |
+
```
|
43 |
+
{prompt}
|
44 |
+
```
|
45 |
+
|
46 |
+
<!-- compatibility_ggml start -->
|
47 |
+
## Compatibility
|
48 |
+
|
49 |
+
### Original llama.cpp quant methods: `q4_0, q4_1, q5_0, q5_1, q8_0`
|
50 |
+
|
51 |
+
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.
|
52 |
+
|
53 |
+
### 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`
|
54 |
+
|
55 |
+
These new quantisation methods are compatible with llama.cpp as of June 6th, commit `2d43387`.
|
56 |
+
|
57 |
+
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.
|
58 |
+
|
59 |
+
## Explanation of the new k-quant methods
|
60 |
+
<details>
|
61 |
+
<summary>Click to see details</summary>
|
62 |
+
|
63 |
+
The new methods available are:
|
64 |
+
* 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)
|
65 |
+
* 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.
|
66 |
+
* 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.
|
67 |
+
* GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
|
68 |
+
* 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
|
69 |
+
* 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.
|
70 |
+
|
71 |
+
Refer to the Provided Files table below to see what files use which methods, and how.
|
72 |
+
</details>
|
73 |
+
<!-- compatibility_ggml end -->
|
74 |
+
|
75 |
+
## Provided files
|
76 |
+
| Name | Quant method | Bits | Size | Max RAM required | Use case |
|
77 |
+
| ---- | ---- | ---- | ---- | ---- | ----- |
|
78 |
+
| llongma-2-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. |
|
79 |
+
| llongma-2-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 |
|
80 |
+
| llongma-2-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 |
|
81 |
+
| llongma-2-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 |
|
82 |
+
| llongma-2-7b.ggmlv3.q4_0.bin | q4_0 | 4 | 3.79 GB| 6.29 GB | Original quant method, 4-bit. |
|
83 |
+
| llongma-2-7b.ggmlv3.q4_1.bin | q4_1 | 4 | 4.21 GB| 6.71 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. |
|
84 |
+
| llongma-2-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 |
|
85 |
+
| llongma-2-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 |
|
86 |
+
| llongma-2-7b.ggmlv3.q5_0.bin | q5_0 | 5 | 4.63 GB| 7.13 GB | Original quant method, 5-bit. Higher accuracy, higher resource usage and slower inference. |
|
87 |
+
| llongma-2-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. |
|
88 |
+
| llongma-2-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 |
|
89 |
+
| llongma-2-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 |
|
90 |
+
| llongma-2-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 |
|
91 |
+
| llongma-2-7b.ggmlv3.q8_0.bin | q8_0 | 8 | 7.16 GB| 9.66 GB | Original quant method, 8-bit. Almost indistinguishable from float16. High resource use and slow. Not recommended for most users. |
|
92 |
+
|
93 |
+
**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.
|
94 |
+
|
95 |
+
## How to run in `llama.cpp`
|
96 |
+
|
97 |
+
I use the following command line; adjust for your tastes and needs:
|
98 |
+
|
99 |
+
```
|
100 |
+
./main -t 10 -ngl 32 -m llongma-2-7b.ggmlv3.q4_0.bin --color -c 2048 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "### Instruction: Write a story about llamas\n### Response:"
|
101 |
+
```
|
102 |
+
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`.
|
103 |
+
|
104 |
+
Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
|
105 |
+
|
106 |
+
If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
|
107 |
+
|
108 |
+
## How to run in `text-generation-webui`
|
109 |
+
|
110 |
+
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).
|
111 |
+
|
112 |
+
<!-- footer start -->
|
113 |
+
## Discord
|
114 |
+
|
115 |
+
For further support, and discussions on these models and AI in general, join us at:
|
116 |
+
|
117 |
+
[TheBloke AI's Discord server](https://discord.gg/theblokeai)
|
118 |
+
|
119 |
+
## Thanks, and how to contribute.
|
120 |
+
|
121 |
+
Thanks to the [chirper.ai](https://chirper.ai) team!
|
122 |
+
|
123 |
+
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.
|
124 |
+
|
125 |
+
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.
|
126 |
+
|
127 |
+
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
|
128 |
+
|
129 |
+
* Patreon: https://patreon.com/TheBlokeAI
|
130 |
+
* Ko-Fi: https://ko-fi.com/TheBlokeAI
|
131 |
+
|
132 |
+
**Special thanks to**: Luke from CarbonQuill, Aemon Algiz.
|
133 |
+
|
134 |
+
**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
|
135 |
+
|
136 |
+
|
137 |
+
Thank you to all my generous patrons and donaters!
|
138 |
+
|
139 |
+
<!-- footer end -->
|
140 |
+
|
141 |
+
# Original model card: ConceptofMind's LLongMA 2 7B
|
142 |
+
|
143 |
+
LLongMA-2, a suite of Llama-2 models, trained at 8k context length using linear positional interpolation scaling. The model was trained in collaboration with Emozilla of NousResearch and Kaiokendev.
|
144 |
+
|
145 |
+
We worked directly with Kaiokendev, to extend the context length of the Llama-2 7b model through fine-tuning. The models pass all our evaluations and maintain the same perplexity at 8k extrapolation surpassing the performance of other recent methodologies.
|
146 |
+
|
147 |
+
The model has identical performance to LLaMA 2 under 4k context length, performance scales directly to 8k, and works out-of-the-box with the new version of transformers (4.31) or with `trust_remote_code` for <= 4.30.
|
148 |
+
|
149 |
+
A Llama-2 13b model trained at 8k will release soon on huggingface here: https://huggingface.co/conceptofmind/LLongMA-2-13b
|
150 |
+
|
151 |
+
Applying the method to the rotary position embedding requires only slight changes to the model's code by dividing the positional index, t, by a scaling factor.
|
152 |
+
|
153 |
+
The repository containing u/emozilla’s implementation of scaled rotary embeddings can be found here: https://github.com/jquesnelle/scaled-rope
|
154 |
+
|
155 |
+
If you would like to learn more about scaling rotary embeddings, I would strongly recommend reading u/kaiokendev's blog posts on his findings: https://kaiokendev.github.io/
|
156 |
+
|
157 |
+
A PR to add scaled rotary embeddings to Huggingface transformers has been added by u/joao_gante and merged: https://github.com/huggingface/transformers/pull/24653
|
158 |
+
|
159 |
+
The model was trained for ~1 billion tokens on Togethercompute's Red Pajama dataset. The context length of the examples varies: https://huggingface.co/datasets/togethercomputer/RedPajama-Data-1T
|
160 |
+
|
161 |
+
The pre-tokenized dataset will be available here for you to use soon: https://huggingface.co/datasets/conceptofmind/rp-llama-2-7b-tokenized-chunked
|
162 |
+
|
163 |
+
I would also recommend checking out the phenomenal research by Ofir Press on ALiBi which laid the foundation for many of these scaling techniques: https://arxiv.org/abs/2108.12409
|
164 |
+
|
165 |
+
It is also worth reviewing the paper, A Length-Extrapolatable Transformer, and xPos technique which also applies scaling to rotary embeddings: https://arxiv.org/pdf/2212.10554.pdf
|
166 |
+
|
167 |
+
We previously trained the first publicly available model with rotary embedding scaling here: https://twitter.com/EnricoShippole/status/1655599301454594049?s=20
|
168 |
+
|
169 |
+
A Llama-2 13b model trained at 8k will release soon. As well as a suite of Llama-2 models trained at 16k context lengths will be released soon.
|
170 |
+
|
171 |
+
You can find out more about the NousResearch organization here: https://huggingface.co/NousResearch
|
172 |
+
|
173 |
+
The compute for this model release is all thanks to the generous sponsorship by CarperAI, Emad Mostaque, and StabilityAI. This is not an official StabilityAI product.
|
174 |
+
|
175 |
+
If you have any questions about the data or model be sure to reach out and ask! I will try to respond promptly.
|
176 |
+
|
177 |
+
The previous suite of LLongMA model releases can be found here: https://twitter.com/EnricoShippole/status/1677346578720256000?s=20
|
178 |
+
|
179 |
+
All of the models can be found on Huggingface: https://huggingface.co/conceptofmind
|