michaelfeil commited on
Commit
5aa23bb
1 Parent(s): 6460328

Upload bigcode/starcoder ctranslate fp16 weights

Browse files
README.md ADDED
@@ -0,0 +1,405 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ - ctranslate2
16
+ - int8
17
+ - float16
18
+ - code
19
+ model-index:
20
+ - name: StarCoder
21
+ results:
22
+ - task:
23
+ type: text-generation
24
+ dataset:
25
+ type: openai_humaneval
26
+ name: HumanEval (Prompted)
27
+ metrics:
28
+ - name: pass@1
29
+ type: pass@1
30
+ value: 0.408
31
+ verified: false
32
+ - task:
33
+ type: text-generation
34
+ dataset:
35
+ type: openai_humaneval
36
+ name: HumanEval
37
+ metrics:
38
+ - name: pass@1
39
+ type: pass@1
40
+ value: 0.336
41
+ verified: false
42
+ - task:
43
+ type: text-generation
44
+ dataset:
45
+ type: mbpp
46
+ name: MBPP
47
+ metrics:
48
+ - name: pass@1
49
+ type: pass@1
50
+ value: 0.527
51
+ verified: false
52
+ - task:
53
+ type: text-generation
54
+ dataset:
55
+ type: ds1000
56
+ name: DS-1000 (Overall Completion)
57
+ metrics:
58
+ - name: pass@1
59
+ type: pass@1
60
+ value: 0.26
61
+ verified: false
62
+ - task:
63
+ type: text-generation
64
+ dataset:
65
+ type: nuprl/MultiPL-E
66
+ name: MultiPL-HumanEval (C++)
67
+ metrics:
68
+ - name: pass@1
69
+ type: pass@1
70
+ value: 0.3155
71
+ verified: false
72
+ - task:
73
+ type: text-generation
74
+ dataset:
75
+ type: nuprl/MultiPL-E
76
+ name: MultiPL-HumanEval (C#)
77
+ metrics:
78
+ - name: pass@1
79
+ type: pass@1
80
+ value: 0.2101
81
+ verified: false
82
+ - task:
83
+ type: text-generation
84
+ dataset:
85
+ type: nuprl/MultiPL-E
86
+ name: MultiPL-HumanEval (D)
87
+ metrics:
88
+ - name: pass@1
89
+ type: pass@1
90
+ value: 0.1357
91
+ verified: false
92
+ - task:
93
+ type: text-generation
94
+ dataset:
95
+ type: nuprl/MultiPL-E
96
+ name: MultiPL-HumanEval (Go)
97
+ metrics:
98
+ - name: pass@1
99
+ type: pass@1
100
+ value: 0.1761
101
+ verified: false
102
+ - task:
103
+ type: text-generation
104
+ dataset:
105
+ type: nuprl/MultiPL-E
106
+ name: MultiPL-HumanEval (Java)
107
+ metrics:
108
+ - name: pass@1
109
+ type: pass@1
110
+ value: 0.3022
111
+ verified: false
112
+ - task:
113
+ type: text-generation
114
+ dataset:
115
+ type: nuprl/MultiPL-E
116
+ name: MultiPL-HumanEval (Julia)
117
+ metrics:
118
+ - name: pass@1
119
+ type: pass@1
120
+ value: 0.2302
121
+ verified: false
122
+ - task:
123
+ type: text-generation
124
+ dataset:
125
+ type: nuprl/MultiPL-E
126
+ name: MultiPL-HumanEval (JavaScript)
127
+ metrics:
128
+ - name: pass@1
129
+ type: pass@1
130
+ value: 0.3079
131
+ verified: false
132
+ - task:
133
+ type: text-generation
134
+ dataset:
135
+ type: nuprl/MultiPL-E
136
+ name: MultiPL-HumanEval (Lua)
137
+ metrics:
138
+ - name: pass@1
139
+ type: pass@1
140
+ value: 0.2389
141
+ verified: false
142
+ - task:
143
+ type: text-generation
144
+ dataset:
145
+ type: nuprl/MultiPL-E
146
+ name: MultiPL-HumanEval (PHP)
147
+ metrics:
148
+ - name: pass@1
149
+ type: pass@1
150
+ value: 0.2608
151
+ verified: false
152
+ - task:
153
+ type: text-generation
154
+ dataset:
155
+ type: nuprl/MultiPL-E
156
+ name: MultiPL-HumanEval (Perl)
157
+ metrics:
158
+ - name: pass@1
159
+ type: pass@1
160
+ value: 0.1734
161
+ verified: false
162
+ - task:
163
+ type: text-generation
164
+ dataset:
165
+ type: nuprl/MultiPL-E
166
+ name: MultiPL-HumanEval (Python)
167
+ metrics:
168
+ - name: pass@1
169
+ type: pass@1
170
+ value: 0.3357
171
+ verified: false
172
+ - task:
173
+ type: text-generation
174
+ dataset:
175
+ type: nuprl/MultiPL-E
176
+ name: MultiPL-HumanEval (R)
177
+ metrics:
178
+ - name: pass@1
179
+ type: pass@1
180
+ value: 0.155
181
+ verified: false
182
+ - task:
183
+ type: text-generation
184
+ dataset:
185
+ type: nuprl/MultiPL-E
186
+ name: MultiPL-HumanEval (Ruby)
187
+ metrics:
188
+ - name: pass@1
189
+ type: pass@1
190
+ value: 0.0124
191
+ verified: false
192
+ - task:
193
+ type: text-generation
194
+ dataset:
195
+ type: nuprl/MultiPL-E
196
+ name: MultiPL-HumanEval (Racket)
197
+ metrics:
198
+ - name: pass@1
199
+ type: pass@1
200
+ value: 0.0007
201
+ verified: false
202
+ - task:
203
+ type: text-generation
204
+ dataset:
205
+ type: nuprl/MultiPL-E
206
+ name: MultiPL-HumanEval (Rust)
207
+ metrics:
208
+ - name: pass@1
209
+ type: pass@1
210
+ value: 0.2184
211
+ verified: false
212
+ - task:
213
+ type: text-generation
214
+ dataset:
215
+ type: nuprl/MultiPL-E
216
+ name: MultiPL-HumanEval (Scala)
217
+ metrics:
218
+ - name: pass@1
219
+ type: pass@1
220
+ value: 0.2761
221
+ verified: false
222
+ - task:
223
+ type: text-generation
224
+ dataset:
225
+ type: nuprl/MultiPL-E
226
+ name: MultiPL-HumanEval (Bash)
227
+ metrics:
228
+ - name: pass@1
229
+ type: pass@1
230
+ value: 0.1046
231
+ verified: false
232
+ - task:
233
+ type: text-generation
234
+ dataset:
235
+ type: nuprl/MultiPL-E
236
+ name: MultiPL-HumanEval (Swift)
237
+ metrics:
238
+ - name: pass@1
239
+ type: pass@1
240
+ value: 0.2274
241
+ verified: false
242
+ - task:
243
+ type: text-generation
244
+ dataset:
245
+ type: nuprl/MultiPL-E
246
+ name: MultiPL-HumanEval (TypeScript)
247
+ metrics:
248
+ - name: pass@1
249
+ type: pass@1
250
+ value: 0.3229
251
+ verified: false
252
+ extra_gated_prompt: >-
253
+ ## Model License Agreement
254
+
255
+ Please read the BigCode [OpenRAIL-M
256
+ license](https://huggingface.co/spaces/bigcode/bigcode-model-license-agreement)
257
+ agreement before accepting it.
258
+
259
+ extra_gated_fields:
260
+ I accept the above license agreement, and will use the Model complying with the set of use restrictions and sharing requirements: checkbox
261
+ ---
262
+ # # Fast-Inference with Ctranslate2
263
+ Speedup inference while reducing memory by 2x-4x using int8 inference in C++ on CPU or GPU.
264
+
265
+ quantized version of [bigcode/starcoder](https://huggingface.co/bigcode/starcoder)
266
+ ```bash
267
+ pip install hf-hub-ctranslate2>=2.0.8
268
+ ```
269
+ Converted on 2023-05-23 using
270
+ ```
271
+ ct2-transformers-converter --model bigcode/starcoder --output_dir /home/michael/tmp-ct2fast-starcoder --force --copy_files merges.txt tokenizer.json README.md tokenizer_config.json generation_config.json special_tokens_map.json .gitattributes --quantization float16
272
+ ```
273
+
274
+ Checkpoint compatible to [ctranslate2>=3.13.0](https://github.com/OpenNMT/CTranslate2) and [hf-hub-ctranslate2>=2.0.6](https://github.com/michaelfeil/hf-hub-ctranslate2)
275
+ - `compute_type=int8_float16` for `device="cuda"`
276
+ - `compute_type=int8` for `device="cpu"`
277
+
278
+ ```python
279
+ from hf_hub_ctranslate2 import TranslatorCT2fromHfHub, GeneratorCT2fromHfHub
280
+ from transformers import AutoTokenizer
281
+
282
+ model_name = "michaelfeil/ct2fast-starcoder"
283
+ # use either TranslatorCT2fromHfHub or GeneratorCT2fromHfHub here, depending on model.
284
+ model = GeneratorCT2fromHfHub(
285
+ # load in int8 on CUDA
286
+ model_name_or_path=model_name,
287
+ device="cuda",
288
+ compute_type="int8_float16",
289
+ # tokenizer=AutoTokenizer.from_pretrained("bigcode/starcoder")
290
+ )
291
+ outputs = model.generate(
292
+ text=["How do you call a fast Flan-ingo?", "User: How are you doing? Bot:"],
293
+ max_length=64
294
+ )
295
+ print(outputs)
296
+ ```
297
+
298
+ # Licence and other remarks:
299
+ This is just a quantized version. Licence conditions are intended to be idential to original huggingface repo.
300
+
301
+ # Original description
302
+
303
+
304
+
305
+ # StarCoder
306
+
307
+ ![banner](https://huggingface.co/datasets/bigcode/admin/resolve/main/StarCoderBanner.png)
308
+
309
+ Play with the model on the [StarCoder Playground](https://huggingface.co/spaces/bigcode/bigcode-playground).
310
+
311
+ ## Table of Contents
312
+
313
+ 1. [Model Summary](##model-summary)
314
+ 2. [Use](##use)
315
+ 3. [Limitations](##limitations)
316
+ 4. [Training](##training)
317
+ 5. [License](##license)
318
+ 6. [Citation](##citation)
319
+
320
+ ## Model Summary
321
+
322
+ 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.
323
+
324
+ - **Repository:** [bigcode/Megatron-LM](https://github.com/bigcode-project/Megatron-LM)
325
+ - **Project Website:** [bigcode-project.org](https://www.bigcode-project.org)
326
+ - **Paper:** [💫StarCoder: May the source be with you!](https://arxiv.org/abs/2305.06161)
327
+ - **Point of Contact:** [contact@bigcode-project.org](mailto:contact@bigcode-project.org)
328
+ - **Languages:** 80+ Programming languages
329
+
330
+
331
+ ## Use
332
+
333
+ ### Intended use
334
+
335
+ 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.
336
+
337
+ **Feel free to share your generations in the Community tab!**
338
+
339
+ ### Generation
340
+ ```python
341
+ # pip install -q transformers
342
+ from transformers import AutoModelForCausalLM, AutoTokenizer
343
+
344
+ checkpoint = "bigcode/starcoder"
345
+ device = "cuda" # for GPU usage or "cpu" for CPU usage
346
+
347
+ tokenizer = AutoTokenizer.from_pretrained(checkpoint)
348
+ model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
349
+
350
+ inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device)
351
+ outputs = model.generate(inputs)
352
+ print(tokenizer.decode(outputs[0]))
353
+ ```
354
+
355
+ ### Fill-in-the-middle
356
+ Fill-in-the-middle uses special tokens to identify the prefix/middle/suffix part of the input and output:
357
+
358
+ ```python
359
+ input_text = "<fim-prefix>def print_hello_world():\n <fim-suffix>\n print('Hello world!')<fim-middle>"
360
+ inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
361
+ outputs = model.generate(inputs)
362
+ print(tokenizer.decode(outputs[0]))
363
+ ```
364
+
365
+ ### Attribution & Other Requirements
366
+
367
+ 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.
368
+
369
+ # Limitations
370
+
371
+ 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.
372
+
373
+ # Training
374
+
375
+ ## Model
376
+
377
+ - **Architecture:** GPT-2 model with multi-query attention and Fill-in-the-Middle objective
378
+ - **Pretraining steps:** 250k
379
+ - **Pretraining tokens:** 1 trillion
380
+ - **Precision:** bfloat16
381
+
382
+ ## Hardware
383
+
384
+ - **GPUs:** 512 Tesla A100
385
+ - **Training time:** 24 days
386
+
387
+ ## Software
388
+
389
+ - **Orchestration:** [Megatron-LM](https://github.com/bigcode-project/Megatron-LM)
390
+ - **Neural networks:** [PyTorch](https://github.com/pytorch/pytorch)
391
+ - **BP16 if applicable:** [apex](https://github.com/NVIDIA/apex)
392
+
393
+ # License
394
+ 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).
395
+ # Citation
396
+ ```
397
+ @article{li2023starcoder,
398
+ title={StarCoder: may the source be with you!},
399
+ 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},
400
+ year={2023},
401
+ eprint={2305.06161},
402
+ archivePrefix={arXiv},
403
+ primaryClass={cs.CL}
404
+ }
405
+ ```
config.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<|endoftext|>",
3
+ "eos_token": "<|endoftext|>",
4
+ "unk_token": "<|endoftext|>"
5
+ }
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.28.1"
6
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e10b6e28e73c9e407636e8d3988c1f60dc9b1767f8c7aaaca18693144c3dd188
3
+ size 36949870923
special_tokens_map.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|endoftext|>",
4
+ "<fim_prefix>",
5
+ "<fim_middle>",
6
+ "<fim_suffix>",
7
+ "<fim_pad>",
8
+ "<filename>",
9
+ "<gh_stars>",
10
+ "<issue_start>",
11
+ "<issue_comment>",
12
+ "<issue_closed>",
13
+ "<jupyter_start>",
14
+ "<jupyter_text>",
15
+ "<jupyter_code>",
16
+ "<jupyter_output>",
17
+ "<empty_output>",
18
+ "<commit_before>",
19
+ "<commit_msg>",
20
+ "<commit_after>",
21
+ "<reponame>"
22
+ ],
23
+ "bos_token": "<|endoftext|>",
24
+ "eos_token": "<|endoftext|>",
25
+ "unk_token": "<|endoftext|>"
26
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "additional_special_tokens": [
4
+ "<|endoftext|>",
5
+ "<fim_prefix>",
6
+ "<fim_middle>",
7
+ "<fim_suffix>",
8
+ "<fim_pad>",
9
+ "<filename>",
10
+ "<gh_stars>",
11
+ "<issue_start>",
12
+ "<issue_comment>",
13
+ "<issue_closed>",
14
+ "<jupyter_start>",
15
+ "<jupyter_text>",
16
+ "<jupyter_code>",
17
+ "<jupyter_output>",
18
+ "<empty_output>",
19
+ "<commit_before>",
20
+ "<commit_msg>",
21
+ "<commit_after>",
22
+ "<reponame>"
23
+ ],
24
+ "bos_token": "<|endoftext|>",
25
+ "eos_token": "<|endoftext|>",
26
+ "model_max_length": 1000000000000000019884624838656,
27
+ "tokenizer_class": "GPT2Tokenizer",
28
+ "unk_token": "<|endoftext|>",
29
+ "vocab_size": 49152
30
+ }
vocabulary.txt ADDED
The diff for this file is too large to render. See raw diff