Update README.md
Browse files
README.md
CHANGED
@@ -1,6 +1,256 @@
|
|
1 |
---
|
|
|
2 |
inference: false
|
3 |
-
license:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
<!-- header start -->
|
@@ -21,12 +271,7 @@ license: other
|
|
21 |
|
22 |
These files are GGML format model files for [Bigcode's Starcoder](https://huggingface.co/bigcode/starcoder).
|
23 |
|
24 |
-
|
25 |
-
* [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
|
26 |
-
* [KoboldCpp](https://github.com/LostRuins/koboldcpp)
|
27 |
-
* [ParisNeo/GPT4All-UI](https://github.com/ParisNeo/gpt4all-ui)
|
28 |
-
* [llama-cpp-python](https://github.com/abetlen/llama-cpp-python)
|
29 |
-
* [ctransformers](https://github.com/marella/ctransformers)
|
30 |
|
31 |
## Repositories available
|
32 |
|
@@ -35,31 +280,23 @@ GGML files are for CPU + GPU inference using [llama.cpp](https://github.com/gger
|
|
35 |
* [Unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/bigcode/starcoder)
|
36 |
|
37 |
<!-- compatibility_ggml start -->
|
38 |
-
##
|
39 |
|
40 |
-
|
41 |
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
-
|
45 |
|
46 |
-
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
They will NOT be compatible with koboldcpp, text-generation-ui, and other UIs and libraries yet. Support is expected to come over the next few days.
|
51 |
-
|
52 |
-
## Explanation of the new k-quant methods
|
53 |
-
|
54 |
-
The new methods available are:
|
55 |
-
* GGML_TYPE_Q2_K - "type-1" 2-bit quantization in super-blocks containing 16 blocks, each block having 16 weight. Block scales and mins are quantized with 4 bits. This ends up effectively using 2.5625 bits per weight (bpw)
|
56 |
-
* GGML_TYPE_Q3_K - "type-0" 3-bit quantization in super-blocks containing 16 blocks, each block having 16 weights. Scales are quantized with 6 bits. This end up using 3.4375 bpw.
|
57 |
-
* GGML_TYPE_Q4_K - "type-1" 4-bit quantization in super-blocks containing 8 blocks, each block having 32 weights. Scales and mins are quantized with 6 bits. This ends up using 4.5 bpw.
|
58 |
-
* GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
|
59 |
-
* GGML_TYPE_Q6_K - "type-0" 6-bit quantization. Super-blocks with 16 blocks, each block having 16 weights. Scales are quantized with 8 bits. This ends up using 6.5625 bpw
|
60 |
-
* GGML_TYPE_Q8_K - "type-0" 8-bit quantization. Only used for quantizing intermediate results. The difference to the existing Q8_0 is that the block size is 256. All 2-6 bit dot products are implemented for this quantization type.
|
61 |
-
|
62 |
-
Refer to the Provided Files table below to see what files use which methods, and how.
|
63 |
<!-- compatibility_ggml end -->
|
64 |
|
65 |
## Provided files
|
@@ -71,26 +308,6 @@ Refer to the Provided Files table below to see what files use which methods, and
|
|
71 |
| starcoder.ggmlv3.q5_1.bin | q5_1 | 5 | 14.26 GB | 16.76 GB | Original llama.cpp quant method, 5-bit. Even higher accuracy, resource usage and slower inference. |
|
72 |
| starcoder.ggmlv3.q8_0.bin | q8_0 | 8 | 20.11 GB | 22.61 GB | Original llama.cpp quant method, 8-bit. Almost indistinguishable from float16. High resource use and slow. Not recommended for most users. |
|
73 |
|
74 |
-
|
75 |
-
**Note**: the above RAM figures assume no GPU offloading. If layers are offloaded to the GPU, this will reduce RAM usage and use VRAM instead.
|
76 |
-
|
77 |
-
## How to run in `llama.cpp`
|
78 |
-
|
79 |
-
I use the following command line; adjust for your tastes and needs:
|
80 |
-
|
81 |
-
```
|
82 |
-
./main -t 10 -ngl 32 -m starcode.ggmlv3.q5_0.bin --color -c 2048 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "### Instruction: Write a story about llamas\n### Response:"
|
83 |
-
```
|
84 |
-
Change `-t 10` to the number of physical CPU cores you have. For example if your system has 8 cores/16 threads, use `-t 8`.
|
85 |
-
|
86 |
-
Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
|
87 |
-
|
88 |
-
If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
|
89 |
-
|
90 |
-
## How to run in `text-generation-webui`
|
91 |
-
|
92 |
-
Further instructions here: [text-generation-webui/docs/llama.cpp-models.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/llama.cpp-models.md).
|
93 |
-
|
94 |
<!-- footer start -->
|
95 |
## Discord
|
96 |
|
@@ -121,4 +338,104 @@ Thank you to all my generous patrons and donaters!
|
|
121 |
|
122 |
# Original model card: Bigcode's Starcoder
|
123 |
|
124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
pipeline_tag: text-generation
|
3 |
inference: false
|
4 |
+
license: bigcode-openrail-m
|
5 |
+
datasets:
|
6 |
+
- bigcode/the-stack-dedup
|
7 |
+
metrics:
|
8 |
+
- code_eval
|
9 |
+
library_name: transformers
|
10 |
+
tags:
|
11 |
+
- code
|
12 |
+
model-index:
|
13 |
+
- name: StarCoder
|
14 |
+
results:
|
15 |
+
- task:
|
16 |
+
type: text-generation
|
17 |
+
dataset:
|
18 |
+
type: openai_humaneval
|
19 |
+
name: HumanEval (Prompted)
|
20 |
+
metrics:
|
21 |
+
- name: pass@1
|
22 |
+
type: pass@1
|
23 |
+
value: 0.408
|
24 |
+
verified: false
|
25 |
+
- task:
|
26 |
+
type: text-generation
|
27 |
+
dataset:
|
28 |
+
type: openai_humaneval
|
29 |
+
name: HumanEval
|
30 |
+
metrics:
|
31 |
+
- name: pass@1
|
32 |
+
type: pass@1
|
33 |
+
value: 0.336
|
34 |
+
verified: false
|
35 |
+
- task:
|
36 |
+
type: text-generation
|
37 |
+
dataset:
|
38 |
+
type: mbpp
|
39 |
+
name: MBPP
|
40 |
+
metrics:
|
41 |
+
- name: pass@1
|
42 |
+
type: pass@1
|
43 |
+
value: 0.527
|
44 |
+
verified: false
|
45 |
+
- task:
|
46 |
+
type: text-generation
|
47 |
+
dataset:
|
48 |
+
type: ds1000
|
49 |
+
name: DS-1000 (Overall Completion)
|
50 |
+
metrics:
|
51 |
+
- name: pass@1
|
52 |
+
type: pass@1
|
53 |
+
value: 0.26
|
54 |
+
verified: false
|
55 |
+
- task:
|
56 |
+
type: text-generation
|
57 |
+
dataset:
|
58 |
+
type: nuprl/MultiPL-E
|
59 |
+
name: MultiPL-HumanEval (C++)
|
60 |
+
metrics:
|
61 |
+
- name: pass@1
|
62 |
+
type: pass@1
|
63 |
+
value: 0.3155
|
64 |
+
verified: false
|
65 |
+
- task:
|
66 |
+
type: text-generation
|
67 |
+
dataset:
|
68 |
+
type: nuprl/MultiPL-E
|
69 |
+
name: MultiPL-HumanEval (C#)
|
70 |
+
metrics:
|
71 |
+
- name: pass@1
|
72 |
+
type: pass@1
|
73 |
+
value: 0.2101
|
74 |
+
verified: false
|
75 |
+
- task:
|
76 |
+
type: text-generation
|
77 |
+
dataset:
|
78 |
+
type: nuprl/MultiPL-E
|
79 |
+
name: MultiPL-HumanEval (D)
|
80 |
+
metrics:
|
81 |
+
- name: pass@1
|
82 |
+
type: pass@1
|
83 |
+
value: 0.1357
|
84 |
+
verified: false
|
85 |
+
- task:
|
86 |
+
type: text-generation
|
87 |
+
dataset:
|
88 |
+
type: nuprl/MultiPL-E
|
89 |
+
name: MultiPL-HumanEval (Go)
|
90 |
+
metrics:
|
91 |
+
- name: pass@1
|
92 |
+
type: pass@1
|
93 |
+
value: 0.1761
|
94 |
+
verified: false
|
95 |
+
- task:
|
96 |
+
type: text-generation
|
97 |
+
dataset:
|
98 |
+
type: nuprl/MultiPL-E
|
99 |
+
name: MultiPL-HumanEval (Java)
|
100 |
+
metrics:
|
101 |
+
- name: pass@1
|
102 |
+
type: pass@1
|
103 |
+
value: 0.3022
|
104 |
+
verified: false
|
105 |
+
- task:
|
106 |
+
type: text-generation
|
107 |
+
dataset:
|
108 |
+
type: nuprl/MultiPL-E
|
109 |
+
name: MultiPL-HumanEval (Julia)
|
110 |
+
metrics:
|
111 |
+
- name: pass@1
|
112 |
+
type: pass@1
|
113 |
+
value: 0.2302
|
114 |
+
verified: false
|
115 |
+
- task:
|
116 |
+
type: text-generation
|
117 |
+
dataset:
|
118 |
+
type: nuprl/MultiPL-E
|
119 |
+
name: MultiPL-HumanEval (JavaScript)
|
120 |
+
metrics:
|
121 |
+
- name: pass@1
|
122 |
+
type: pass@1
|
123 |
+
value: 0.3079
|
124 |
+
verified: false
|
125 |
+
- task:
|
126 |
+
type: text-generation
|
127 |
+
dataset:
|
128 |
+
type: nuprl/MultiPL-E
|
129 |
+
name: MultiPL-HumanEval (Lua)
|
130 |
+
metrics:
|
131 |
+
- name: pass@1
|
132 |
+
type: pass@1
|
133 |
+
value: 0.2389
|
134 |
+
verified: false
|
135 |
+
- task:
|
136 |
+
type: text-generation
|
137 |
+
dataset:
|
138 |
+
type: nuprl/MultiPL-E
|
139 |
+
name: MultiPL-HumanEval (PHP)
|
140 |
+
metrics:
|
141 |
+
- name: pass@1
|
142 |
+
type: pass@1
|
143 |
+
value: 0.2608
|
144 |
+
verified: false
|
145 |
+
- task:
|
146 |
+
type: text-generation
|
147 |
+
dataset:
|
148 |
+
type: nuprl/MultiPL-E
|
149 |
+
name: MultiPL-HumanEval (Perl)
|
150 |
+
metrics:
|
151 |
+
- name: pass@1
|
152 |
+
type: pass@1
|
153 |
+
value: 0.1734
|
154 |
+
verified: false
|
155 |
+
- task:
|
156 |
+
type: text-generation
|
157 |
+
dataset:
|
158 |
+
type: nuprl/MultiPL-E
|
159 |
+
name: MultiPL-HumanEval (Python)
|
160 |
+
metrics:
|
161 |
+
- name: pass@1
|
162 |
+
type: pass@1
|
163 |
+
value: 0.3357
|
164 |
+
verified: false
|
165 |
+
- task:
|
166 |
+
type: text-generation
|
167 |
+
dataset:
|
168 |
+
type: nuprl/MultiPL-E
|
169 |
+
name: MultiPL-HumanEval (R)
|
170 |
+
metrics:
|
171 |
+
- name: pass@1
|
172 |
+
type: pass@1
|
173 |
+
value: 0.155
|
174 |
+
verified: false
|
175 |
+
- task:
|
176 |
+
type: text-generation
|
177 |
+
dataset:
|
178 |
+
type: nuprl/MultiPL-E
|
179 |
+
name: MultiPL-HumanEval (Ruby)
|
180 |
+
metrics:
|
181 |
+
- name: pass@1
|
182 |
+
type: pass@1
|
183 |
+
value: 0.0124
|
184 |
+
verified: false
|
185 |
+
- task:
|
186 |
+
type: text-generation
|
187 |
+
dataset:
|
188 |
+
type: nuprl/MultiPL-E
|
189 |
+
name: MultiPL-HumanEval (Racket)
|
190 |
+
metrics:
|
191 |
+
- name: pass@1
|
192 |
+
type: pass@1
|
193 |
+
value: 0.0007
|
194 |
+
verified: false
|
195 |
+
- task:
|
196 |
+
type: text-generation
|
197 |
+
dataset:
|
198 |
+
type: nuprl/MultiPL-E
|
199 |
+
name: MultiPL-HumanEval (Rust)
|
200 |
+
metrics:
|
201 |
+
- name: pass@1
|
202 |
+
type: pass@1
|
203 |
+
value: 0.2184
|
204 |
+
verified: false
|
205 |
+
- task:
|
206 |
+
type: text-generation
|
207 |
+
dataset:
|
208 |
+
type: nuprl/MultiPL-E
|
209 |
+
name: MultiPL-HumanEval (Scala)
|
210 |
+
metrics:
|
211 |
+
- name: pass@1
|
212 |
+
type: pass@1
|
213 |
+
value: 0.2761
|
214 |
+
verified: false
|
215 |
+
- task:
|
216 |
+
type: text-generation
|
217 |
+
dataset:
|
218 |
+
type: nuprl/MultiPL-E
|
219 |
+
name: MultiPL-HumanEval (Bash)
|
220 |
+
metrics:
|
221 |
+
- name: pass@1
|
222 |
+
type: pass@1
|
223 |
+
value: 0.1046
|
224 |
+
verified: false
|
225 |
+
- task:
|
226 |
+
type: text-generation
|
227 |
+
dataset:
|
228 |
+
type: nuprl/MultiPL-E
|
229 |
+
name: MultiPL-HumanEval (Swift)
|
230 |
+
metrics:
|
231 |
+
- name: pass@1
|
232 |
+
type: pass@1
|
233 |
+
value: 0.2274
|
234 |
+
verified: false
|
235 |
+
- task:
|
236 |
+
type: text-generation
|
237 |
+
dataset:
|
238 |
+
type: nuprl/MultiPL-E
|
239 |
+
name: MultiPL-HumanEval (TypeScript)
|
240 |
+
metrics:
|
241 |
+
- name: pass@1
|
242 |
+
type: pass@1
|
243 |
+
value: 0.3229
|
244 |
+
verified: false
|
245 |
+
extra_gated_prompt: >-
|
246 |
+
## Model License Agreement
|
247 |
+
|
248 |
+
Please read the BigCode [OpenRAIL-M
|
249 |
+
license](https://huggingface.co/spaces/bigcode/bigcode-model-license-agreement)
|
250 |
+
agreement before accepting it.
|
251 |
+
|
252 |
+
extra_gated_fields:
|
253 |
+
I accept the above license agreement, and will use the Model complying with the set of use restrictions and sharing requirements: checkbox
|
254 |
---
|
255 |
|
256 |
<!-- header start -->
|
|
|
271 |
|
272 |
These files are GGML format model files for [Bigcode's Starcoder](https://huggingface.co/bigcode/starcoder).
|
273 |
|
274 |
+
Please note that these GGMLs are **not compatbile with llama.cpp**. Please see below for a list of tools known to work with these model files.
|
|
|
|
|
|
|
|
|
|
|
275 |
|
276 |
## Repositories available
|
277 |
|
|
|
280 |
* [Unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/bigcode/starcoder)
|
281 |
|
282 |
<!-- compatibility_ggml start -->
|
283 |
+
## Compatibilty
|
284 |
|
285 |
+
These files are **not** compatible with llama.cpp.
|
286 |
|
287 |
+
Currently they can be used with:
|
288 |
+
* KoboldCpp, a powerful inference engine based on llama.cpp, with good UI: [KoboldCpp](https://github.com/LostRuins/koboldcpp)
|
289 |
+
* The ctransformers Python library, which includes LangChain support: [ctransformers](https://github.com/marella/ctransformers)
|
290 |
+
* The GPT4All-UI which uses ctransformers: [GPT4All-UI](https://github.com/ParisNeo/gpt4all-ui)
|
291 |
+
* [rustformers' llm](https://github.com/rustformers/llm)
|
292 |
+
* The example `mpt` binary provided with [ggml](https://github.com/ggerganov/ggml)
|
293 |
|
294 |
+
As other options become available I will endeavour to update them here (do let me know in the Community tab if I've missed something!)
|
295 |
|
296 |
+
## Tutorial for using GPT4All-UI
|
297 |
|
298 |
+
* [Text tutorial, written by **Lucas3DCG**](https://huggingface.co/TheBloke/MPT-7B-Storywriter-GGML/discussions/2#6475d914e9b57ce0caa68888)
|
299 |
+
* [Video tutorial, by GPT4All-UI's author **ParisNeo**](https://www.youtube.com/watch?v=ds_U0TDzbzI)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
<!-- compatibility_ggml end -->
|
301 |
|
302 |
## Provided files
|
|
|
308 |
| starcoder.ggmlv3.q5_1.bin | q5_1 | 5 | 14.26 GB | 16.76 GB | Original llama.cpp quant method, 5-bit. Even higher accuracy, resource usage and slower inference. |
|
309 |
| starcoder.ggmlv3.q8_0.bin | q8_0 | 8 | 20.11 GB | 22.61 GB | Original llama.cpp quant method, 8-bit. Almost indistinguishable from float16. High resource use and slow. Not recommended for most users. |
|
310 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
311 |
<!-- footer start -->
|
312 |
## Discord
|
313 |
|
|
|
338 |
|
339 |
# Original model card: Bigcode's Starcoder
|
340 |
|
341 |
+
# StarCoder
|
342 |
+
|
343 |
+
![banner](https://huggingface.co/datasets/bigcode/admin/resolve/main/StarCoderBanner.png)
|
344 |
+
|
345 |
+
Play with the model on the [StarCoder Playground](https://huggingface.co/spaces/bigcode/bigcode-playground).
|
346 |
+
|
347 |
+
## Table of Contents
|
348 |
+
|
349 |
+
1. [Model Summary](##model-summary)
|
350 |
+
2. [Use](##use)
|
351 |
+
3. [Limitations](##limitations)
|
352 |
+
4. [Training](##training)
|
353 |
+
5. [License](##license)
|
354 |
+
6. [Citation](##citation)
|
355 |
+
|
356 |
+
## Model Summary
|
357 |
+
|
358 |
+
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.
|
359 |
+
|
360 |
+
- **Repository:** [bigcode/Megatron-LM](https://github.com/bigcode-project/Megatron-LM)
|
361 |
+
- **Project Website:** [bigcode-project.org](https://www.bigcode-project.org)
|
362 |
+
- **Paper:** [💫StarCoder: May the source be with you!](https://arxiv.org/abs/2305.06161)
|
363 |
+
- **Point of Contact:** [contact@bigcode-project.org](mailto:contact@bigcode-project.org)
|
364 |
+
- **Languages:** 80+ Programming languages
|
365 |
+
|
366 |
+
|
367 |
+
## Use
|
368 |
+
|
369 |
+
### Intended use
|
370 |
+
|
371 |
+
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.
|
372 |
+
|
373 |
+
**Feel free to share your generations in the Community tab!**
|
374 |
+
|
375 |
+
### Generation
|
376 |
+
```python
|
377 |
+
# pip install -q transformers
|
378 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
379 |
+
|
380 |
+
checkpoint = "bigcode/starcoder"
|
381 |
+
device = "cuda" # for GPU usage or "cpu" for CPU usage
|
382 |
+
|
383 |
+
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
384 |
+
model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
|
385 |
+
|
386 |
+
inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device)
|
387 |
+
outputs = model.generate(inputs)
|
388 |
+
print(tokenizer.decode(outputs[0]))
|
389 |
+
```
|
390 |
+
|
391 |
+
### Fill-in-the-middle
|
392 |
+
Fill-in-the-middle uses special tokens to identify the prefix/middle/suffix part of the input and output:
|
393 |
+
|
394 |
+
```python
|
395 |
+
input_text = "<fim_prefix>def print_hello_world():\n <fim_suffix>\n print('Hello world!')<fim_middle>"
|
396 |
+
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
|
397 |
+
outputs = model.generate(inputs)
|
398 |
+
print(tokenizer.decode(outputs[0]))
|
399 |
+
```
|
400 |
+
|
401 |
+
### Attribution & Other Requirements
|
402 |
+
|
403 |
+
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.
|
404 |
+
|
405 |
+
# Limitations
|
406 |
+
|
407 |
+
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.
|
408 |
+
|
409 |
+
# Training
|
410 |
+
|
411 |
+
## Model
|
412 |
+
|
413 |
+
- **Architecture:** GPT-2 model with multi-query attention and Fill-in-the-Middle objective
|
414 |
+
- **Pretraining steps:** 250k
|
415 |
+
- **Pretraining tokens:** 1 trillion
|
416 |
+
- **Precision:** bfloat16
|
417 |
+
|
418 |
+
## Hardware
|
419 |
+
|
420 |
+
- **GPUs:** 512 Tesla A100
|
421 |
+
- **Training time:** 24 days
|
422 |
+
|
423 |
+
## Software
|
424 |
+
|
425 |
+
- **Orchestration:** [Megatron-LM](https://github.com/bigcode-project/Megatron-LM)
|
426 |
+
- **Neural networks:** [PyTorch](https://github.com/pytorch/pytorch)
|
427 |
+
- **BP16 if applicable:** [apex](https://github.com/NVIDIA/apex)
|
428 |
+
|
429 |
+
# License
|
430 |
+
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).
|
431 |
+
# Citation
|
432 |
+
```
|
433 |
+
@article{li2023starcoder,
|
434 |
+
title={StarCoder: may the source be with you!},
|
435 |
+
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},
|
436 |
+
year={2023},
|
437 |
+
eprint={2305.06161},
|
438 |
+
archivePrefix={arXiv},
|
439 |
+
primaryClass={cs.CL}
|
440 |
+
}
|
441 |
+
```
|