mav23 commited on
Commit
e518720
1 Parent(s): 04433b2

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ granite-8b-code-instruct-4k.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pipeline_tag: text-generation
3
+ base_model: ibm-granite/granite-8b-code-base-4k
4
+ inference: false
5
+ license: apache-2.0
6
+ datasets:
7
+ - bigcode/commitpackft
8
+ - TIGER-Lab/MathInstruct
9
+ - meta-math/MetaMathQA
10
+ - glaiveai/glaive-code-assistant-v3
11
+ - glaive-function-calling-v2
12
+ - bugdaryan/sql-create-context-instruction
13
+ - garage-bAInd/Open-Platypus
14
+ - nvidia/HelpSteer
15
+ metrics:
16
+ - code_eval
17
+ library_name: transformers
18
+ tags:
19
+ - code
20
+ - granite
21
+ model-index:
22
+ - name: granite-8b-code-instruct-4k
23
+ results:
24
+ - task:
25
+ type: text-generation
26
+ dataset:
27
+ type: bigcode/humanevalpack
28
+ name: HumanEvalSynthesis(Python)
29
+ metrics:
30
+ - name: pass@1
31
+ type: pass@1
32
+ value: 57.9
33
+ veriefied: false
34
+ - task:
35
+ type: text-generation
36
+ dataset:
37
+ type: bigcode/humanevalpack
38
+ name: HumanEvalSynthesis(JavaScript)
39
+ metrics:
40
+ - name: pass@1
41
+ type: pass@1
42
+ value: 52.4
43
+ veriefied: false
44
+ - task:
45
+ type: text-generation
46
+ dataset:
47
+ type: bigcode/humanevalpack
48
+ name: HumanEvalSynthesis(Java)
49
+ metrics:
50
+ - name: pass@1
51
+ type: pass@1
52
+ value: 58.5
53
+ veriefied: false
54
+ - task:
55
+ type: text-generation
56
+ dataset:
57
+ type: bigcode/humanevalpack
58
+ name: HumanEvalSynthesis(Go)
59
+ metrics:
60
+ - name: pass@1
61
+ type: pass@1
62
+ value: 43.3
63
+ veriefied: false
64
+ - task:
65
+ type: text-generation
66
+ dataset:
67
+ type: bigcode/humanevalpack
68
+ name: HumanEvalSynthesis(C++)
69
+ metrics:
70
+ - name: pass@1
71
+ type: pass@1
72
+ value: 48.2
73
+ veriefied: false
74
+ - task:
75
+ type: text-generation
76
+ dataset:
77
+ type: bigcode/humanevalpack
78
+ name: HumanEvalSynthesis(Rust)
79
+ metrics:
80
+ - name: pass@1
81
+ type: pass@1
82
+ value: 37.2
83
+ veriefied: false
84
+ - task:
85
+ type: text-generation
86
+ dataset:
87
+ type: bigcode/humanevalpack
88
+ name: HumanEvalExplain(Python)
89
+ metrics:
90
+ - name: pass@1
91
+ type: pass@1
92
+ value: 53.0
93
+ veriefied: false
94
+ - task:
95
+ type: text-generation
96
+ dataset:
97
+ type: bigcode/humanevalpack
98
+ name: HumanEvalExplain(JavaScript)
99
+ metrics:
100
+ - name: pass@1
101
+ type: pass@1
102
+ value: 42.7
103
+ veriefied: false
104
+ - task:
105
+ type: text-generation
106
+ dataset:
107
+ type: bigcode/humanevalpack
108
+ name: HumanEvalExplain(Java)
109
+ metrics:
110
+ - name: pass@1
111
+ type: pass@1
112
+ value: 52.4
113
+ veriefied: false
114
+ - task:
115
+ type: text-generation
116
+ dataset:
117
+ type: bigcode/humanevalpack
118
+ name: HumanEvalExplain(Go)
119
+ metrics:
120
+ - name: pass@1
121
+ type: pass@1
122
+ value: 36.6
123
+ veriefied: false
124
+ - task:
125
+ type: text-generation
126
+ dataset:
127
+ type: bigcode/humanevalpack
128
+ name: HumanEvalExplain(C++)
129
+ metrics:
130
+ - name: pass@1
131
+ type: pass@1
132
+ value: 43.9
133
+ veriefied: false
134
+ - task:
135
+ type: text-generation
136
+ dataset:
137
+ type: bigcode/humanevalpack
138
+ name: HumanEvalExplain(Rust)
139
+ metrics:
140
+ - name: pass@1
141
+ type: pass@1
142
+ value: 16.5
143
+ veriefied: false
144
+ - task:
145
+ type: text-generation
146
+ dataset:
147
+ type: bigcode/humanevalpack
148
+ name: HumanEvalFix(Python)
149
+ metrics:
150
+ - name: pass@1
151
+ type: pass@1
152
+ value: 39.6
153
+ veriefied: false
154
+ - task:
155
+ type: text-generation
156
+ dataset:
157
+ type: bigcode/humanevalpack
158
+ name: HumanEvalFix(JavaScript)
159
+ metrics:
160
+ - name: pass@1
161
+ type: pass@1
162
+ value: 40.9
163
+ veriefied: false
164
+ - task:
165
+ type: text-generation
166
+ dataset:
167
+ type: bigcode/humanevalpack
168
+ name: HumanEvalFix(Java)
169
+ metrics:
170
+ - name: pass@1
171
+ type: pass@1
172
+ value: 48.2
173
+ veriefied: false
174
+ - task:
175
+ type: text-generation
176
+ dataset:
177
+ type: bigcode/humanevalpack
178
+ name: HumanEvalFix(Go)
179
+ metrics:
180
+ - name: pass@1
181
+ type: pass@1
182
+ value: 41.5
183
+ veriefied: false
184
+ - task:
185
+ type: text-generation
186
+ dataset:
187
+ type: bigcode/humanevalpack
188
+ name: HumanEvalFix(C++)
189
+ metrics:
190
+ - name: pass@1
191
+ type: pass@1
192
+ value: 39.0
193
+ veriefied: false
194
+ - task:
195
+ type: text-generation
196
+ dataset:
197
+ type: bigcode/humanevalpack
198
+ name: HumanEvalFix(Rust)
199
+ metrics:
200
+ - name: pass@1
201
+ type: pass@1
202
+ value: 32.9
203
+ veriefied: false
204
+ ---
205
+
206
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/62cd5057674cdb524450093d/1hzxoPwqkBJXshKVVe6_9.png)
207
+
208
+ # Granite-8B-Code-Instruct-4K
209
+
210
+ ## Model Summary
211
+ **Granite-8B-Code-Instruct-4K** is a 8B parameter model fine tuned from *Granite-8B-Code-Base-4K* on a combination of **permissively licensed** instruction data to enhance instruction following capabilities including logical reasoning and problem-solving skills.
212
+
213
+ - **Developers:** IBM Research
214
+ - **GitHub Repository:** [ibm-granite/granite-code-models](https://github.com/ibm-granite/granite-code-models)
215
+ - **Paper:** [Granite Code Models: A Family of Open Foundation Models for Code Intelligence](https://arxiv.org/abs/2405.04324)
216
+ - **Release Date**: May 6th, 2024
217
+ - **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0).
218
+
219
+ ## Usage
220
+ ### Intended use
221
+ The model is designed to respond to coding related instructions and can be used to build coding assistants.
222
+
223
+ <!-- TO DO: Check starcoder2 instruct code example that includes the template https://huggingface.co/bigcode/starcoder2-15b-instruct-v0.1 -->
224
+
225
+ ### Generation
226
+ This is a simple example of how to use **Granite-8B-Code-Instruct-4K** model.
227
+
228
+ ```python
229
+ import torch
230
+ from transformers import AutoModelForCausalLM, AutoTokenizer
231
+ device = "cuda" # or "cpu"
232
+ model_path = "ibm-granite/granite-8b-code-instruct-4k"
233
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
234
+ # drop device_map if running on CPU
235
+ model = AutoModelForCausalLM.from_pretrained(model_path, device_map=device)
236
+ model.eval()
237
+ # change input text as desired
238
+ chat = [
239
+ { "role": "user", "content": "Write a code to find the maximum value in a list of numbers." },
240
+ ]
241
+ chat = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
242
+ # tokenize the text
243
+ input_tokens = tokenizer(chat, return_tensors="pt")
244
+ # transfer tokenized inputs to the device
245
+ for i in input_tokens:
246
+ input_tokens[i] = input_tokens[i].to(device)
247
+ # generate output tokens
248
+ output = model.generate(**input_tokens, max_new_tokens=100)
249
+ # decode output tokens into text
250
+ output = tokenizer.batch_decode(output)
251
+ # loop over the batch to print, in this example the batch size is 1
252
+ for i in output:
253
+ print(i)
254
+ ```
255
+
256
+ <!-- TO DO: Check this part -->
257
+ ## Training Data
258
+ Granite Code Instruct models are trained on the following types of data.
259
+ * Code Commits Datasets: we sourced code commits data from the [CommitPackFT](https://huggingface.co/datasets/bigcode/commitpackft) dataset, a filtered version of the full CommitPack dataset. From CommitPackFT dataset, we only consider data for 92 programming languages. Our inclusion criteria boils down to selecting programming languages common across CommitPackFT and the 116 languages that we considered to pretrain the code-base model (*Granite-8B-Code-Base*).
260
+ * Math Datasets: We consider two high-quality math datasets, [MathInstruct](https://huggingface.co/datasets/TIGER-Lab/MathInstruct) and [MetaMathQA](https://huggingface.co/datasets/meta-math/MetaMathQA). Due to license issues, we filtered out GSM8K-RFT and Camel-Math from MathInstruct dataset.
261
+ * Code Instruction Datasets: We use [Glaive-Code-Assistant-v3](https://huggingface.co/datasets/glaiveai/glaive-code-assistant-v3), [Glaive-Function-Calling-v2](https://huggingface.co/datasets/glaiveai/glaive-function-calling-v2), [NL2SQL11](https://huggingface.co/datasets/bugdaryan/sql-create-context-instruction) and a small collection of synthetic API calling datasets.
262
+ * Language Instruction Datasets: We include high-quality datasets such as [HelpSteer](https://huggingface.co/datasets/nvidia/HelpSteer) and an open license-filtered version of [Platypus](https://huggingface.co/datasets/garage-bAInd/Open-Platypus). We also include a collection of hardcoded prompts to ensure our model generates correct outputs given inquiries about its name or developers.
263
+
264
+ ## Infrastructure
265
+ We train the Granite Code models using two of IBM's super computing clusters, namely Vela and Blue Vela, both outfitted with NVIDIA A100 and H100 GPUs respectively. These clusters provide a scalable and efficient infrastructure for training our models over thousands of GPUs.
266
+
267
+ ## Ethical Considerations and Limitations
268
+ Granite code instruct models are primarily finetuned using instruction-response pairs across a specific set of programming languages. Thus, their performance may be limited with out-of-domain programming languages. In this situation, it is beneficial providing few-shot examples to steer the model's output. Moreover, developers should perform safety testing and target-specific tuning before deploying these models on critical applications. The model also inherits ethical considerations and limitations from its base model. For more information, please refer to *[Granite-8B-Code-Base-4K](https://huggingface.co/ibm-granite/granite-8b-code-base-4k)* model card.
granite-8b-code-instruct-4k.Q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ef31067aa08a6f39bb797b105f310d24953841779887b0fe13d658f4b0d9236c
3
+ size 4590895168