aashish1904 commited on
Commit
8ad8cf2
1 Parent(s): 875027b

Upload README.md with huggingface_hub

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