RichardErkhov commited on
Commit
e1c8165
1 Parent(s): 342579f

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +258 -0
README.md ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ starcoder2-15b - GGUF
11
+ - Model creator: https://huggingface.co/bigcode/
12
+ - Original model: https://huggingface.co/bigcode/starcoder2-15b/
13
+
14
+
15
+ | Name | Quant method | Size |
16
+ | ---- | ---- | ---- |
17
+ | [starcoder2-15b.Q2_K.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.Q2_K.gguf) | Q2_K | 5.77GB |
18
+ | [starcoder2-15b.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.IQ3_XS.gguf) | IQ3_XS | 6.25GB |
19
+ | [starcoder2-15b.IQ3_S.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.IQ3_S.gguf) | IQ3_S | 6.52GB |
20
+ | [starcoder2-15b.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.Q3_K_S.gguf) | Q3_K_S | 6.51GB |
21
+ | [starcoder2-15b.IQ3_M.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.IQ3_M.gguf) | IQ3_M | 6.8GB |
22
+ | [starcoder2-15b.Q3_K.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.Q3_K.gguf) | Q3_K | 7.49GB |
23
+ | [starcoder2-15b.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.Q3_K_M.gguf) | Q3_K_M | 7.49GB |
24
+ | [starcoder2-15b.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.Q3_K_L.gguf) | Q3_K_L | 8.35GB |
25
+ | [starcoder2-15b.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.IQ4_XS.gguf) | IQ4_XS | 8.12GB |
26
+ | [starcoder2-15b.Q4_0.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.Q4_0.gguf) | Q4_0 | 8.44GB |
27
+ | [starcoder2-15b.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.IQ4_NL.gguf) | IQ4_NL | 8.55GB |
28
+ | [starcoder2-15b.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.Q4_K_S.gguf) | Q4_K_S | 8.53GB |
29
+ | [starcoder2-15b.Q4_K.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.Q4_K.gguf) | Q4_K | 9.18GB |
30
+ | [starcoder2-15b.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.Q4_K_M.gguf) | Q4_K_M | 9.18GB |
31
+ | [starcoder2-15b.Q4_1.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.Q4_1.gguf) | Q4_1 | 9.35GB |
32
+ | [starcoder2-15b.Q5_0.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.Q5_0.gguf) | Q5_0 | 10.27GB |
33
+ | [starcoder2-15b.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.Q5_K_S.gguf) | Q5_K_S | 10.27GB |
34
+ | [starcoder2-15b.Q5_K.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.Q5_K.gguf) | Q5_K | 10.65GB |
35
+ | [starcoder2-15b.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.Q5_K_M.gguf) | Q5_K_M | 10.65GB |
36
+ | [starcoder2-15b.Q5_1.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.Q5_1.gguf) | Q5_1 | 11.18GB |
37
+ | [starcoder2-15b.Q6_K.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-gguf/blob/main/starcoder2-15b.Q6_K.gguf) | Q6_K | 12.2GB |
38
+
39
+
40
+
41
+
42
+ Original model description:
43
+ ---
44
+ pipeline_tag: text-generation
45
+ inference:
46
+ parameters:
47
+ temperature: 0.2
48
+ top_p: 0.95
49
+ widget:
50
+ - text: 'def print_hello_world():'
51
+ example_title: Hello world
52
+ group: Python
53
+ datasets:
54
+ - bigcode/the-stack-v2-train
55
+ license: bigcode-openrail-m
56
+ library_name: transformers
57
+ tags:
58
+ - code
59
+ model-index:
60
+ - name: starcoder2-15b
61
+ results:
62
+ - task:
63
+ type: text-generation
64
+ dataset:
65
+ name: CruxEval-I
66
+ type: cruxeval-i
67
+ metrics:
68
+ - type: pass@1
69
+ value: 48.1
70
+ - task:
71
+ type: text-generation
72
+ dataset:
73
+ name: DS-1000
74
+ type: ds-1000
75
+ metrics:
76
+ - type: pass@1
77
+ value: 33.8
78
+ - task:
79
+ type: text-generation
80
+ dataset:
81
+ name: GSM8K (PAL)
82
+ type: gsm8k-pal
83
+ metrics:
84
+ - type: accuracy
85
+ value: 65.1
86
+ - task:
87
+ type: text-generation
88
+ dataset:
89
+ name: HumanEval+
90
+ type: humanevalplus
91
+ metrics:
92
+ - type: pass@1
93
+ value: 37.8
94
+ - task:
95
+ type: text-generation
96
+ dataset:
97
+ name: HumanEval
98
+ type: humaneval
99
+ metrics:
100
+ - type: pass@1
101
+ value: 46.3
102
+ - task:
103
+ type: text-generation
104
+ dataset:
105
+ name: RepoBench-v1.1
106
+ type: repobench-v1.1
107
+ metrics:
108
+ - type: edit-smiliarity
109
+ value: 74.08
110
+ ---
111
+
112
+ # StarCoder2
113
+
114
+ <center>
115
+ <img src="https://huggingface.co/datasets/bigcode/admin_private/resolve/main/starcoder2_banner.png" alt="SC2" width="900" height="600">
116
+ </center>
117
+
118
+ ## Table of Contents
119
+
120
+ 1. [Model Summary](#model-summary)
121
+ 2. [Use](#use)
122
+ 3. [Limitations](#limitations)
123
+ 4. [Training](#training)
124
+ 5. [License](#license)
125
+ 6. [Citation](#citation)
126
+
127
+ ## Model Summary
128
+
129
+ 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.
130
+ 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.
131
+
132
+ - **Project Website:** [bigcode-project.org](https://www.bigcode-project.org)
133
+ - **Paper:** [Link](https://huggingface.co/papers/2402.19173)
134
+ - **Point of Contact:** [contact@bigcode-project.org](mailto:contact@bigcode-project.org)
135
+ - **Languages:** 600+ Programming languages
136
+
137
+ ## Use
138
+
139
+ ### Intended use
140
+
141
+ 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.
142
+
143
+ ### Generation
144
+ 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).
145
+
146
+ First, make sure to install `transformers` from source:
147
+ ```bash
148
+ pip install git+https://github.com/huggingface/transformers.git
149
+ ```
150
+
151
+ #### Running the model on CPU/GPU/multi GPU
152
+ * _Using full precision_
153
+ ```python
154
+ # pip install git+https://github.com/huggingface/transformers.git # TODO: merge PR to main
155
+ from transformers import AutoModelForCausalLM, AutoTokenizer
156
+
157
+ checkpoint = "bigcode/starcoder2-15b"
158
+ device = "cuda" # for GPU usage or "cpu" for CPU usage
159
+
160
+ tokenizer = AutoTokenizer.from_pretrained(checkpoint)
161
+ # for multiple GPUs install accelerate and do `model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto")`
162
+ model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
163
+
164
+ inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device)
165
+ outputs = model.generate(inputs)
166
+ print(tokenizer.decode(outputs[0]))
167
+ ```
168
+
169
+ * _Using `torch.bfloat16`_
170
+ ```python
171
+ # pip install accelerate
172
+ import torch
173
+ from transformers import AutoTokenizer, AutoModelForCausalLM
174
+
175
+ checkpoint = "bigcode/starcoder2-15b"
176
+ tokenizer = AutoTokenizer.from_pretrained(checkpoint)
177
+
178
+ # for fp16 use `torch_dtype=torch.float16` instead
179
+ model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto", torch_dtype=torch.bfloat16)
180
+
181
+ inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to("cuda")
182
+ outputs = model.generate(inputs)
183
+ print(tokenizer.decode(outputs[0]))
184
+ ```
185
+ ```bash
186
+ >>> print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
187
+ Memory footprint: 32251.33 MB
188
+ ```
189
+
190
+ #### Quantized Versions through `bitsandbytes`
191
+ * _Using 8-bit precision (int8)_
192
+
193
+ ```python
194
+ # pip install bitsandbytes accelerate
195
+ from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
196
+
197
+ # to use 4bit use `load_in_4bit=True` instead
198
+ quantization_config = BitsAndBytesConfig(load_in_8bit=True)
199
+
200
+ checkpoint = "bigcode/starcoder2-15b"
201
+ tokenizer = AutoTokenizer.from_pretrained(checkpoint)
202
+ model = AutoModelForCausalLM.from_pretrained(checkpoint, quantization_config=quantization_config)
203
+
204
+ inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to("cuda")
205
+ outputs = model.generate(inputs)
206
+ print(tokenizer.decode(outputs[0]))
207
+ ```
208
+ ```bash
209
+ >>> print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
210
+ # load_in_8bit
211
+ Memory footprint: 16900.18 MB
212
+ # load_in_4bit
213
+ >>> print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
214
+ Memory footprint: 9224.60 MB
215
+ ```
216
+ ### Attribution & Other Requirements
217
+
218
+ 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.
219
+
220
+ # Limitations
221
+
222
+ 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.
223
+
224
+ # Training
225
+
226
+ ## Model
227
+
228
+ - **Architecture:** Transformer decoder with grouped-query and sliding window attention and Fill-in-the-Middle objective
229
+ - **Pretraining steps:** 1 million
230
+ - **Pretraining tokens:** 4+ trillion
231
+ - **Precision:** bfloat16
232
+
233
+ ## Hardware
234
+
235
+ - **GPUs:** 1024 x H100
236
+
237
+ ## Software
238
+
239
+ - **Framework:** [NeMo Framework](https://www.nvidia.com/en-us/ai-data-science/generative-ai/nemo-framework/)
240
+ - **Neural networks:** [PyTorch](https://github.com/pytorch/pytorch)
241
+
242
+ # License
243
+
244
+ 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).
245
+
246
+ # Citation
247
+
248
+ ```bash
249
+ @misc{lozhkov2024starcoder,
250
+ title={StarCoder 2 and The Stack v2: The Next Generation},
251
+ 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},
252
+ year={2024},
253
+ eprint={2402.19173},
254
+ archivePrefix={arXiv},
255
+ primaryClass={cs.SE}
256
+ }
257
+ ```
258
+