mav23 commited on
Commit
72de7c6
•
1 Parent(s): 30fafc3

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. README.md +355 -0
  3. granite-3.0-2b-instruct.Q4_0.gguf +3 -0
.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-3.0-2b-instruct.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,355 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pipeline_tag: text-generation
3
+ inference: false
4
+ license: apache-2.0
5
+ library_name: transformers
6
+ tags:
7
+ - language
8
+ - granite-3.0
9
+ model-index:
10
+ - name: granite-3.0-2b-instruct
11
+ results:
12
+ - task:
13
+ type: text-generation
14
+ dataset:
15
+ type: instruction-following
16
+ name: IFEval
17
+ metrics:
18
+ - name: pass@1
19
+ type: pass@1
20
+ value: 46.07
21
+ veriefied: false
22
+ - task:
23
+ type: text-generation
24
+ dataset:
25
+ type: instruction-following
26
+ name: MT-Bench
27
+ metrics:
28
+ - name: pass@1
29
+ type: pass@1
30
+ value: 7.66
31
+ veriefied: false
32
+ - task:
33
+ type: text-generation
34
+ dataset:
35
+ type: human-exams
36
+ name: AGI-Eval
37
+ metrics:
38
+ - name: pass@1
39
+ type: pass@1
40
+ value: 29.75
41
+ veriefied: false
42
+ - task:
43
+ type: text-generation
44
+ dataset:
45
+ type: human-exams
46
+ name: MMLU
47
+ metrics:
48
+ - name: pass@1
49
+ type: pass@1
50
+ value: 56.03
51
+ veriefied: false
52
+ - task:
53
+ type: text-generation
54
+ dataset:
55
+ type: human-exams
56
+ name: MMLU-Pro
57
+ metrics:
58
+ - name: pass@1
59
+ type: pass@1
60
+ value: 27.92
61
+ veriefied: false
62
+ - task:
63
+ type: text-generation
64
+ dataset:
65
+ type: commonsense
66
+ name: OBQA
67
+ metrics:
68
+ - name: pass@1
69
+ type: pass@1
70
+ value: 43.2
71
+ veriefied: false
72
+ - task:
73
+ type: text-generation
74
+ dataset:
75
+ type: commonsense
76
+ name: SIQA
77
+ metrics:
78
+ - name: pass@1
79
+ type: pass@1
80
+ value: 66.36
81
+ veriefied: false
82
+ - task:
83
+ type: text-generation
84
+ dataset:
85
+ type: commonsense
86
+ name: Hellaswag
87
+ metrics:
88
+ - name: pass@1
89
+ type: pass@1
90
+ value: 76.79
91
+ veriefied: false
92
+ - task:
93
+ type: text-generation
94
+ dataset:
95
+ type: commonsense
96
+ name: WinoGrande
97
+ metrics:
98
+ - name: pass@1
99
+ type: pass@1
100
+ value: 71.9
101
+ veriefied: false
102
+ - task:
103
+ type: text-generation
104
+ dataset:
105
+ type: commonsense
106
+ name: TruthfulQA
107
+ metrics:
108
+ - name: pass@1
109
+ type: pass@1
110
+ value: 53.37
111
+ veriefied: false
112
+ - task:
113
+ type: text-generation
114
+ dataset:
115
+ type: reading-comprehension
116
+ name: BoolQ
117
+ metrics:
118
+ - name: pass@1
119
+ type: pass@1
120
+ value: 84.89
121
+ veriefied: false
122
+ - task:
123
+ type: text-generation
124
+ dataset:
125
+ type: reading-comprehension
126
+ name: SQuAD 2.0
127
+ metrics:
128
+ - name: pass@1
129
+ type: pass@1
130
+ value: 19.73
131
+ veriefied: false
132
+ - task:
133
+ type: text-generation
134
+ dataset:
135
+ type: reasoning
136
+ name: ARC-C
137
+ metrics:
138
+ - name: pass@1
139
+ type: pass@1
140
+ value: 54.35
141
+ veriefied: false
142
+ - task:
143
+ type: text-generation
144
+ dataset:
145
+ type: reasoning
146
+ name: GPQA
147
+ metrics:
148
+ - name: pass@1
149
+ type: pass@1
150
+ value: 28.61
151
+ veriefied: false
152
+ - task:
153
+ type: text-generation
154
+ dataset:
155
+ type: reasoning
156
+ name: BBH
157
+ metrics:
158
+ - name: pass@1
159
+ type: pass@1
160
+ value: 43.74
161
+ veriefied: false
162
+ - task:
163
+ type: text-generation
164
+ dataset:
165
+ type: code
166
+ name: HumanEvalSynthesis
167
+ metrics:
168
+ - name: pass@1
169
+ type: pass@1
170
+ value: 50.61
171
+ veriefied: false
172
+ - task:
173
+ type: text-generation
174
+ dataset:
175
+ type: code
176
+ name: HumanEvalExplain
177
+ metrics:
178
+ - name: pass@1
179
+ type: pass@1
180
+ value: 45.58
181
+ veriefied: false
182
+ - task:
183
+ type: text-generation
184
+ dataset:
185
+ type: code
186
+ name: HumanEvalFix
187
+ metrics:
188
+ - name: pass@1
189
+ type: pass@1
190
+ value: 51.83
191
+ veriefied: false
192
+ - task:
193
+ type: text-generation
194
+ dataset:
195
+ type: code
196
+ name: MBPP
197
+ metrics:
198
+ - name: pass@1
199
+ type: pass@1
200
+ value: 41
201
+ veriefied: false
202
+ - task:
203
+ type: text-generation
204
+ dataset:
205
+ type: math
206
+ name: GSM8K
207
+ metrics:
208
+ - name: pass@1
209
+ type: pass@1
210
+ value: 59.66
211
+ veriefied: false
212
+ - task:
213
+ type: text-generation
214
+ dataset:
215
+ type: math
216
+ name: MATH
217
+ metrics:
218
+ - name: pass@1
219
+ type: pass@1
220
+ value: 23.66
221
+ veriefied: false
222
+ - task:
223
+ type: text-generation
224
+ dataset:
225
+ type: multilingual
226
+ name: PAWS-X (7 langs)
227
+ metrics:
228
+ - name: pass@1
229
+ type: pass@1
230
+ value: 61.42
231
+ veriefied: false
232
+ - task:
233
+ type: text-generation
234
+ dataset:
235
+ type: multilingual
236
+ name: MGSM (6 langs)
237
+ metrics:
238
+ - name: pass@1
239
+ type: pass@1
240
+ value: 37.13
241
+ veriefied: false
242
+ base_model:
243
+ - ibm-granite/granite-3.0-2b-base
244
+ ---
245
+
246
+ <!-- ![image/png](https://cdn-uploads.huggingface.co/production/uploads/62cd5057674cdb524450093d/1hzxoPwqkBJXshKVVe6_9.png) -->
247
+ <!-- ![image/png](granite-3_0-language-models_Group_1.png) -->
248
+
249
+ # Granite-3.0-2B-Instruct
250
+
251
+ **Model Summary:**
252
+ Granite-3.0-2B-Instruct is a 2B parameter model finetuned from *Granite-3.0-2B-Base* using a combination of open source instruction datasets with permissive license and internally collected synthetic datasets. This model is developed using a diverse set of techniques with a structured chat format, including supervised finetuning, model alignment using reinforcement learning, and model merging.
253
+
254
+ - **Developers:** Granite Team, IBM
255
+ - **GitHub Repository:** [ibm-granite/granite-3.0-language-models](https://github.com/ibm-granite/granite-3.0-language-models)
256
+ - **Website**: [Granite Docs](https://www.ibm.com/granite/docs/)
257
+ - **Paper:** [Granite 3.0 Language Models](https://github.com/ibm-granite/granite-3.0-language-models/blob/main/paper.pdf)
258
+ - **Release Date**: October 21st, 2024
259
+ - **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
260
+
261
+ **Supported Languages:**
262
+ English, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch, and Chinese. Users may finetune Granite 3.0 models for languages beyond these 12 languages.
263
+
264
+ **Intended use:**
265
+ The model is designed to respond to general instructions and can be used to build AI assistants for multiple domains, including business applications.
266
+
267
+ *Capabilities*
268
+ * Summarization
269
+ * Text classification
270
+ * Text extraction
271
+ * Question-answering
272
+ * Retrieval Augmented Generation (RAG)
273
+ * Code related tasks
274
+ * Function-calling tasks
275
+ * Multilingual dialog use cases
276
+
277
+ **Generation:**
278
+ This is a simple example of how to use Granite-3.0-2B-Instruct model.
279
+
280
+ Install the following libraries:
281
+
282
+ ```shell
283
+ pip install torch torchvision torchaudio
284
+ pip install accelerate
285
+ pip install transformers
286
+ ```
287
+ Then, copy the snippet from the section that is relevant for your use case.
288
+
289
+ ```python
290
+ import torch
291
+ from transformers import AutoModelForCausalLM, AutoTokenizer
292
+
293
+ device = "auto"
294
+ model_path = "ibm-granite/granite-3.0-2b-instruct"
295
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
296
+ # drop device_map if running on CPU
297
+ model = AutoModelForCausalLM.from_pretrained(model_path, device_map=device)
298
+ model.eval()
299
+ # change input text as desired
300
+ chat = [
301
+ { "role": "user", "content": "Please list one IBM Research laboratory located in the United States. You should only output its name and location." },
302
+ ]
303
+ chat = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
304
+ # tokenize the text
305
+ input_tokens = tokenizer(chat, return_tensors="pt").to(device)
306
+ # generate output tokens
307
+ output = model.generate(**input_tokens,
308
+ max_new_tokens=100)
309
+ # decode output tokens into text
310
+ output = tokenizer.batch_decode(output)
311
+ # print output
312
+ print(output)
313
+ ```
314
+
315
+ **Model Architecture:**
316
+ Granite-3.0-2B-Instruct is based on a decoder-only dense transformer architecture. Core components of this architecture are: GQA and RoPE, MLP with SwiGLU, RMSNorm, and shared input/output embeddings.
317
+
318
+ | Model | 2B Dense | 8B Dense | 1B MoE | 3B MoE |
319
+ | :-------- | :-------- | :--------| :--------| :--------|
320
+ | Embedding size | **2048** | 4096 | 1024 | 1536 |
321
+ | Number of layers | **40** | 40 | 24 | 32 |
322
+ | Attention head size | **64** | 128 | 64 | 64 |
323
+ | Number of attention heads | **32** | 32 | 16 | 24 |
324
+ | Number of KV heads | **8** | 8 | 8 | 8 |
325
+ | MLP hidden size | **8192** | 12800 | 512 | 512 |
326
+ | MLP activation | **SwiGLU** | SwiGLU | SwiGLU | SwiGLU |
327
+ | Number of Experts | **—** | — | 32 | 40 |
328
+ | MoE TopK | **—** | — | 8 | 8 |
329
+ | Initialization std | **0.1** | 0.1 | 0.1 | 0.1 |
330
+ | Sequence Length | **4096** | 4096 | 4096 | 4096 |
331
+ | Position Embedding | **RoPE** | RoPE | RoPE | RoPE |
332
+ | # Parameters | **2.5B** | 8.1B | 1.3B | 3.3B |
333
+ | # Active Parameters | **2.5B** | 8.1B | 400M | 800M |
334
+ | # Training tokens | **12T** | 12T | 10T | 10T |
335
+
336
+ **Training Data:**
337
+ Overall, our SFT data is largely comprised of three key sources: (1) publicly available datasets with permissive license, (2) internal synthetic data targeting specific capabilities, and (3) very small amounts of human-curated data. A detailed attribution of datasets can be found in the [Granite Technical Report](https://github.com/ibm-granite/granite-3.0-language-models/blob/main/paper.pdf) and [Accompanying Author List](https://github.com/ibm-granite/granite-3.0-language-models/blob/main/author-ack.pdf).
338
+
339
+ **Infrastructure:**
340
+ We train Granite 3.0 Language Models using IBM's super computing cluster, Blue Vela, which is outfitted with NVIDIA H100 GPUs. This cluster provides a scalable and efficient infrastructure for training our models over thousands of GPUs while minimizing environmental impact by utilizing 100% renewable energy sources.
341
+
342
+ **Ethical Considerations and Limitations:**
343
+ Granite 3.0 Instruct Models are primarily finetuned using instruction-response pairs mostly in English, but also multilingual data covering eleven languages. Although this model can handle multilingual dialog use cases, its performance might not be similar to English tasks. In such case, introducing a small number of examples (few-shot) can help the model in generating more accurate outputs. While this model has been aligned by keeping safety in consideration, the model may in some cases produce inaccurate, biased, or unsafe responses to user prompts. So we urge the community to use this model with proper safety testing and tuning tailored for their specific tasks.
344
+
345
+ <!-- ## Citation
346
+ ```
347
+ @misc{granite-models,
348
+ author = {author 1, author2, ...},
349
+ title = {},
350
+ journal = {},
351
+ volume = {},
352
+ year = {2024},
353
+ url = {https://arxiv.org/abs/0000.00000},
354
+ }
355
+ ``` -->
granite-3.0-2b-instruct.Q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:11d6f7c7895e384fd2deb0b4fc9ad2c3ece6ce64a44cd6c8303a393fe9435f09
3
+ size 1510005440