nold commited on
Commit
9c2bf04
1 Parent(s): e923174

Upload folder using huggingface_hub (#1)

Browse files

- 737ed73e668a45074793066c0f33a4f721b5e6ffce7adb5bbf5b33991bfaf7d3 (fe4bbc2cc6f923cbb4734ea3e4958b14d828db97)
- 77126f242b4b8abcebaa2b58a3b184b0df90b8780c8ea3b5041aa6bdb9d53d8f (59c6ac36b457dcf235bc9f40854e0b3a79125e18)
- beda355110530ef17efa52421a8b3a26218ebac3d0d12c875b962e1abaa36b78 (1fd2bd20a4687c9cada24f36ff704bf56d8881af)
- b8b5b6974a1ce55c5844c925e5e4a3e5de9a97f8e695336862e66b673e85e813 (efd1fc9bfc6ff18eef847a3ffc191b15d02a1333)
- 77cb08df6ddf89a06d2c4dcef9088937ce36f9c582d96b1cf88369a908ef4331 (56093e673cc345f05140bf14978ac1c03634d59c)
- e4c0bb70d37a361b919b8438da08c6e9dc13b7b8576d567e034aa79ea44131ae (138fdec1e3c9cd8ed2e979dd504aa38754fe22d6)

.gitattributes CHANGED
@@ -33,3 +33,8 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ starcoder2-15b_Q3_K_M.gguf filter=lfs diff=lfs merge=lfs -text
37
+ starcoder2-15b_Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
38
+ starcoder2-15b_Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
39
+ starcoder2-15b_Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
40
+ starcoder2-15b_Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pipeline_tag: text-generation
3
+ inference: true
4
+ widget:
5
+ - text: 'def print_hello_world():'
6
+ example_title: Hello world
7
+ group: Python
8
+ datasets:
9
+ - bigcode/the-stack-v2-train
10
+ license: bigcode-openrail-m
11
+ library_name: transformers
12
+ tags:
13
+ - code
14
+ model-index:
15
+ - name: starcoder2-15b
16
+ results:
17
+ - task:
18
+ type: text-generation
19
+ dataset:
20
+ name: CruxEval-I
21
+ type: cruxeval-i
22
+ metrics:
23
+ - type: pass@1
24
+ value: 48.1
25
+ - task:
26
+ type: text-generation
27
+ dataset:
28
+ name: DS-1000
29
+ type: ds-1000
30
+ metrics:
31
+ - type: pass@1
32
+ value: 33.8
33
+ - task:
34
+ type: text-generation
35
+ dataset:
36
+ name: GSM8K (PAL)
37
+ type: gsm8k-pal
38
+ metrics:
39
+ - type: accuracy
40
+ value: 65.1
41
+ - task:
42
+ type: text-generation
43
+ dataset:
44
+ name: HumanEval+
45
+ type: humanevalplus
46
+ metrics:
47
+ - type: pass@1
48
+ value: 37.8
49
+ - task:
50
+ type: text-generation
51
+ dataset:
52
+ name: HumanEval
53
+ type: humaneval
54
+ metrics:
55
+ - type: pass@1
56
+ value: 46.3
57
+ - task:
58
+ type: text-generation
59
+ dataset:
60
+ name: RepoBench-v1.1
61
+ type: repobench-v1.1
62
+ metrics:
63
+ - type: edit-smiliarity
64
+ value: 74.08
65
+ ---
66
+
67
+ # StarCoder2
68
+
69
+ <center>
70
+ <img src="https://huggingface.co/datasets/bigcode/admin_private/resolve/main/starcoder2_banner.png" alt="SC2" width="900" height="600">
71
+ </center>
72
+
73
+ ## Table of Contents
74
+
75
+ 1. [Model Summary](#model-summary)
76
+ 2. [Use](#use)
77
+ 3. [Limitations](#limitations)
78
+ 4. [Training](#training)
79
+ 5. [License](#license)
80
+ 6. [Citation](#citation)
81
+
82
+ ## Model Summary
83
+
84
+ StarCoder2-15B model is a 15B parameter model trained on 600+ programming languages from [The Stack v2](https://huggingface.co/datasets/bigcode/the-stack-v2-train), with opt-out requests excluded. The model uses [Grouped Query Attention](https://arxiv.org/abs/2305.13245), [a context window of 16,384 tokens](https://arxiv.org/abs/2205.14135) with [a sliding window attention of 4,096 tokens](https://arxiv.org/abs/2004.05150v2), and was trained using the [Fill-in-the-Middle objective](https://arxiv.org/abs/2207.14255) on 4+ trillion tokens.
85
+ The model was trained with [NVIDIA NeMo™ Framework](https://www.nvidia.com/en-us/ai-data-science/generative-ai/nemo-framework/) using the [NVIDIA Eos Supercomputer](https://blogs.nvidia.com/blog/eos/) built with [NVIDIA DGX H100](https://www.nvidia.com/en-us/data-center/dgx-h100/) systems.
86
+
87
+ - **Project Website:** [bigcode-project.org](https://www.bigcode-project.org)
88
+ - **Paper:** [Link](https://huggingface.co/papers/2402.19173)
89
+ - **Point of Contact:** [contact@bigcode-project.org](mailto:contact@bigcode-project.org)
90
+ - **Languages:** 600+ Programming languages
91
+
92
+ ## Use
93
+
94
+ ### Intended use
95
+
96
+ The model was trained on GitHub code as well as additional selected data sources such as Arxiv and Wikipedia. As such it is _not_ an instruction model and commands like "Write a function that computes the square root." do not work well.
97
+
98
+ ### Generation
99
+ Here are some examples to get started with the model. You can find a script for fine-tuning in StarCoder2's [GitHub repository](https://github.com/bigcode-project/starcoder2).
100
+
101
+ First, make sure to install `transformers` from source:
102
+ ```bash
103
+ pip install git+https://github.com/huggingface/transformers.git
104
+ ```
105
+
106
+ #### Running the model on CPU/GPU/multi GPU
107
+ * _Using full precision_
108
+ ```python
109
+ # pip install git+https://github.com/huggingface/transformers.git # TODO: merge PR to main
110
+ from transformers import AutoModelForCausalLM, AutoTokenizer
111
+
112
+ checkpoint = "bigcode/starcoder2-15b"
113
+ device = "cuda" # for GPU usage or "cpu" for CPU usage
114
+
115
+ tokenizer = AutoTokenizer.from_pretrained(checkpoint)
116
+ # for multiple GPUs install accelerate and do `model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto")`
117
+ model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
118
+
119
+ inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device)
120
+ outputs = model.generate(inputs)
121
+ print(tokenizer.decode(outputs[0]))
122
+ ```
123
+
124
+ * _Using `torch.bfloat16`_
125
+ ```python
126
+ # pip install accelerate
127
+ import torch
128
+ from transformers import AutoTokenizer, AutoModelForCausalLM
129
+
130
+ checkpoint = "bigcode/starcoder2-15b"
131
+ tokenizer = AutoTokenizer.from_pretrained(checkpoint)
132
+
133
+ # for fp16 use `torch_dtype=torch.float16` instead
134
+ model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto", torch_dtype=torch.bfloat16)
135
+
136
+ inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to("cuda")
137
+ outputs = model.generate(inputs)
138
+ print(tokenizer.decode(outputs[0]))
139
+ ```
140
+ ```bash
141
+ >>> print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
142
+ Memory footprint: 32251.33 MB
143
+ ```
144
+
145
+ #### Quantized Versions through `bitsandbytes`
146
+ * _Using 8-bit precision (int8)_
147
+
148
+ ```python
149
+ # pip install bitsandbytes accelerate
150
+ from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
151
+
152
+ # to use 4bit use `load_in_4bit=True` instead
153
+ quantization_config = BitsAndBytesConfig(load_in_8bit=True)
154
+
155
+ checkpoint = "bigcode/starcoder2-15b"
156
+ tokenizer = AutoTokenizer.from_pretrained(checkpoint)
157
+ model = AutoModelForCausalLM.from_pretrained(checkpoint, quantization_config=quantization_config)
158
+
159
+ inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to("cuda")
160
+ outputs = model.generate(inputs)
161
+ print(tokenizer.decode(outputs[0]))
162
+ ```
163
+ ```bash
164
+ >>> print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
165
+ # load_in_8bit
166
+ Memory footprint: 16900.18 MB
167
+ # load_in_4bit
168
+ >>> print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
169
+ Memory footprint: 9224.60 MB
170
+ ```
171
+ ### Attribution & Other Requirements
172
+
173
+ The pretraining dataset of the model was filtered for permissive licenses and code with no license only. Nevertheless, the model can generate source code verbatim from the dataset. The code's license might require attribution and/or other specific requirements that must be respected. We provide a [search index](https://huggingface.co/spaces/bigcode/search-v2) that let's you search through the pretraining data to identify where generated code came from and apply the proper attribution to your code.
174
+
175
+ # Limitations
176
+
177
+ The model has been trained on source code from 600+ programming languages. The predominant language in source is English although other languages are also present. As such the model is capable to generate code snippets provided some context but the generated code is not guaranteed to work as intended. It can be inefficient, contain bugs or exploits. See [the paper](https://huggingface.co/papers/2402.19173) for an in-depth discussion of the model limitations.
178
+
179
+ # Training
180
+
181
+ ## Model
182
+
183
+ - **Architecture:** Transformer decoder with grouped-query and sliding window attention and Fill-in-the-Middle objective
184
+ - **Pretraining steps:** 1 million
185
+ - **Pretraining tokens:** 4+ trillion
186
+ - **Precision:** bfloat16
187
+
188
+ ## Hardware
189
+
190
+ - **GPUs:** 1024 x H100
191
+
192
+ ## Software
193
+
194
+ - **Framework:** [NeMo Framework](https://www.nvidia.com/en-us/ai-data-science/generative-ai/nemo-framework/)
195
+ - **Neural networks:** [PyTorch](https://github.com/pytorch/pytorch)
196
+
197
+ # License
198
+
199
+ The model is licensed under the BigCode OpenRAIL-M v1 license agreement. You can find the full agreement [here](https://huggingface.co/spaces/bigcode/bigcode-model-license-agreement).
200
+
201
+ # Citation
202
+
203
+ ```bash
204
+ @misc{lozhkov2024starcoder,
205
+ title={StarCoder 2 and The Stack v2: The Next Generation},
206
+ author={Anton Lozhkov and Raymond Li and Loubna Ben Allal and Federico Cassano and Joel Lamy-Poirier and Nouamane Tazi and Ao Tang and Dmytro Pykhtar and Jiawei Liu and Yuxiang Wei and Tianyang Liu and Max Tian and Denis Kocetkov and Arthur Zucker and Younes Belkada and Zijian Wang and Qian Liu and Dmitry Abulkhanov and Indraneil Paul and Zhuang Li and Wen-Ding Li and Megan Risdal and Jia Li and Jian Zhu and Terry Yue Zhuo and Evgenii Zheltonozhskii and Nii Osae Osae Dade and Wenhao Yu and Lucas Krauß and Naman Jain and Yixuan Su and Xuanli He and Manan Dey and Edoardo Abati and Yekun Chai and Niklas Muennighoff and Xiangru Tang and Muhtasham Oblokulov and Christopher Akiki and Marc Marone and Chenghao Mou and Mayank Mishra and Alex Gu and Binyuan Hui and Tri Dao and Armel Zebaze and Olivier Dehaene and Nicolas Patry and Canwen Xu and Julian McAuley and Han Hu and Torsten Scholak and Sebastien Paquet and Jennifer Robinson and Carolyn Jane Anderson and Nicolas Chapados and Mostofa Patwary and Nima Tajbakhsh and Yacine Jernite and Carlos Muñoz Ferrandis and Lingming Zhang and Sean Hughes and Thomas Wolf and Arjun Guha and Leandro von Werra and Harm de Vries},
207
+ year={2024},
208
+ eprint={2402.19173},
209
+ archivePrefix={arXiv},
210
+ primaryClass={cs.SE}
211
+ }
212
+ ```
213
+
214
+ ***
215
+
216
+ Quantization of Model [bigcode/starcoder2-15b](https://huggingface.co/bigcode/starcoder2-15b).
217
+ Created using [llm-quantizer](https://github.com/Nold360/llm-quantizer) Pipeline
starcoder2-15b_Q3_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:46850c70de6cde0add8dd1d969ec5e5ef1fa3f06a09a8cf6eb18727025619c33
3
+ size 8101037920
starcoder2-15b_Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39f5c7318e79ca074ae1f145b0032ce8afadf98e7cf2444a7550d5cc9e0f3dd4
3
+ size 9860188000
starcoder2-15b_Q5_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8eff8c468a50aed32c7f59906dc5a4009723ea9608fad54ff676a1f906e126be
3
+ size 11431479136
starcoder2-15b_Q6_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:02f0270f7305f6b2822f4b7258d8b54cc7566e24c98142460a7075a367e7dfae
3
+ size 13100975968
starcoder2-15b_Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:17eb99384c548294414993ad238f0d9865c3694911f76dc4815edd63d1706f57
3
+ size 16965109600