Upload 10 files
Browse files- README.md +349 -0
- added_tokens.json +5 -0
- config.json +44 -0
- generation_config.json +7 -0
- merges.txt +0 -0
- output.safetensors +3 -0
- special_tokens_map.json +35 -0
- tokenizer.json +0 -0
- tokenizer_config.json +199 -0
- vocab.json +0 -0
README.md
ADDED
@@ -0,0 +1,349 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.2
|
9 |
+
base_model:
|
10 |
+
- ibm-granite/granite-3.1-2b-instruct
|
11 |
+
---
|
12 |
+
|
13 |
+
# Granite-3.2-2B-Instruct
|
14 |
+
|
15 |
+
**Model Summary:**
|
16 |
+
Granite-3.2-2B-Instruct is an 2-billion-parameter, long-context AI model fine-tuned for thinking capabilities. Built on top of [Granite-3.1-2B-Instruct](https://huggingface.co/ibm-granite/granite-3.1-2b-instruct), it has been trained using a mix of permissively licensed open-source datasets and internally generated synthetic data designed for reasoning tasks. The model allows controllability of its thinking capability, ensuring it is applied only when required.
|
17 |
+
|
18 |
+
|
19 |
+
- **Developers:** Granite Team, IBM
|
20 |
+
- **Website**: [Granite Docs](https://www.ibm.com/granite/docs/)
|
21 |
+
- **Release Date**: February 26th, 2025
|
22 |
+
- **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
23 |
+
|
24 |
+
**Supported Languages:**
|
25 |
+
English, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch, and Chinese. However, users may finetune this Granite model for languages beyond these 12 languages.
|
26 |
+
|
27 |
+
**Intended Use:**
|
28 |
+
This model is designed to handle general instruction-following tasks and can be integrated into AI assistants across various domains, including business applications.
|
29 |
+
|
30 |
+
**Capabilities**
|
31 |
+
* **Thinking**
|
32 |
+
* Summarization
|
33 |
+
* Text classification
|
34 |
+
* Text extraction
|
35 |
+
* Question-answering
|
36 |
+
* Retrieval Augmented Generation (RAG)
|
37 |
+
* Code related tasks
|
38 |
+
* Function-calling tasks
|
39 |
+
* Multilingual dialog use cases
|
40 |
+
* Long-context tasks including long document/meeting summarization, long document QA, etc.
|
41 |
+
|
42 |
+
|
43 |
+
|
44 |
+
**Generation:**
|
45 |
+
This is a simple example of how to use Granite-3.2-2B-Instruct model.
|
46 |
+
|
47 |
+
Install the following libraries:
|
48 |
+
|
49 |
+
```shell
|
50 |
+
pip install torch torchvision torchaudio
|
51 |
+
pip install accelerate
|
52 |
+
pip install transformers
|
53 |
+
```
|
54 |
+
Then, copy the snippet from the section that is relevant for your use case.
|
55 |
+
|
56 |
+
```python
|
57 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, set_seed
|
58 |
+
import torch
|
59 |
+
|
60 |
+
model_path="ibm-granite/granite-3.2-2b-instruct"
|
61 |
+
device="cuda"
|
62 |
+
model = AutoModelForCausalLM.from_pretrained(
|
63 |
+
model_path,
|
64 |
+
device_map=device,
|
65 |
+
torch_dtype=torch.bfloat16,
|
66 |
+
)
|
67 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
68 |
+
model_path
|
69 |
+
)
|
70 |
+
|
71 |
+
conv = [{"role": "user", "content":"You have 10 liters of a 30% acid solution. How many liters of a 70% acid solution must be added to achieve a 50% acid mixture?"}]
|
72 |
+
|
73 |
+
input_ids = tokenizer.apply_chat_template(conv, return_tensors="pt", thinking=True, return_dict=True, add_generation_prompt=True).to(device)
|
74 |
+
|
75 |
+
set_seed(42)
|
76 |
+
output = model.generate(
|
77 |
+
**input_ids,
|
78 |
+
max_new_tokens=8192,
|
79 |
+
)
|
80 |
+
|
81 |
+
prediction = tokenizer.decode(output[0, input_ids["input_ids"].shape[1]:], skip_special_tokens=True)
|
82 |
+
print(prediction)
|
83 |
+
```
|
84 |
+
|
85 |
+
**Example Outputs**
|
86 |
+
- thinking=True
|
87 |
+
```md
|
88 |
+
Here is my thought process:
|
89 |
+
|
90 |
+
1. First, let's understand the composition of the initial 10 liters of 30% acid solution:
|
91 |
+
- Acid content = 30% of 10 liters = 0.30 * 10 = 3 liters
|
92 |
+
|
93 |
+
2. We want to end up with a 50% acid solution. Let's denote the volume of the 70% acid solution to be added as 'x' liters.
|
94 |
+
|
95 |
+
3. The amount of acid in the final mixture (50% solution) should equal the initial acid content plus the acid from the added 70% solution.
|
96 |
+
- Total acid in final mixture = 0.50 * (10 + x)
|
97 |
+
|
98 |
+
4. The equation representing the total acid content is:
|
99 |
+
3 (from initial solution) + 0.70 * x (from added solution) = 0.50 * (10 + x)
|
100 |
+
|
101 |
+
5. Now, we solve for 'x':
|
102 |
+
3 + 0.70x = 5 + 0.50x
|
103 |
+
0.70x - 0.50x = 5 - 3
|
104 |
+
0.20x = 2
|
105 |
+
x = 2 / 0.20
|
106 |
+
x = 10 liters
|
107 |
+
|
108 |
+
6. Therefore, 10 liters of a 70% acid solution must be added to the initial 10 liters of 30% acid solution to achieve a 50% acid mixture.
|
109 |
+
|
110 |
+
Here is my response:
|
111 |
+
|
112 |
+
To solve this problem, we need to determine how much of a 70% acid solution must be added to a 10-liter solution that is already 30% acid to create a new mixture that is 50% acid. Here's how to calculate it:
|
113 |
+
|
114 |
+
1. **Initial Acid Content**:
|
115 |
+
- The initial 10-liter solution contains 3 liters of acid (since 30% of 10 liters).
|
116 |
+
|
117 |
+
2. **Desired Final Acid Content**:
|
118 |
+
- We want the final mixture to be 50% acid.
|
119 |
+
|
120 |
+
3. **Equation Setup**:
|
121 |
+
- Let 'x' be the volume (in liters) of the 70% acid solution to be added.
|
122 |
+
- The equation representing the total acid content in the final mixture (which is 10 liters from the initial solution plus 'x' liters of the added solution) should equal 50% of the total volume (10 + x).
|
123 |
+
- This gives us: 3 (acid from initial solution) + 0.70x (acid from added solution) = 0.50(10 + x)
|
124 |
+
|
125 |
+
4. **Solving the Equation**:
|
126 |
+
- First, simplify the right side of the equation: 0.50(10 + x) = 5 + 0.50x
|
127 |
+
- Now, the equation is: 3 + 0.70x = 5 + 0.50x
|
128 |
+
- Subtract 0.50x from both sides: 0.20x = 2
|
129 |
+
- Divide both sides by 0.20: x = 2 / 0.20
|
130 |
+
- x = 10 liters
|
131 |
+
|
132 |
+
5. **Conclusion**:
|
133 |
+
- To achieve a 50% acid mixture from the initial 30% solution, you need to add 10 liters of a 70% acid solution.
|
134 |
+
|
135 |
+
So, the final answer is that 10 liters of a 70% acid solution must be added to the initial 10 liters of 30% acid solution.
|
136 |
+
```
|
137 |
+
- thinking=False
|
138 |
+
```md
|
139 |
+
To solve this problem, we'll use the concept of volume and concentration. Let's denote the amount of 70% acid solution we need to add as "x" liters.
|
140 |
+
|
141 |
+
First, let's find out how much acid is in the initial 10-liter solution:
|
142 |
+
|
143 |
+
Acid in initial solution = 30% of 10 liters = 0.30 * 10 = 3 liters
|
144 |
+
|
145 |
+
Now, we want to end up with a 50% acid solution in a total volume of (10 + x) liters. Let's denote the final volume as V.
|
146 |
+
|
147 |
+
Final acid concentration = 50%
|
148 |
+
Final acid amount = 50% of V = 0.50 * V
|
149 |
+
|
150 |
+
We know the initial acid amount and the final acid amount, so we can set up an equation:
|
151 |
+
|
152 |
+
Initial acid amount + Acid from added solution = Final acid amount
|
153 |
+
3 liters + (70% of x) = 0.50 * (10 + x)
|
154 |
+
|
155 |
+
Now, let's solve for x:
|
156 |
+
|
157 |
+
0.70x + 3 = 0.50 * 10 + 0.50x
|
158 |
+
0.70x - 0.50x = 0.50 * 10 - 3
|
159 |
+
0.20x = 5 - 3
|
160 |
+
0.20x = 2
|
161 |
+
x = 2 / 0.20
|
162 |
+
x = 10 liters
|
163 |
+
|
164 |
+
So, you need to add 10 liters of a 70% acid solution to the initial 10-liter 30% acid solution to achieve a 50% acid mixture.
|
165 |
+
```
|
166 |
+
|
167 |
+
**Evaluation Results:**
|
168 |
+
<table>
|
169 |
+
|
170 |
+
<thead>
|
171 |
+
<tr>
|
172 |
+
<th style="text-align:left; background-color: #001d6c; color: white;">Models</th>
|
173 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">ArenaHard</th>
|
174 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">Alpaca-Eval-2</th>
|
175 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">MMLU</th>
|
176 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">PopQA</th>
|
177 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">TruthfulQA</th>
|
178 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">BigBenchHard</th>
|
179 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">DROP</th>
|
180 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">GSM8K</th>
|
181 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">HumanEval</th>
|
182 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">HumanEval+</th>
|
183 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">IFEval</th>
|
184 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">AttaQ</th>
|
185 |
+
</tr></thead>
|
186 |
+
<tbody>
|
187 |
+
<tr>
|
188 |
+
<td style="text-align:left; background-color: #DAE8FF; color: black;">Llama-3.1-8B-Instruct</td>
|
189 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">36.43</td>
|
190 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">27.22</td>
|
191 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">69.15</td>
|
192 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">28.79</td>
|
193 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">52.79</td>
|
194 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">72.66</td>
|
195 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">61.48</td>
|
196 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">83.24</td>
|
197 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">85.32</td>
|
198 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">80.15</td>
|
199 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">79.10</td>
|
200 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">83.43</td>
|
201 |
+
</tr>
|
202 |
+
|
203 |
+
<tr>
|
204 |
+
<td style="text-align:left; background-color: #DAE8FF; color: black;">DeepSeek-R1-Distill-Llama-8B</td>
|
205 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">17.17</td>
|
206 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">21.85</td>
|
207 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">45.80</td>
|
208 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">13.25</td>
|
209 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">47.43</td>
|
210 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">65.71</td>
|
211 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">44.46</td>
|
212 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">72.18</td>
|
213 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">67.54</td>
|
214 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">62.91</td>
|
215 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">66.50</td>
|
216 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">42.87</td>
|
217 |
+
</tr>
|
218 |
+
|
219 |
+
<tr>
|
220 |
+
<td style="text-align:left; background-color: #DAE8FF; color: black;">Qwen-2.5-7B-Instruct</td>
|
221 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">25.44</td>
|
222 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">30.34</td>
|
223 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">74.30</td>
|
224 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">18.12</td>
|
225 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">63.06</td>
|
226 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">70.40</td>
|
227 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">54.71</td>
|
228 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">84.46</td>
|
229 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">93.35</td>
|
230 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">89.91</td>
|
231 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">74.90</td>
|
232 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">81.90</td>
|
233 |
+
</tr>
|
234 |
+
|
235 |
+
<tr>
|
236 |
+
<td style="text-align:left; background-color: #DAE8FF; color: black;">DeepSeek-R1-Distill-Qwen-7B</td>
|
237 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">10.36</td>
|
238 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">15.35</td>
|
239 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">50.72</td>
|
240 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">9.94</td>
|
241 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">47.14</td>
|
242 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">65.04</td>
|
243 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">42.76</td>
|
244 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">78.47</td>
|
245 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">79.89</td>
|
246 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">78.43</td>
|
247 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">59.10</td>
|
248 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">42.45</td>
|
249 |
+
</tr>
|
250 |
+
|
251 |
+
<tr>
|
252 |
+
<td style="text-align:left; background-color: #DAE8FF; color: black;">Granite-3.1-8B-Instruct</td>
|
253 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">37.58</td>
|
254 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">30.34</td>
|
255 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">66.77</td>
|
256 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">28.7</td>
|
257 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">65.84</td>
|
258 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">68.55</td>
|
259 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">50.78</td>
|
260 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">79.15</td>
|
261 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">89.63</td>
|
262 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">85.79</td>
|
263 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">73.20</td>
|
264 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">85.73</td>
|
265 |
+
</tr>
|
266 |
+
|
267 |
+
|
268 |
+
<tr>
|
269 |
+
<td style="text-align:left; background-color: #DAE8FF; color: black;">Granite-3.1-2B-Instruct</td>
|
270 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">23.3</td>
|
271 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">27.17</td>
|
272 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">57.11</td>
|
273 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">20.55</td>
|
274 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">59.79</td>
|
275 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">54.46</td>
|
276 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">18.68</td>
|
277 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">67.55</td>
|
278 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">79.45</td>
|
279 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">75.26</td>
|
280 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">63.59</td>
|
281 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">84.7</td>
|
282 |
+
</tr>
|
283 |
+
|
284 |
+
<tr>
|
285 |
+
<td style="text-align:left; background-color: #DAE8FF; color: black;">Granite-3.2-8B-Instruct</td>
|
286 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">55.25</td>
|
287 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">61.19</td>
|
288 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">66.79</td>
|
289 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">28.04</td>
|
290 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">66.92</td>
|
291 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">64.77</td>
|
292 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">50.95</td>
|
293 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">81.65</td>
|
294 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">89.35</td>
|
295 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">85.72</td>
|
296 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">74.31</td>
|
297 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">85.42</td>
|
298 |
+
|
299 |
+
</tr>
|
300 |
+
|
301 |
+
<tr>
|
302 |
+
<td style="text-align:left; background-color: #DAE8FF; color: black;"><b>Granite-3.2-2B-Instruct</b></td>
|
303 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">24.86</td>
|
304 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">34.51</td>
|
305 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">57.18</td>
|
306 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">20.56</td>
|
307 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">59.8</td>
|
308 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">52.27</td>
|
309 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">21.12</td>
|
310 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">67.02</td>
|
311 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">80.13</td>
|
312 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">73.39</td>
|
313 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">61.55</td>
|
314 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">83.23</td>
|
315 |
+
</tr>
|
316 |
+
|
317 |
+
|
318 |
+
|
319 |
+
|
320 |
+
|
321 |
+
</tbody></table>
|
322 |
+
|
323 |
+
**Training Data:**
|
324 |
+
Overall, our training data is largely comprised of two key sources: (1) publicly available datasets with permissive license, (2) internal synthetically generated data targeted to enhance reasoning capabilites.
|
325 |
+
<!-- A detailed attribution of datasets can be found in [Granite 3.2 Technical Report (coming soon)](#), and [Accompanying Author List](https://github.com/ibm-granite/granite-3.0-language-models/blob/main/author-ack.pdf). -->
|
326 |
+
|
327 |
+
**Infrastructure:**
|
328 |
+
We train Granite-3.2-2B-Instruct 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.
|
329 |
+
|
330 |
+
**Ethical Considerations and Limitations:**
|
331 |
+
Granite-3.2-2B-Instruct builds upon Granite-3.1-2B-Instruct, leveraging both permissively licensed open-source and select proprietary data for enhanced performance. Since it inherits its foundation from the previous model, all ethical considerations and limitations applicable to [Granite-3.1-2B-Instruct](https://huggingface.co/ibm-granite/granite-3.1-2b-instruct) remain relevant.
|
332 |
+
|
333 |
+
|
334 |
+
**Resources**
|
335 |
+
- ⭐️ Learn about the latest updates with Granite: https://www.ibm.com/granite
|
336 |
+
- 📄 Get started with tutorials, best practices, and prompt engineering advice: https://www.ibm.com/granite/docs/
|
337 |
+
- 💡 Learn about the latest Granite learning resources: https://ibm.biz/granite-learning-resources
|
338 |
+
|
339 |
+
<!-- ## Citation
|
340 |
+
```
|
341 |
+
@misc{granite-models,
|
342 |
+
author = {author 1, author2, ...},
|
343 |
+
title = {},
|
344 |
+
journal = {},
|
345 |
+
volume = {},
|
346 |
+
year = {2024},
|
347 |
+
url = {https://arxiv.org/abs/0000.00000},
|
348 |
+
}
|
349 |
+
``` -->
|
added_tokens.json
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"<|end_of_role|>": 49153,
|
3 |
+
"<|start_of_role|>": 49152,
|
4 |
+
"<|tool_call|>": 49154
|
5 |
+
}
|
config.json
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "/proj/checkpoints/ashishagr/thinking-granite/outputs/tpo_final/2b/exp_11/iter4/dpo",
|
3 |
+
"architectures": [
|
4 |
+
"GraniteForCausalLM"
|
5 |
+
],
|
6 |
+
"attention_bias": false,
|
7 |
+
"attention_dropout": 0.1,
|
8 |
+
"attention_multiplier": 0.015625,
|
9 |
+
"bos_token_id": 0,
|
10 |
+
"embedding_multiplier": 12.0,
|
11 |
+
"eos_token_id": 0,
|
12 |
+
"hidden_act": "silu",
|
13 |
+
"hidden_size": 2048,
|
14 |
+
"initializer_range": 0.02,
|
15 |
+
"intermediate_size": 8192,
|
16 |
+
"logits_scaling": 8.0,
|
17 |
+
"max_position_embeddings": 131072,
|
18 |
+
"mlp_bias": false,
|
19 |
+
"model_type": "granite",
|
20 |
+
"num_attention_heads": 32,
|
21 |
+
"num_hidden_layers": 40,
|
22 |
+
"num_key_value_heads": 8,
|
23 |
+
"pad_token_id": 0,
|
24 |
+
"residual_multiplier": 0.22,
|
25 |
+
"rms_norm_eps": 1e-05,
|
26 |
+
"rope_scaling": null,
|
27 |
+
"rope_theta": 5000000.0,
|
28 |
+
"tie_word_embeddings": true,
|
29 |
+
"torch_dtype": "bfloat16",
|
30 |
+
"transformers_version": "4.47.0.dev0",
|
31 |
+
"use_cache": true,
|
32 |
+
"vocab_size": 49155,
|
33 |
+
"quantization_config": {
|
34 |
+
"quant_method": "exl2",
|
35 |
+
"version": "0.2.8",
|
36 |
+
"bits": 4.0,
|
37 |
+
"head_bits": 6,
|
38 |
+
"calibration": {
|
39 |
+
"rows": 115,
|
40 |
+
"length": 2048,
|
41 |
+
"dataset": "(default)"
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 0,
|
4 |
+
"eos_token_id": 0,
|
5 |
+
"pad_token_id": 0,
|
6 |
+
"transformers_version": "4.47.0.dev0"
|
7 |
+
}
|
merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
output.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:904938b07462f46c1f81e4e5ff3091f9d002b81c7fab5af9ed891d95eb1289bc
|
3 |
+
size 1498835852
|
special_tokens_map.json
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"additional_special_tokens": [
|
3 |
+
"<|start_of_role|>",
|
4 |
+
"<|end_of_role|>",
|
5 |
+
"<|tool_call|>"
|
6 |
+
],
|
7 |
+
"bos_token": {
|
8 |
+
"content": "<|end_of_text|>",
|
9 |
+
"lstrip": false,
|
10 |
+
"normalized": false,
|
11 |
+
"rstrip": false,
|
12 |
+
"single_word": false
|
13 |
+
},
|
14 |
+
"eos_token": {
|
15 |
+
"content": "<|end_of_text|>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false
|
20 |
+
},
|
21 |
+
"pad_token": {
|
22 |
+
"content": "<|end_of_text|>",
|
23 |
+
"lstrip": false,
|
24 |
+
"normalized": false,
|
25 |
+
"rstrip": false,
|
26 |
+
"single_word": false
|
27 |
+
},
|
28 |
+
"unk_token": {
|
29 |
+
"content": "<|end_of_text|>",
|
30 |
+
"lstrip": false,
|
31 |
+
"normalized": false,
|
32 |
+
"rstrip": false,
|
33 |
+
"single_word": false
|
34 |
+
}
|
35 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,199 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": false,
|
3 |
+
"add_prefix_space": false,
|
4 |
+
"added_tokens_decoder": {
|
5 |
+
"0": {
|
6 |
+
"content": "<|end_of_text|>",
|
7 |
+
"lstrip": false,
|
8 |
+
"normalized": false,
|
9 |
+
"rstrip": false,
|
10 |
+
"single_word": false,
|
11 |
+
"special": true
|
12 |
+
},
|
13 |
+
"1": {
|
14 |
+
"content": "<fim_prefix>",
|
15 |
+
"lstrip": false,
|
16 |
+
"normalized": false,
|
17 |
+
"rstrip": false,
|
18 |
+
"single_word": false,
|
19 |
+
"special": true
|
20 |
+
},
|
21 |
+
"2": {
|
22 |
+
"content": "<fim_middle>",
|
23 |
+
"lstrip": false,
|
24 |
+
"normalized": false,
|
25 |
+
"rstrip": false,
|
26 |
+
"single_word": false,
|
27 |
+
"special": true
|
28 |
+
},
|
29 |
+
"3": {
|
30 |
+
"content": "<fim_suffix>",
|
31 |
+
"lstrip": false,
|
32 |
+
"normalized": false,
|
33 |
+
"rstrip": false,
|
34 |
+
"single_word": false,
|
35 |
+
"special": true
|
36 |
+
},
|
37 |
+
"4": {
|
38 |
+
"content": "<fim_pad>",
|
39 |
+
"lstrip": false,
|
40 |
+
"normalized": false,
|
41 |
+
"rstrip": false,
|
42 |
+
"single_word": false,
|
43 |
+
"special": true
|
44 |
+
},
|
45 |
+
"5": {
|
46 |
+
"content": "<filename>",
|
47 |
+
"lstrip": false,
|
48 |
+
"normalized": false,
|
49 |
+
"rstrip": false,
|
50 |
+
"single_word": false,
|
51 |
+
"special": true
|
52 |
+
},
|
53 |
+
"6": {
|
54 |
+
"content": "<gh_stars>",
|
55 |
+
"lstrip": false,
|
56 |
+
"normalized": false,
|
57 |
+
"rstrip": false,
|
58 |
+
"single_word": false,
|
59 |
+
"special": true
|
60 |
+
},
|
61 |
+
"7": {
|
62 |
+
"content": "<issue_start>",
|
63 |
+
"lstrip": false,
|
64 |
+
"normalized": false,
|
65 |
+
"rstrip": false,
|
66 |
+
"single_word": false,
|
67 |
+
"special": true
|
68 |
+
},
|
69 |
+
"8": {
|
70 |
+
"content": "<issue_comment>",
|
71 |
+
"lstrip": false,
|
72 |
+
"normalized": false,
|
73 |
+
"rstrip": false,
|
74 |
+
"single_word": false,
|
75 |
+
"special": true
|
76 |
+
},
|
77 |
+
"9": {
|
78 |
+
"content": "<issue_closed>",
|
79 |
+
"lstrip": false,
|
80 |
+
"normalized": false,
|
81 |
+
"rstrip": false,
|
82 |
+
"single_word": false,
|
83 |
+
"special": true
|
84 |
+
},
|
85 |
+
"10": {
|
86 |
+
"content": "<jupyter_start>",
|
87 |
+
"lstrip": false,
|
88 |
+
"normalized": false,
|
89 |
+
"rstrip": false,
|
90 |
+
"single_word": false,
|
91 |
+
"special": true
|
92 |
+
},
|
93 |
+
"11": {
|
94 |
+
"content": "<jupyter_text>",
|
95 |
+
"lstrip": false,
|
96 |
+
"normalized": false,
|
97 |
+
"rstrip": false,
|
98 |
+
"single_word": false,
|
99 |
+
"special": true
|
100 |
+
},
|
101 |
+
"12": {
|
102 |
+
"content": "<jupyter_code>",
|
103 |
+
"lstrip": false,
|
104 |
+
"normalized": false,
|
105 |
+
"rstrip": false,
|
106 |
+
"single_word": false,
|
107 |
+
"special": true
|
108 |
+
},
|
109 |
+
"13": {
|
110 |
+
"content": "<jupyter_output>",
|
111 |
+
"lstrip": false,
|
112 |
+
"normalized": false,
|
113 |
+
"rstrip": false,
|
114 |
+
"single_word": false,
|
115 |
+
"special": true
|
116 |
+
},
|
117 |
+
"14": {
|
118 |
+
"content": "<empty_output>",
|
119 |
+
"lstrip": false,
|
120 |
+
"normalized": false,
|
121 |
+
"rstrip": false,
|
122 |
+
"single_word": false,
|
123 |
+
"special": true
|
124 |
+
},
|
125 |
+
"15": {
|
126 |
+
"content": "<commit_before>",
|
127 |
+
"lstrip": false,
|
128 |
+
"normalized": false,
|
129 |
+
"rstrip": false,
|
130 |
+
"single_word": false,
|
131 |
+
"special": true
|
132 |
+
},
|
133 |
+
"16": {
|
134 |
+
"content": "<commit_msg>",
|
135 |
+
"lstrip": false,
|
136 |
+
"normalized": false,
|
137 |
+
"rstrip": false,
|
138 |
+
"single_word": false,
|
139 |
+
"special": true
|
140 |
+
},
|
141 |
+
"17": {
|
142 |
+
"content": "<commit_after>",
|
143 |
+
"lstrip": false,
|
144 |
+
"normalized": false,
|
145 |
+
"rstrip": false,
|
146 |
+
"single_word": false,
|
147 |
+
"special": true
|
148 |
+
},
|
149 |
+
"18": {
|
150 |
+
"content": "<reponame>",
|
151 |
+
"lstrip": false,
|
152 |
+
"normalized": false,
|
153 |
+
"rstrip": false,
|
154 |
+
"single_word": false,
|
155 |
+
"special": true
|
156 |
+
},
|
157 |
+
"49152": {
|
158 |
+
"content": "<|start_of_role|>",
|
159 |
+
"lstrip": false,
|
160 |
+
"normalized": false,
|
161 |
+
"rstrip": false,
|
162 |
+
"single_word": false,
|
163 |
+
"special": true
|
164 |
+
},
|
165 |
+
"49153": {
|
166 |
+
"content": "<|end_of_role|>",
|
167 |
+
"lstrip": false,
|
168 |
+
"normalized": false,
|
169 |
+
"rstrip": false,
|
170 |
+
"single_word": false,
|
171 |
+
"special": true
|
172 |
+
},
|
173 |
+
"49154": {
|
174 |
+
"content": "<|tool_call|>",
|
175 |
+
"lstrip": false,
|
176 |
+
"normalized": false,
|
177 |
+
"rstrip": false,
|
178 |
+
"single_word": false,
|
179 |
+
"special": true
|
180 |
+
}
|
181 |
+
},
|
182 |
+
"additional_special_tokens": [
|
183 |
+
"<|start_of_role|>",
|
184 |
+
"<|end_of_role|>",
|
185 |
+
"<|tool_call|>"
|
186 |
+
],
|
187 |
+
"bos_token": "<|end_of_text|>",
|
188 |
+
"chat_template": "{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content'] %}\n {%- set loop_messages = messages[1:] %}\n{%- else %}\n {%- set system_message = \"Knowledge Cutoff Date: April 2024.\nToday's Date: \" + strftime_now('%B %d, %Y') + \".\nYou are Granite, developed by IBM.\" %}\n {%- if tools and documents %}\n {%- set system_message = system_message + \" You are a helpful AI assistant with access to the following tools. When a tool is required to answer the user's query, respond with <|tool_call|> followed by a JSON list of tools used. If a tool does not exist in the provided list of tools, notify the user that you do not have the ability to fulfill the request.\n\nWrite the response to the user's input by strictly aligning with the facts in the provided documents. If the information needed to answer the question is not available in the documents, inform the user that the question cannot be answered based on the available data.\" %}\n {%- elif tools %}\n {%- set system_message = system_message + \" You are a helpful AI assistant with access to the following tools. When a tool is required to answer the user's query, respond with <|tool_call|> followed by a JSON list of tools used. If a tool does not exist in the provided list of tools, notify the user that you do not have the ability to fulfill the request.\" %}\n {%- elif documents %}\n {%- set system_message = system_message + \" Write the response to the user's input by strictly aligning with the facts in the provided documents. If the information needed to answer the question is not available in the documents, inform the user that the question cannot be answered based on the available data.\" %}\n {%- elif thinking %}\n {%- set system_message = system_message + \" You are a helpful AI assistant.\nRespond to every user query in a comprehensive and detailed way. You can write down your thoughts and reasoning process before responding. In the thought process, engage in a comprehensive cycle of analysis, summarization, exploration, reassessment, reflection, backtracing, and iteration to develop well-considered thinking process. In the response section, based on various attempts, explorations, and reflections from the thoughts section, systematically present the final solution that you deem correct. The response should summarize the thought process. Write your thoughts after 'Here is my thought process:' and write your response after 'Here is my response:' for each user query.\" %}\n {%- else %}\n {%- set system_message = system_message + \" You are a helpful AI assistant.\" %} \n {%- endif %}\n {%- if 'citations' in controls and documents %}\n {%- set system_message = system_message + '\n\nIn your response, use the symbols <co> and </co> to indicate when a fact comes from a document in the search result, e.g <co>0</co> for a fact from document 0. Afterwards, list all the citations with their corresponding documents in an ordered list.' %}\n {%- endif %}\n {%- if 'hallucinations' in controls and documents %}\n {%- set system_message = system_message + '\n\nFinally, after the response is written, include a numbered list of sentences from the response that are potentially hallucinated and not based in the documents.' %}\n {%- endif %}\n {%- set loop_messages = messages %}\n{%- endif %}\n{{- '<|start_of_role|>system<|end_of_role|>' + system_message + '<|end_of_text|>\n' }}\n{%- if tools %}\n {{- '<|start_of_role|>tools<|end_of_role|>' }}\n {{- tools | tojson(indent=4) }}\n {{- '<|end_of_text|>\n' }}\n{%- endif %}\n{%- if documents %}\n {{- '<|start_of_role|>documents<|end_of_role|>' }}\n {%- for document in documents %}\n {{- 'Document ' + loop.index0 | string + '\n' }}\n {{- document['text'] }}\n {%- if not loop.last %}\n {{- '\n\n'}}\n {%- endif%}\n {%- endfor %}\n {{- '<|end_of_text|>\n' }}\n{%- endif %}\n{%- for message in loop_messages %}\n {{- '<|start_of_role|>' + message['role'] + '<|end_of_role|>' + message['content'] + '<|end_of_text|>\n' }}\n {%- if loop.last and add_generation_prompt %}\n {{- '<|start_of_role|>assistant' }}\n {%- if controls %}\n {{- ' ' + controls | tojson()}}\n {%- endif %}\n {{- '<|end_of_role|>' }}\n {%- endif %}\n{%- endfor %}",
|
189 |
+
"clean_up_tokenization_spaces": true,
|
190 |
+
"eos_token": "<|end_of_text|>",
|
191 |
+
"errors": "replace",
|
192 |
+
"extra_special_tokens": {},
|
193 |
+
"model_max_length": 9223372036854775807,
|
194 |
+
"pad_token": "<|end_of_text|>",
|
195 |
+
"padding_side": "left",
|
196 |
+
"tokenizer_class": "GPT2Tokenizer",
|
197 |
+
"unk_token": "<|end_of_text|>",
|
198 |
+
"vocab_size": 49152
|
199 |
+
}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|