Transformers
code
gpt-neox
causal-lm
Eval Results
TheBloke commited on
Commit
2a0e537
1 Parent(s): 4c47f36

Initial GGML model commit

Browse files
Files changed (1) hide show
  1. README.md +216 -0
README.md ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - bigcode/starcoderdata
4
+ inference: false
5
+ language:
6
+ - code
7
+ license: apache-2.0
8
+ model-index:
9
+ - name: stabilityai/stablecode-completion-alpha-3b-4k
10
+ results:
11
+ - dataset:
12
+ name: HumanEval
13
+ type: openai_humaneval
14
+ metrics:
15
+ - name: pass@1
16
+ type: pass@1
17
+ value: 0.1768
18
+ verified: false
19
+ - name: pass@10
20
+ type: pass@10
21
+ value: 0.2701
22
+ verified: false
23
+ task:
24
+ type: text-generation
25
+ model_creator: StabilityAI
26
+ model_link: https://huggingface.co/stabilityai/stablecode-completion-alpha-3b-4k
27
+ model_name: Stablecode Completion Alpha 3B 4K
28
+ model_type: gpt-neox
29
+ quantized_by: TheBloke
30
+ tags:
31
+ - causal-lm
32
+ ---
33
+
34
+ <!-- header start -->
35
+ <div style="width: 100%;">
36
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
37
+ </div>
38
+ <div style="display: flex; justify-content: space-between; width: 100%;">
39
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
40
+ <p><a href="https://discord.gg/theblokeai">Chat & support: my new Discord server</a></p>
41
+ </div>
42
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
43
+ <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
44
+ </div>
45
+ </div>
46
+ <!-- header end -->
47
+
48
+ # Stablecode Completion Alpha 3B 4K - GGML
49
+ - Model creator: [StabilityAI](https://huggingface.co/StabilityAI)
50
+ - Original model: [Stablecode Completion Alpha 3B 4K](https://huggingface.co/stabilityai/stablecode-completion-alpha-3b-4k)
51
+
52
+ ## Description
53
+
54
+ This repo contains GPT-NeoX GGML format model files for [StabilityAI's Stablecode Completion Alpha 3B 4K](https://huggingface.co/stabilityai/stablecode-completion-alpha-3b-4k).
55
+
56
+ Please note that these GGMLs are **not compatible with llama.cpp, text-generation-webui or llama-cpp-python**. Please see below for a list of tools that work with this GGML model.
57
+
58
+ ## Repositories available
59
+
60
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/stablecode-completion-alpha-3b-4k-GPTQ)
61
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/stablecode-completion-alpha-3b-4k-GGML)
62
+ * [StabilityAI's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/stabilityai/stablecode-completion-alpha-3b-4k)
63
+
64
+ ## Prompt template: Custom
65
+
66
+ Just enter code to complete:
67
+ ```
68
+ import torch
69
+ import torch.nn as nn
70
+ ```
71
+
72
+
73
+ <!-- compatibility_ggml start -->
74
+ ## Compatibilty
75
+
76
+ These files are **not** compatible with llama.cpp, text-generation-webui or llama-cpp-python.
77
+
78
+ They can be used with:
79
+ * [KoboldCpp](https://github.com/LostRuins/koboldcpp), a powerful inference engine based on llama.cpp with full GPU acceleration and good UI.
80
+ * [LM Studio](https://lmstudio.ai/), a fully featured local GUI for GGML inference on Windows and macOS.
81
+ * [LoLLMs-WebUI](https://github.com/ParisNeo/LoLLMs-WebUI) a web UI which supports nearly every backend out there. Use ctransformers backend for support for this model.
82
+ * [ctransformers](https://github.com/marella/ctransformers): for use in Python code, including LangChain support.
83
+ * [rustformers' llm](https://github.com/rustformers/llm)
84
+ * The example `gpt-neox` binary provided with [ggml](https://github.com/ggerganov/ggml)
85
+
86
+ As other options become available I will endeavour to update them here (do let me know in the Community tab if I've missed something!)
87
+
88
+ ## Tutorial for using LoLLMs-WebUI:
89
+
90
+ * [Video tutorial, by LoLLMs-WebUI's author **ParisNeo**](https://youtu.be/vBU1b5n0GMU)
91
+ <!-- compatibility_ggml end -->
92
+
93
+ ## Provided files
94
+ | Name | Quant method | Bits | Size | Max RAM required | Use case |
95
+ | ---- | ---- | ---- | ---- | ---- | ----- |
96
+ | [stablecode-completion-alpha-3b-4k.ggmlv1.q4_0.bin](https://huggingface.co/TheBloke/stablecode-completion-alpha-3b-4k-GGML/blob/main/stablecode-completion-alpha-3b-4k.ggmlv1.q4_0.bin) | q4_0 | 4 | 1.56 GB| 4.06 GB | 4-bit. |
97
+ | [stablecode-completion-alpha-3b-4k.ggmlv1.q4_1.bin](https://huggingface.co/TheBloke/stablecode-completion-alpha-3b-4k-GGML/blob/main/stablecode-completion-alpha-3b-4k.ggmlv1.q4_1.bin) | q4_1 | 4 | 1.73 GB| 4.23 GB | 4-bit. Higher accuracy than q4_0 but not as high as q5_0. However has quicker inference than q5 models. |
98
+ | [stablecode-completion-alpha-3b-4k.ggmlv1.q5_0.bin](https://huggingface.co/TheBloke/stablecode-completion-alpha-3b-4k-GGML/blob/main/stablecode-completion-alpha-3b-4k.ggmlv1.q5_0.bin) | q5_0 | 5 | 1.91 GB| 4.41 GB | 5-bit. Higher accuracy, higher resource usage and slower inference. |
99
+ | [stablecode-completion-alpha-3b-4k.ggmlv1.q5_1.bin](https://huggingface.co/TheBloke/stablecode-completion-alpha-3b-4k-GGML/blob/main/stablecode-completion-alpha-3b-4k.ggmlv1.q5_1.bin) | q5_1 | 5 | 2.08 GB| 4.58 GB | 5-bit. Even higher accuracy, resource usage and slower inference. |
100
+ | [stablecode-completion-alpha-3b-4k.ggmlv1.q8_0.bin](https://huggingface.co/TheBloke/stablecode-completion-alpha-3b-4k-GGML/blob/main/stablecode-completion-alpha-3b-4k.ggmlv1.q8_0.bin) | q8_0 | 8 | 2.95 GB| 5.45 GB | 8-bit. Almost indistinguishable from float16. High resource use and slow. Not recommended for most users. |
101
+
102
+ **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.
103
+
104
+ <!-- footer start -->
105
+ ## Discord
106
+
107
+ For further support, and discussions on these models and AI in general, join us at:
108
+
109
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
110
+
111
+ ## Thanks, and how to contribute.
112
+
113
+ Thanks to the [chirper.ai](https://chirper.ai) team!
114
+
115
+ 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.
116
+
117
+ 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.
118
+
119
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
120
+
121
+ * Patreon: https://patreon.com/TheBlokeAI
122
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
123
+
124
+ **Special thanks to**: Luke from CarbonQuill, Aemon Algiz.
125
+
126
+ **Patreon special mentions**: Willem Michiel, Ajan Kanaga, Cory Kujawski, Alps Aficionado, Nikolai Manek, Jonathan Leane, Stanislav Ovsiannikov, Michael Levine, Luke Pendergrass, Sid, K, Gabriel Tamborski, Clay Pascal, Kalila, William Sang, Will Dee, Pieter, Nathan LeClaire, ya boyyy, David Flickinger, vamX, Derek Yates, Fen Risland, Jeffrey Morgan, webtim, Daniel P. Andersen, Chadd, Edmond Seymore, Pyrater, Olusegun Samson, Lone Striker, biorpg, alfie_i, Mano Prime, Chris Smitley, Dave, zynix, Trenton Dambrowitz, Johann-Peter Hartmann, Magnesian, Spencer Kim, John Detwiler, Iucharbius, Gabriel Puliatti, LangChain4j, Luke @flexchar, Vadim, Rishabh Srivastava, Preetika Verma, Ai Maven, Femi Adebogun, WelcomeToTheClub, Leonard Tan, Imad Khwaja, Steven Wood, Stefan Sabev, Sebastain Graf, usrbinkat, Dan Guido, Sam, Eugene Pentland, Mandus, transmissions 11, Slarti, Karl Bernard, Spiking Neurons AB, Artur Olbinski, Joseph William Delisle, ReadyPlayerEmma, Olakabola, Asp the Wyvern, Space Cruiser, Matthew Berman, Randy H, subjectnull, danny, John Villwock, Illia Dulskyi, Rainer Wilmers, theTransient, Pierre Kircher, Alexandros Triantafyllidis, Viktor Bowallius, terasurfer, Deep Realms, SuperWojo, senxiiz, Oscar Rangel, Alex, Stephen Murray, Talal Aujan, Raven Klaugh, Sean Connelly, Raymond Fosdick, Fred von Graf, chris gileta, Junyu Yang, Elle
127
+
128
+
129
+ Thank you to all my generous patrons and donaters!
130
+
131
+ <!-- footer end -->
132
+
133
+ # Original model card: StabilityAI's Stablecode Completion Alpha 3B 4K
134
+
135
+ # `StableCode-Completion-Alpha-3B-4K`
136
+
137
+ ## Model Description
138
+
139
+ `StableCode-Completion-Alpha-3B-4K` is a 3 billion parameter decoder-only code completion model pre-trained on diverse set of programming languages that topped the stackoverflow developer survey.
140
+
141
+ ## Usage
142
+ The model is intended to do single/multiline code completion from a long context window upto 4k tokens.
143
+ Get started generating code with `StableCode-Completion-Alpha-3B-4k` by using the following code snippet:
144
+
145
+ ```python
146
+ from transformers import AutoModelForCausalLM, AutoTokenizer
147
+ tokenizer = AutoTokenizer.from_pretrained("stabilityai/stablecode-completion-alpha-3b-4k")
148
+ model = AutoModelForCausalLM.from_pretrained(
149
+ "stabilityai/stablecode-completion-alpha-3b-4k",
150
+ trust_remote_code=True,
151
+ torch_dtype="auto",
152
+ )
153
+ model.cuda()
154
+ inputs = tokenizer("import torch\nimport torch.nn as nn", return_tensors="pt").to("cuda")
155
+ tokens = model.generate(
156
+ **inputs,
157
+ max_new_tokens=48,
158
+ temperature=0.2,
159
+ do_sample=True,
160
+ )
161
+ print(tokenizer.decode(tokens[0], skip_special_tokens=True))
162
+ ```
163
+
164
+ ## Model Details
165
+
166
+ * **Developed by**: [Stability AI](https://stability.ai/)
167
+ * **Model type**: `StableCode-Completion-Alpha-3B-4k` models are auto-regressive language models based on the transformer decoder architecture.
168
+ * **Language(s)**: Code
169
+ * **Library**: [GPT-NeoX](https://github.com/EleutherAI/gpt-neox)
170
+ * **License**: Model checkpoints are licensed under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) license.
171
+ * **Contact**: For questions and comments about the model, please email `lm@stability.ai`
172
+
173
+ ### Model Architecture
174
+
175
+ | Parameters | Hidden Size | Layers | Heads | Sequence Length |
176
+ |----------------|-------------|--------|-------|-----------------|
177
+ | 2,796,431,360 | 2560 | 32 | 32 | 4096 |
178
+
179
+
180
+ * **Decoder Layer**: Parallel Attention and MLP residuals with a single input LayerNorm ([Wang & Komatsuzaki, 2021](https://github.com/kingoflolz/mesh-transformer-jax/tree/master))
181
+ * **Position Embeddings**: Rotary Position Embeddings ([Su et al., 2021](https://arxiv.org/abs/2104.09864))
182
+ * **Bias**: LayerNorm bias terms only
183
+
184
+ ## Training
185
+
186
+ `StableCode-Completion-Alpha-3B-4k` is pre-trained at a context length of 4096 for 300 billion tokens on the `bigcode/starcoder-data`.
187
+
188
+ ### Training Dataset
189
+
190
+ The first pre-training stage relies on 300B tokens sourced from various top programming languages occuring in the stackoverflow developer survey present in the `starcoder-data` dataset.
191
+
192
+ ### Training Procedure
193
+
194
+ The model is pre-trained on the dataset mixes mentioned above in mixed-precision BF16), optimized with AdamW, and trained using the [StarCoder](https://huggingface.co/bigcode/starcoder) tokenizer with a vocabulary size of 49k.
195
+
196
+ * **Software**: We use a fork of gpt-neox ([EleutherAI, 2021](https://github.com/EleutherAI/gpt-neox)) and train under 2D parallelism (Data and Tensor Parallel) with ZeRO-1 ([Rajbhandari et al., 2019](https://arxiv.org/abs/1910.02054v3)) and rely on flash-attention as well as rotary embedding kernels from FlashAttention-2 ([Dao et al., 2023](https://tridao.me/publications/flash2/flash2.pdf))
197
+
198
+ ## Use and Limitations
199
+
200
+ ### Intended Use
201
+
202
+ StableCode-Completion-Alpha-3B-4K independently generates new code completions, but we recommend that you use StableCode-Completion-Alpha-3B-4K together with the tool developed by BigCode and HuggingFace [(huggingface/huggingface-vscode: Code completion VSCode extension for OSS models (github.com))](https://github.com/huggingface/huggingface-vscode), to identify and, if necessary, attribute any outputs that match training code.
203
+
204
+ ### Limitations and bias
205
+
206
+ This model is intended to be used responsibly. It is not intended to be used to create unlawful content of any kind, to further any unlawful activity, or to engage in activities with a high risk of physical or economic harm.
207
+
208
+ ## How to cite
209
+
210
+ ```bibtex
211
+ @misc{StableCodeCompleteAlpha4K,
212
+ url={[https://huggingface.co/stabilityai/stablecode-complete-alpha-3b-4k](https://huggingface.co/stabilityai/stablecode-complete-alpha-3b-4k)},
213
+ title={Stable Code Complete Alpha},
214
+ author={Adithyan, Reshinth and Phung, Duy and Cooper, Nathan and Pinnaparaju, Nikhil and Laforte, Christian}
215
+ }
216
+ ```