mort666 commited on
Commit
df8f1da
1 Parent(s): 98d635f

Initial Conversion and Commit

Browse files
README.md CHANGED
@@ -1,3 +1,113 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  license: apache-2.0
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ datasets:
3
+ - bigcode/starcoderdata
4
+ language:
5
+ - code
6
+ tags:
7
+ - causal-lm
8
+ model-index:
9
+ - name: stabilityai/stablecode-completion-alpha-3b-4k
10
+ results:
11
+ - task:
12
+ type: text-generation
13
+ dataset:
14
+ type: openai_humaneval
15
+ name: HumanEval
16
+ metrics:
17
+ - name: pass@1
18
+ type: pass@1
19
+ value: 0.1768
20
+ verified: false
21
+ - name: pass@10
22
+ type: pass@10
23
+ value: 0.2701
24
+ verified: false
25
  license: apache-2.0
26
+ duplicated_from: stabilityai/stablecode-completion-alpha-3b-4k
27
  ---
28
+ # `StableCode-Completion-Alpha-3B-4K`
29
+
30
+ ## Intro
31
+
32
+ This is converstion of the `StableCode-Completion-Alpha-3B-4K` model from StabilityAI for use with the FOSS TabbyML Development Toolset, nothing other than converstion to the CTranslate2 compatible format has been undertaken so that the model can be used by TabbyML this included the creation of the appropriate configuration for TabbyML.
33
+
34
+ ## Original Model Description
35
+
36
+ `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.
37
+
38
+ ## Usage
39
+ The model is intended to do single/multiline code completion from a long context window upto 4k tokens.
40
+ Get started generating code with `StableCode-Completion-Alpha-3B-4k` by using the following code snippet:
41
+
42
+ ```python
43
+ from transformers import AutoModelForCausalLM, AutoTokenizer
44
+ tokenizer = AutoTokenizer.from_pretrained("stabilityai/stablecode-completion-alpha-3b-4k")
45
+ model = AutoModelForCausalLM.from_pretrained(
46
+ "stabilityai/stablecode-completion-alpha-3b-4k",
47
+ trust_remote_code=True,
48
+ torch_dtype="auto",
49
+ )
50
+ model.cuda()
51
+ inputs = tokenizer("import torch\nimport torch.nn as nn", return_tensors="pt").to("cuda")
52
+ tokens = model.generate(
53
+ **inputs,
54
+ max_new_tokens=48,
55
+ temperature=0.2,
56
+ do_sample=True,
57
+ )
58
+ print(tokenizer.decode(tokens[0], skip_special_tokens=True))
59
+ ```
60
+
61
+ ## Model Details
62
+
63
+ * **Developed by**: [Stability AI](https://stability.ai/)
64
+ * **Model type**: `StableCode-Completion-Alpha-3B-4k` models are auto-regressive language models based on the transformer decoder architecture.
65
+ * **Language(s)**: Code
66
+ * **Library**: [GPT-NeoX](https://github.com/EleutherAI/gpt-neox)
67
+ * **License**: Model checkpoints are licensed under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) license.
68
+ * **Contact**: For questions and comments about the model, please email `lm@stability.ai`
69
+
70
+ ### Model Architecture
71
+
72
+ | Parameters | Hidden Size | Layers | Heads | Sequence Length |
73
+ |----------------|-------------|--------|-------|-----------------|
74
+ | 2,796,431,360 | 2560 | 32 | 32 | 4096 |
75
+
76
+
77
+ * **Decoder Layer**: Parallel Attention and MLP residuals with a single input LayerNorm ([Wang & Komatsuzaki, 2021](https://github.com/kingoflolz/mesh-transformer-jax/tree/master))
78
+ * **Position Embeddings**: Rotary Position Embeddings ([Su et al., 2021](https://arxiv.org/abs/2104.09864))
79
+ * **Bias**: LayerNorm bias terms only
80
+
81
+ ## Training
82
+
83
+ `StableCode-Completion-Alpha-3B-4k` is pre-trained at a context length of 4096 for 300 billion tokens on the `bigcode/starcoder-data`.
84
+
85
+ ### Training Dataset
86
+
87
+ 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.
88
+
89
+ ### Training Procedure
90
+
91
+ 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.
92
+
93
+ * **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))
94
+
95
+ ## Use and Limitations
96
+
97
+ ### Intended Use
98
+
99
+ 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.
100
+
101
+ ### Limitations and bias
102
+
103
+ 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.
104
+
105
+ ## How to cite
106
+
107
+ ```bibtex
108
+ @misc{StableCodeCompleteAlpha4K,
109
+ url={[https://huggingface.co/stabilityai/stablecode-complete-alpha-3b-4k](https://huggingface.co/stabilityai/stablecode-complete-alpha-3b-4k)},
110
+ title={Stable Code Complete Alpha},
111
+ author={Adithyan, Reshinth and Phung, Duy and Cooper, Nathan and Pinnaparaju, Nikhil and Laforte, Christian}
112
+ }
113
+ ```
config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "GPTNeoXForCausalLM"
4
+ ],
5
+ "bos_token_id": 0,
6
+ "classifier_dropout": 0.1,
7
+ "eos_token_id": 0,
8
+ "hidden_act": "gelu",
9
+ "hidden_size": 2560,
10
+ "initializer_range": 0.02,
11
+ "intermediate_size": 10240,
12
+ "layer_norm_eps": 1e-05,
13
+ "max_position_embeddings": 4096,
14
+ "model_type": "gpt_neox",
15
+ "num_attention_heads": 32,
16
+ "num_hidden_layers": 32,
17
+ "rotary_emb_base": 10000,
18
+ "rotary_pct": 0.25,
19
+ "tie_word_embeddings": false,
20
+ "torch_dtype": "float16",
21
+ "transformers_version": "4.30.2",
22
+ "use_cache": true,
23
+ "use_parallel_residual": true,
24
+ "vocab_size": 49152
25
+ }
ctranslate2/config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": null,
3
+ "eos_token": null,
4
+ "layer_norm_epsilon": null,
5
+ "unk_token": null
6
+ }
ctranslate2/model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:385b8144797c5577b00cc11e46bcdb9279eb4bc58af7d72b88e59c46aeb11518
3
+ size 5538504205
ctranslate2/vocabulary.json ADDED
The diff for this file is too large to render. See raw diff
 
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "eos_token_id": 0,
5
+ "transformers_version": "4.30.2"
6
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:735f6daa3494b922e0c890eef130f8efddc27480e70f80ba9593aa5a37b58c31
3
+ size 6075549856
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d35a68e0076eb4e1b6d671ba5a329a83384cf97cdd04a269ffd9e9d370a0182
3
+ size 6075650877
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {}
tabby.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "auto_model": "AutoModelForCausalLM"
3
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "clean_up_tokenization_spaces": true,
3
+ "model_max_length": 1000000000000000019884624838656,
4
+ "tokenizer_class": "PreTrainedTokenizerFast"
5
+ }