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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
license: bigcode-openrail-m
|
9 |
+
datasets:
|
10 |
+
- bigcode/the-stack-dedup
|
11 |
+
metrics:
|
12 |
+
- code_eval
|
13 |
+
library_name: transformers
|
14 |
+
tags:
|
15 |
+
- code
|
16 |
+
model-index:
|
17 |
+
- name: StarCoder
|
18 |
+
results:
|
19 |
+
- task:
|
20 |
+
type: text-generation
|
21 |
+
dataset:
|
22 |
+
type: openai_humaneval
|
23 |
+
name: HumanEval (Prompted)
|
24 |
+
metrics:
|
25 |
+
- name: pass@1
|
26 |
+
type: pass@1
|
27 |
+
value: 0.408
|
28 |
+
verified: false
|
29 |
+
- task:
|
30 |
+
type: text-generation
|
31 |
+
dataset:
|
32 |
+
type: openai_humaneval
|
33 |
+
name: HumanEval
|
34 |
+
metrics:
|
35 |
+
- name: pass@1
|
36 |
+
type: pass@1
|
37 |
+
value: 0.336
|
38 |
+
verified: false
|
39 |
+
- task:
|
40 |
+
type: text-generation
|
41 |
+
dataset:
|
42 |
+
type: mbpp
|
43 |
+
name: MBPP
|
44 |
+
metrics:
|
45 |
+
- name: pass@1
|
46 |
+
type: pass@1
|
47 |
+
value: 0.527
|
48 |
+
verified: false
|
49 |
+
- task:
|
50 |
+
type: text-generation
|
51 |
+
dataset:
|
52 |
+
type: ds1000
|
53 |
+
name: DS-1000 (Overall Completion)
|
54 |
+
metrics:
|
55 |
+
- name: pass@1
|
56 |
+
type: pass@1
|
57 |
+
value: 0.26
|
58 |
+
verified: false
|
59 |
+
- task:
|
60 |
+
type: text-generation
|
61 |
+
dataset:
|
62 |
+
type: nuprl/MultiPL-E
|
63 |
+
name: MultiPL-HumanEval (C++)
|
64 |
+
metrics:
|
65 |
+
- name: pass@1
|
66 |
+
type: pass@1
|
67 |
+
value: 0.3155
|
68 |
+
verified: false
|
69 |
+
- task:
|
70 |
+
type: text-generation
|
71 |
+
dataset:
|
72 |
+
type: nuprl/MultiPL-E
|
73 |
+
name: MultiPL-HumanEval (C#)
|
74 |
+
metrics:
|
75 |
+
- name: pass@1
|
76 |
+
type: pass@1
|
77 |
+
value: 0.2101
|
78 |
+
verified: false
|
79 |
+
- task:
|
80 |
+
type: text-generation
|
81 |
+
dataset:
|
82 |
+
type: nuprl/MultiPL-E
|
83 |
+
name: MultiPL-HumanEval (D)
|
84 |
+
metrics:
|
85 |
+
- name: pass@1
|
86 |
+
type: pass@1
|
87 |
+
value: 0.1357
|
88 |
+
verified: false
|
89 |
+
- task:
|
90 |
+
type: text-generation
|
91 |
+
dataset:
|
92 |
+
type: nuprl/MultiPL-E
|
93 |
+
name: MultiPL-HumanEval (Go)
|
94 |
+
metrics:
|
95 |
+
- name: pass@1
|
96 |
+
type: pass@1
|
97 |
+
value: 0.1761
|
98 |
+
verified: false
|
99 |
+
- task:
|
100 |
+
type: text-generation
|
101 |
+
dataset:
|
102 |
+
type: nuprl/MultiPL-E
|
103 |
+
name: MultiPL-HumanEval (Java)
|
104 |
+
metrics:
|
105 |
+
- name: pass@1
|
106 |
+
type: pass@1
|
107 |
+
value: 0.3022
|
108 |
+
verified: false
|
109 |
+
- task:
|
110 |
+
type: text-generation
|
111 |
+
dataset:
|
112 |
+
type: nuprl/MultiPL-E
|
113 |
+
name: MultiPL-HumanEval (Julia)
|
114 |
+
metrics:
|
115 |
+
- name: pass@1
|
116 |
+
type: pass@1
|
117 |
+
value: 0.2302
|
118 |
+
verified: false
|
119 |
+
- task:
|
120 |
+
type: text-generation
|
121 |
+
dataset:
|
122 |
+
type: nuprl/MultiPL-E
|
123 |
+
name: MultiPL-HumanEval (JavaScript)
|
124 |
+
metrics:
|
125 |
+
- name: pass@1
|
126 |
+
type: pass@1
|
127 |
+
value: 0.3079
|
128 |
+
verified: false
|
129 |
+
- task:
|
130 |
+
type: text-generation
|
131 |
+
dataset:
|
132 |
+
type: nuprl/MultiPL-E
|
133 |
+
name: MultiPL-HumanEval (Lua)
|
134 |
+
metrics:
|
135 |
+
- name: pass@1
|
136 |
+
type: pass@1
|
137 |
+
value: 0.2389
|
138 |
+
verified: false
|
139 |
+
- task:
|
140 |
+
type: text-generation
|
141 |
+
dataset:
|
142 |
+
type: nuprl/MultiPL-E
|
143 |
+
name: MultiPL-HumanEval (PHP)
|
144 |
+
metrics:
|
145 |
+
- name: pass@1
|
146 |
+
type: pass@1
|
147 |
+
value: 0.2608
|
148 |
+
verified: false
|
149 |
+
- task:
|
150 |
+
type: text-generation
|
151 |
+
dataset:
|
152 |
+
type: nuprl/MultiPL-E
|
153 |
+
name: MultiPL-HumanEval (Perl)
|
154 |
+
metrics:
|
155 |
+
- name: pass@1
|
156 |
+
type: pass@1
|
157 |
+
value: 0.1734
|
158 |
+
verified: false
|
159 |
+
- task:
|
160 |
+
type: text-generation
|
161 |
+
dataset:
|
162 |
+
type: nuprl/MultiPL-E
|
163 |
+
name: MultiPL-HumanEval (Python)
|
164 |
+
metrics:
|
165 |
+
- name: pass@1
|
166 |
+
type: pass@1
|
167 |
+
value: 0.3357
|
168 |
+
verified: false
|
169 |
+
- task:
|
170 |
+
type: text-generation
|
171 |
+
dataset:
|
172 |
+
type: nuprl/MultiPL-E
|
173 |
+
name: MultiPL-HumanEval (R)
|
174 |
+
metrics:
|
175 |
+
- name: pass@1
|
176 |
+
type: pass@1
|
177 |
+
value: 0.155
|
178 |
+
verified: false
|
179 |
+
- task:
|
180 |
+
type: text-generation
|
181 |
+
dataset:
|
182 |
+
type: nuprl/MultiPL-E
|
183 |
+
name: MultiPL-HumanEval (Ruby)
|
184 |
+
metrics:
|
185 |
+
- name: pass@1
|
186 |
+
type: pass@1
|
187 |
+
value: 0.0124
|
188 |
+
verified: false
|
189 |
+
- task:
|
190 |
+
type: text-generation
|
191 |
+
dataset:
|
192 |
+
type: nuprl/MultiPL-E
|
193 |
+
name: MultiPL-HumanEval (Racket)
|
194 |
+
metrics:
|
195 |
+
- name: pass@1
|
196 |
+
type: pass@1
|
197 |
+
value: 0.0007
|
198 |
+
verified: false
|
199 |
+
- task:
|
200 |
+
type: text-generation
|
201 |
+
dataset:
|
202 |
+
type: nuprl/MultiPL-E
|
203 |
+
name: MultiPL-HumanEval (Rust)
|
204 |
+
metrics:
|
205 |
+
- name: pass@1
|
206 |
+
type: pass@1
|
207 |
+
value: 0.2184
|
208 |
+
verified: false
|
209 |
+
- task:
|
210 |
+
type: text-generation
|
211 |
+
dataset:
|
212 |
+
type: nuprl/MultiPL-E
|
213 |
+
name: MultiPL-HumanEval (Scala)
|
214 |
+
metrics:
|
215 |
+
- name: pass@1
|
216 |
+
type: pass@1
|
217 |
+
value: 0.2761
|
218 |
+
verified: false
|
219 |
+
- task:
|
220 |
+
type: text-generation
|
221 |
+
dataset:
|
222 |
+
type: nuprl/MultiPL-E
|
223 |
+
name: MultiPL-HumanEval (Bash)
|
224 |
+
metrics:
|
225 |
+
- name: pass@1
|
226 |
+
type: pass@1
|
227 |
+
value: 0.1046
|
228 |
+
verified: false
|
229 |
+
- task:
|
230 |
+
type: text-generation
|
231 |
+
dataset:
|
232 |
+
type: nuprl/MultiPL-E
|
233 |
+
name: MultiPL-HumanEval (Swift)
|
234 |
+
metrics:
|
235 |
+
- name: pass@1
|
236 |
+
type: pass@1
|
237 |
+
value: 0.2274
|
238 |
+
verified: false
|
239 |
+
- task:
|
240 |
+
type: text-generation
|
241 |
+
dataset:
|
242 |
+
type: nuprl/MultiPL-E
|
243 |
+
name: MultiPL-HumanEval (TypeScript)
|
244 |
+
metrics:
|
245 |
+
- name: pass@1
|
246 |
+
type: pass@1
|
247 |
+
value: 0.3229
|
248 |
+
verified: false
|
249 |
+
extra_gated_prompt: >-
|
250 |
+
## Model License Agreement
|
251 |
+
|
252 |
+
Please read the BigCode [OpenRAIL-M
|
253 |
+
license](https://huggingface.co/spaces/bigcode/bigcode-model-license-agreement)
|
254 |
+
agreement before accepting it.
|
255 |
+
|
256 |
+
extra_gated_fields:
|
257 |
+
I accept the above license agreement, and will use the Model complying with the set of use restrictions and sharing requirements: checkbox
|
258 |
---
|
259 |
+
|
260 |
+
# starcoder-GGML
|
261 |
+
|
262 |
+
This is GGML format quantised 4bit, 5bit and 8bit models of [StarCoder](https://huggingface.co/bigcode/starcoder).
|
263 |
+
This repo is the result of quantising to 4bit, 5bit and 8bit GGML for CPU inference using [ggml](https://github.com/ggerganov/ggml/tree/master/examples/starcoder).
|
264 |
+
|
265 |
+
# Original model card
|
266 |
+
|
267 |
+
![banner](https://huggingface.co/datasets/bigcode/admin/resolve/main/StarCoderBanner.png)
|
268 |
+
|
269 |
+
Play with the model on the [StarCoder Playground](https://huggingface.co/spaces/bigcode/bigcode-playground).
|
270 |
+
|
271 |
+
## Table of Contents
|
272 |
+
|
273 |
+
1. [Model Summary](##model-summary)
|
274 |
+
2. [Use](##use)
|
275 |
+
3. [Limitations](##limitations)
|
276 |
+
4. [Training](##training)
|
277 |
+
5. [License](##license)
|
278 |
+
6. [Citation](##citation)
|
279 |
+
|
280 |
+
## Model Summary
|
281 |
+
|
282 |
+
The StarCoder models are 15.5B parameter models trained on 80+ programming languages from [The Stack (v1.2)](https://huggingface.co/datasets/bigcode/the-stack), with opt-out requests excluded. The model uses [Multi Query Attention](https://arxiv.org/abs/1911.02150), [a context window of 8192 tokens](https://arxiv.org/abs/2205.14135), and was trained using the [Fill-in-the-Middle objective](https://arxiv.org/abs/2207.14255) on 1 trillion tokens.
|
283 |
+
|
284 |
+
- **Repository:** [bigcode/Megatron-LM](https://github.com/bigcode-project/Megatron-LM)
|
285 |
+
- **Project Website:** [bigcode-project.org](https://www.bigcode-project.org)
|
286 |
+
- **Paper:** [💫StarCoder: May the source be with you!](https://arxiv.org/abs/2305.06161)
|
287 |
+
- **Point of Contact:** [[email protected]](mailto:[email protected])
|
288 |
+
- **Languages:** 80+ Programming languages
|
289 |
+
|
290 |
+
|
291 |
+
## Use
|
292 |
+
|
293 |
+
### Intended use
|
294 |
+
|
295 |
+
The model was trained on GitHub code. As such it is _not_ an instruction model and commands like "Write a function that computes the square root." do not work well. However, by using the [Tech Assistant prompt](https://huggingface.co/datasets/bigcode/ta-prompt) you can turn it into a capable technical assistant.
|
296 |
+
|
297 |
+
**Feel free to share your generations in the Community tab!**
|
298 |
+
|
299 |
+
### Generation
|
300 |
+
```python
|
301 |
+
# pip install -q transformers
|
302 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
303 |
+
|
304 |
+
checkpoint = "bigcode/starcoder"
|
305 |
+
device = "cuda" # for GPU usage or "cpu" for CPU usage
|
306 |
+
|
307 |
+
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
308 |
+
model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
|
309 |
+
|
310 |
+
inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device)
|
311 |
+
outputs = model.generate(inputs)
|
312 |
+
print(tokenizer.decode(outputs[0]))
|
313 |
+
```
|
314 |
+
|
315 |
+
### Fill-in-the-middle
|
316 |
+
Fill-in-the-middle uses special tokens to identify the prefix/middle/suffix part of the input and output:
|
317 |
+
|
318 |
+
```python
|
319 |
+
input_text = "<fim-prefix>def print_hello_world():\n <fim-suffix>\n print('Hello world!')<fim-middle>"
|
320 |
+
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
|
321 |
+
outputs = model.generate(inputs)
|
322 |
+
print(tokenizer.decode(outputs[0]))
|
323 |
+
```
|
324 |
+
|
325 |
+
### Attribution & Other Requirements
|
326 |
+
|
327 |
+
The pretraining dataset of the model was filtered for permissive licenses 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/starcoder-search) that let's you search through the pretraining data to identify where generated code came from and apply the proper attribution to your code.
|
328 |
+
|
329 |
+
# Limitations
|
330 |
+
|
331 |
+
The model has been trained on source code from 80+ programming languages. The predominant natural language in source code is English although other languages are also present. As such the model is capable of generating 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://drive.google.com/file/d/1cN-b9GnWtHzQRoE7M7gAEyivY0kl4BYs/view) for an in-depth discussion of the model limitations.
|
332 |
+
|
333 |
+
# Training
|
334 |
+
|
335 |
+
## Model
|
336 |
+
|
337 |
+
- **Architecture:** GPT-2 model with multi-query attention and Fill-in-the-Middle objective
|
338 |
+
- **Pretraining steps:** 250k
|
339 |
+
- **Pretraining tokens:** 1 trillion
|
340 |
+
- **Precision:** bfloat16
|
341 |
+
|
342 |
+
## Hardware
|
343 |
+
|
344 |
+
- **GPUs:** 512 Tesla A100
|
345 |
+
- **Training time:** 24 days
|
346 |
+
|
347 |
+
## Software
|
348 |
+
|
349 |
+
- **Orchestration:** [Megatron-LM](https://github.com/bigcode-project/Megatron-LM)
|
350 |
+
- **Neural networks:** [PyTorch](https://github.com/pytorch/pytorch)
|
351 |
+
- **BP16 if applicable:** [apex](https://github.com/NVIDIA/apex)
|
352 |
+
|
353 |
+
# License
|
354 |
+
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).
|
355 |
+
# Citation
|
356 |
+
```
|
357 |
+
@article{li2023starcoder,
|
358 |
+
title={StarCoder: may the source be with you!},
|
359 |
+
author={Raymond Li and Loubna Ben Allal and Yangtian Zi and Niklas Muennighoff and Denis Kocetkov and Chenghao Mou and Marc Marone and Christopher Akiki and Jia Li and Jenny Chim and Qian Liu and Evgenii Zheltonozhskii and Terry Yue Zhuo and Thomas Wang and Olivier Dehaene and Mishig Davaadorj and Joel Lamy-Poirier and João Monteiro and Oleh Shliazhko and Nicolas Gontier and Nicholas Meade and Armel Zebaze and Ming-Ho Yee and Logesh Kumar Umapathi and Jian Zhu and Benjamin Lipkin and Muhtasham Oblokulov and Zhiruo Wang and Rudra Murthy and Jason Stillerman and Siva Sankalp Patel and Dmitry Abulkhanov and Marco Zocca and Manan Dey and Zhihan Zhang and Nour Fahmy and Urvashi Bhattacharyya and Wenhao Yu and Swayam Singh and Sasha Luccioni and Paulo Villegas and Maxim Kunakov and Fedor Zhdanov and Manuel Romero and Tony Lee and Nadav Timor and Jennifer Ding and Claire Schlesinger and Hailey Schoelkopf and Jan Ebert and Tri Dao and Mayank Mishra and Alex Gu and Jennifer Robinson and Carolyn Jane Anderson and Brendan Dolan-Gavitt and Danish Contractor and Siva Reddy and Daniel Fried and Dzmitry Bahdanau and Yacine Jernite and Carlos Muñoz Ferrandis and Sean Hughes and Thomas Wolf and Arjun Guha and Leandro von Werra and Harm de Vries},
|
360 |
+
year={2023},
|
361 |
+
eprint={2305.06161},
|
362 |
+
archivePrefix={arXiv},
|
363 |
+
primaryClass={cs.CL}
|
364 |
+
}
|
365 |
+
```
|