Upload 10 files
Browse files- README.md +373 -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,373 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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-8b-instruct
|
11 |
+
---
|
12 |
+
|
13 |
+
# Granite-3.2-8B-Instruct
|
14 |
+
|
15 |
+
**Model Summary:**
|
16 |
+
Granite-3.2-8B-Instruct is an 8-billion-parameter, long-context AI model fine-tuned for thinking capabilities. Built on top of [Granite-3.1-8B-Instruct](https://huggingface.co/ibm-granite/granite-3.1-8b-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-8B-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-8b-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. We know we start with 10 liters of a 30% acid solution, so there's 3 liters of pure acid in it (10 liters * 0.3).
|
91 |
+
2. We need to determine how much of the 70% acid solution to add such that the final mixture is 50% acid.
|
92 |
+
3. Let's say x liters of the 70% acid solution are added. This will contribute 0.7x liters of pure acid.
|
93 |
+
4. The total volume of the new mixture will be 10 + x liters, and the total amount of pure acid will be 3 + 0.7x liters.
|
94 |
+
5. We need to set up an equation where (3 + 0.7x) / (10 + x) = 0.5 (since we want a 50% acid mixture).
|
95 |
+
6. Solving this equation for x will give us the volume of 70% solution needed.
|
96 |
+
|
97 |
+
Here is my response:
|
98 |
+
|
99 |
+
To solve this, we need to set up an equation based on the concentration of acid before and after mixing.
|
100 |
+
|
101 |
+
1. **Initial Acid Content**:
|
102 |
+
- We start with 10 liters of a 30% acid solution.
|
103 |
+
- Pure acid in this = 10 * 0.3 = 3 liters.
|
104 |
+
|
105 |
+
2. **Variable for Addition**:
|
106 |
+
- Let x be the liters of 70% acid solution to be added.
|
107 |
+
- Pure acid in x liters of 70% solution = 0.7x liters.
|
108 |
+
|
109 |
+
3. **Final Mixture Concentration**:
|
110 |
+
- Total volume of mixture = 10 + x liters.
|
111 |
+
- Total pure acid in the mixture = 3 (from initial solution) + 0.7x (from added solution).
|
112 |
+
|
113 |
+
4. **Setting up the equation for 50% acid concentration**:
|
114 |
+
- We require that the ratio of pure acid to total volume is 0.5 (50%).
|
115 |
+
- Therefore, the equation is:
|
116 |
+
|
117 |
+
\[
|
118 |
+
\frac{3 + 0.7x}{10 + x} = 0.5
|
119 |
+
\]
|
120 |
+
|
121 |
+
5. **Solving the equation**:
|
122 |
+
|
123 |
+
Multiply both sides by (10 + x) to clear the fraction:
|
124 |
+
|
125 |
+
\[
|
126 |
+
3 + 0.7x = 0.5(10 + x)
|
127 |
+
\]
|
128 |
+
|
129 |
+
Expanding the right side:
|
130 |
+
|
131 |
+
\[
|
132 |
+
3 + 0.7x = 5 + 0.5x
|
133 |
+
\]
|
134 |
+
|
135 |
+
Subtract 0.5x from both sides:
|
136 |
+
|
137 |
+
\[
|
138 |
+
3 + 0.2x = 5
|
139 |
+
\]
|
140 |
+
|
141 |
+
Subtract 3 from both sides:
|
142 |
+
|
143 |
+
\[
|
144 |
+
0.2x = 2
|
145 |
+
\]
|
146 |
+
|
147 |
+
Divide by 0.2:
|
148 |
+
|
149 |
+
\[
|
150 |
+
x = 10
|
151 |
+
\]
|
152 |
+
|
153 |
+
So, 10 liters of the 70% acid solution must be added to the initial 10 liters of 30% solution to get a 50% acid mixture.
|
154 |
+
|
155 |
+
Let's verify:
|
156 |
+
|
157 |
+
- Initial acid: 3 liters
|
158 |
+
- Acid from added solution: 0.7 * 10 = 7 liters
|
159 |
+
- Total acid: 3 + 7 = 10 liters
|
160 |
+
- Total volume: 10 + 10 = 20 liters
|
161 |
+
- Acid percentage: \(\frac{10}{20} = 0.5 = 50\%\)
|
162 |
+
|
163 |
+
This confirms our solution.
|
164 |
+
|
165 |
+
Final answer: 10 liters of 70% acid solution should be added.
|
166 |
+
```
|
167 |
+
- thinking=False
|
168 |
+
```md
|
169 |
+
Let's denote the amount of 70% acid solution to be added as x liters.
|
170 |
+
|
171 |
+
We start with 10 liters of a 30% acid solution, which means there are 0.3 * 10 = 3 liters of pure acid in it.
|
172 |
+
|
173 |
+
We want to end up with a 50% acid solution after adding x liters of 70% acid solution. The total volume of the mixture will be 10 + x liters, and we want half of this volume to be pure acid.
|
174 |
+
|
175 |
+
So, the amount of pure acid in the final mixture should be 0.5 * (10 + x) liters.
|
176 |
+
|
177 |
+
The amount of pure acid in the final mixture comes from two sources: the original 30% solution and the added 70% solution. So, we can set up the following equation:
|
178 |
+
|
179 |
+
3 (from the original solution) + 0.7x (from the added solution) = 0.5 * (10 + x)
|
180 |
+
|
181 |
+
Now, let's solve for x:
|
182 |
+
|
183 |
+
3 + 0.7x = 5 + 0.5x
|
184 |
+
0.7x - 0.5x = 5 - 3
|
185 |
+
0.2x = 2
|
186 |
+
x = 2 / 0.2
|
187 |
+
x = 10
|
188 |
+
|
189 |
+
So, you need to add 10 liters of a 70% acid solution to the 10 liters of a 30% acid solution to get a 50% acid mixture.
|
190 |
+
```
|
191 |
+
|
192 |
+
**Evaluation Results:**
|
193 |
+
<table>
|
194 |
+
|
195 |
+
<thead>
|
196 |
+
<tr>
|
197 |
+
<th style="text-align:left; background-color: #001d6c; color: white;">Models</th>
|
198 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">ArenaHard</th>
|
199 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">Alpaca-Eval-2</th>
|
200 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">MMLU</th>
|
201 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">PopQA</th>
|
202 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">TruthfulQA</th>
|
203 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">BigBenchHard</th>
|
204 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">DROP</th>
|
205 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">GSM8K</th>
|
206 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">HumanEval</th>
|
207 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">HumanEval+</th>
|
208 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">IFEval</th>
|
209 |
+
<th style="text-align:center; background-color: #001d6c; color: white;">AttaQ</th>
|
210 |
+
</tr></thead>
|
211 |
+
<tbody>
|
212 |
+
<tr>
|
213 |
+
<td style="text-align:left; background-color: #DAE8FF; color: black;">Llama-3.1-8B-Instruct</td>
|
214 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">36.43</td>
|
215 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">27.22</td>
|
216 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">69.15</td>
|
217 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">28.79</td>
|
218 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">52.79</td>
|
219 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">72.66</td>
|
220 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">61.48</td>
|
221 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">83.24</td>
|
222 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">85.32</td>
|
223 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">80.15</td>
|
224 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">79.10</td>
|
225 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">83.43</td>
|
226 |
+
</tr>
|
227 |
+
|
228 |
+
<tr>
|
229 |
+
<td style="text-align:left; background-color: #DAE8FF; color: black;">DeepSeek-R1-Distill-Llama-8B</td>
|
230 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">17.17</td>
|
231 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">21.85</td>
|
232 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">45.80</td>
|
233 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">13.25</td>
|
234 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">47.43</td>
|
235 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">65.71</td>
|
236 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">44.46</td>
|
237 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">72.18</td>
|
238 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">67.54</td>
|
239 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">62.91</td>
|
240 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">66.50</td>
|
241 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">42.87</td>
|
242 |
+
</tr>
|
243 |
+
|
244 |
+
<tr>
|
245 |
+
<td style="text-align:left; background-color: #DAE8FF; color: black;">Qwen-2.5-7B-Instruct</td>
|
246 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">25.44</td>
|
247 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">30.34</td>
|
248 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">74.30</td>
|
249 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">18.12</td>
|
250 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">63.06</td>
|
251 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">70.40</td>
|
252 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">54.71</td>
|
253 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">84.46</td>
|
254 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">93.35</td>
|
255 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">89.91</td>
|
256 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">74.90</td>
|
257 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">81.90</td>
|
258 |
+
</tr>
|
259 |
+
|
260 |
+
<tr>
|
261 |
+
<td style="text-align:left; background-color: #DAE8FF; color: black;">DeepSeek-R1-Distill-Qwen-7B</td>
|
262 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">10.36</td>
|
263 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">15.35</td>
|
264 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">50.72</td>
|
265 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">9.94</td>
|
266 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">47.14</td>
|
267 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">65.04</td>
|
268 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">42.76</td>
|
269 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">78.47</td>
|
270 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">79.89</td>
|
271 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">78.43</td>
|
272 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">59.10</td>
|
273 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">42.45</td>
|
274 |
+
</tr>
|
275 |
+
|
276 |
+
<tr>
|
277 |
+
<td style="text-align:left; background-color: #DAE8FF; color: black;">Granite-3.1-8B-Instruct</td>
|
278 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">37.58</td>
|
279 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">30.34</td>
|
280 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">66.77</td>
|
281 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">28.7</td>
|
282 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">65.84</td>
|
283 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">68.55</td>
|
284 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">50.78</td>
|
285 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">79.15</td>
|
286 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">89.63</td>
|
287 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">85.79</td>
|
288 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">73.20</td>
|
289 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">85.73</td>
|
290 |
+
</tr>
|
291 |
+
|
292 |
+
|
293 |
+
<tr>
|
294 |
+
<td style="text-align:left; background-color: #DAE8FF; color: black;">Granite-3.1-2B-Instruct</td>
|
295 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">23.3</td>
|
296 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">27.17</td>
|
297 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">57.11</td>
|
298 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">20.55</td>
|
299 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">59.79</td>
|
300 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">54.46</td>
|
301 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">18.68</td>
|
302 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">67.55</td>
|
303 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">79.45</td>
|
304 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">75.26</td>
|
305 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">63.59</td>
|
306 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">84.7</td>
|
307 |
+
</tr>
|
308 |
+
|
309 |
+
|
310 |
+
<tr>
|
311 |
+
<td style="text-align:left; background-color: #DAE8FF; color: black;">Granite-3.2-2B-Instruct</td>
|
312 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">24.86</td>
|
313 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">34.51</td>
|
314 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">57.18</td>
|
315 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">20.56</td>
|
316 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">59.8</td>
|
317 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">52.27</td>
|
318 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">21.12</td>
|
319 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">67.02</td>
|
320 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">80.13</td>
|
321 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">73.39</td>
|
322 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">61.55</td>
|
323 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">83.23</td>
|
324 |
+
</tr>
|
325 |
+
|
326 |
+
<tr>
|
327 |
+
<td style="text-align:left; background-color: #DAE8FF; color: black;"><b>Granite-3.2-8B-Instruct</b></td>
|
328 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">55.25</td>
|
329 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">61.19</td>
|
330 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">66.79</td>
|
331 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">28.04</td>
|
332 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">66.92</td>
|
333 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">64.77</td>
|
334 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">50.95</td>
|
335 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">81.65</td>
|
336 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">89.35</td>
|
337 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">85.72</td>
|
338 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">74.31</td>
|
339 |
+
<td style="text-align:center; background-color: #DAE8FF; color: black;">85.42</td>
|
340 |
+
|
341 |
+
</tr>
|
342 |
+
|
343 |
+
|
344 |
+
|
345 |
+
</tbody></table>
|
346 |
+
|
347 |
+
**Training Data:**
|
348 |
+
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.
|
349 |
+
<!-- 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). -->
|
350 |
+
|
351 |
+
**Infrastructure:**
|
352 |
+
We train Granite-3.2-8B-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.
|
353 |
+
|
354 |
+
**Ethical Considerations and Limitations:**
|
355 |
+
Granite-3.2-8B-Instruct builds upon Granite-3.1-8B-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-8B-Instruct](https://huggingface.co/ibm-granite/granite-3.1-8b-instruct) remain relevant.
|
356 |
+
|
357 |
+
|
358 |
+
**Resources**
|
359 |
+
- ⭐️ Learn about the latest updates with Granite: https://www.ibm.com/granite
|
360 |
+
- 📄 Get started with tutorials, best practices, and prompt engineering advice: https://www.ibm.com/granite/docs/
|
361 |
+
- 💡 Learn about the latest Granite learning resources: https://ibm.biz/granite-learning-resources
|
362 |
+
|
363 |
+
<!-- ## Citation
|
364 |
+
```
|
365 |
+
@misc{granite-models,
|
366 |
+
author = {author 1, author2, ...},
|
367 |
+
title = {},
|
368 |
+
journal = {},
|
369 |
+
volume = {},
|
370 |
+
year = {2024},
|
371 |
+
url = {https://arxiv.org/abs/0000.00000},
|
372 |
+
}
|
373 |
+
``` -->
|
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/8b/exp_10/iter4/dpo",
|
3 |
+
"architectures": [
|
4 |
+
"GraniteForCausalLM"
|
5 |
+
],
|
6 |
+
"attention_bias": false,
|
7 |
+
"attention_dropout": 0.0,
|
8 |
+
"attention_multiplier": 0.0078125,
|
9 |
+
"bos_token_id": 0,
|
10 |
+
"embedding_multiplier": 12.0,
|
11 |
+
"eos_token_id": 0,
|
12 |
+
"hidden_act": "silu",
|
13 |
+
"hidden_size": 4096,
|
14 |
+
"initializer_range": 0.02,
|
15 |
+
"intermediate_size": 12800,
|
16 |
+
"logits_scaling": 16.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": 10000000.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:a092b74df80a7e39e6f20f2487a3b315afaff1106e7afe63f7a5b5664b4f9189
|
3 |
+
size 4547746318
|
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
|
|