Prince-1 commited on
Commit
47f3a01
·
verified ·
1 Parent(s): 345ea92

Add files using upload-large-folder tool

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
+ model.onnx.data filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,431 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pipeline_tag: text-generation
3
+ inference: false
4
+ license: apache-2.0
5
+ library_name: onnxruntime_genai
6
+ tags:
7
+ - language
8
+ - granite-3.3
9
+ - onnxruntime_genai
10
+ base_model:
11
+ - Prince-1/Granite-3.3-8B-Instruct-Onnx
12
+ ---
13
+
14
+ # Granite-3.3-8B-Instruct
15
+
16
+ **Model Summary:**
17
+ Granite-3.3-8B-Instruct is a 8-billion parameter 128K context length language model fine-tuned for improved reasoning and instruction-following capabilities. Built on top of Granite-3.3-8B-Base, the model delivers significant gains on benchmarks for measuring generic performance including AlpacaEval-2.0 and Arena-Hard, and improvements in mathematics, coding, and instruction following. It supports structured reasoning through \<think\>\<\/think\> and \<response\>\<\/response\> tags, providing clear separation between internal thoughts and final outputs. The model has been trained on a carefully balanced combination of permissively licensed data and curated synthetic tasks.
18
+
19
+ - **Developers:** Granite Team, IBM
20
+ - **Website**: [Granite Docs](https://www.ibm.com/granite/docs/)
21
+ - **Release Date**: April 16th, 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
+ <!-- * Fill-in-the-middle -->
41
+ * Long-context tasks including long document/meeting summarization, long document QA, etc.
42
+
43
+
44
+ **Generation:**
45
+ This is a simple example of how to use Granite-3.3-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.3-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":"Redesign a common household item to make it more sustainable and user-friendly. Explain the changes and their benefits."}]
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
+ <think>To address this prompt, I'll focus on redesigning a common household item: the plastic water bottle. The goal is to make it more sustainable and user-friendly. Here are the proposed changes and their benefits:
89
+
90
+ 1. **Material**: Replace plastic with biodegradable or recyclable materials like glass or plant-based plastics (PLA).
91
+ 2. **Design**: Introduce a modular design for easy refilling and cleaning.
92
+ 3. **Functionality**: Incorporate a built-in water filter for purification.
93
+ 4. **Durability**: Enhance the bottle's lifespan through robust construction.
94
+ 5. **User-friendliness**: Simplify the cap mechanism for easy opening and closing.
95
+
96
+ These changes would significantly reduce plastic waste, promote recycling, ensure access to clean drinking water, and enhance the overall user experience.
97
+
98
+ Now, I will detail each change and its benefits in a structured format.</think>
99
+
100
+ <response>### Redesign of the Plastic Water Bottle for Sustainability and User-Friendliness
101
+
102
+ #### 1. Material: Biodegradable or Recyclable Alternatives
103
+
104
+ **Change**: Transition from traditional PET plastic to glass or plant-based plastics (Polylactic Acid - PLA).
105
+
106
+ **Benefits**:
107
+ - **Sustainability**: Glass and PLA are biodegradable or highly recyclable, drastically reducing plastic pollution.
108
+ - **Health**: Unlike PET, these materials do not leach chemicals into the water, ensuring safer consumption.
109
+
110
+ #### 2. Modular Design for Easy Refilling and Cleaning
111
+
112
+ **Change**: Implement a detachable, interchangeable inner liner within a reusable outer casing.
113
+
114
+ **Benefits**:
115
+ - **User-Friendliness**: Users can easily remove the inner liner for thorough cleaning, reducing the risk of bacterial growth.
116
+ - **Sustainability**: The outer casing remains intact, encouraging reuse, while the inner liner can be replaced or recycled when worn out.
117
+
118
+ #### 3. Built-in Water Filter
119
+
120
+ **Change**: Integrate a removable, replaceable water filter into the bottle cap.
121
+
122
+ **Benefits**:
123
+ - **Accessibility**: Provides clean drinking water directly from any source (tap, river, etc.), eliminating the need for additional filtration devices.
124
+ - **Health**: Removes contaminants, bacteria, and impurities, ensuring safe hydration.
125
+ - **Sustainability**: Reduces the use of single-use plastic water bottles by offering a purification solution within a reusable container.
126
+
127
+ #### 4. Enhanced Durability
128
+
129
+ **Change**: Use high-quality, durable materials and robust construction techniques for both the outer casing and inner liner.
130
+
131
+ **Benefits**:
132
+ - **Longevity**: A more robust design increases the bottle's lifespan, reducing the frequency of replacements.
133
+ - **Cost-effectiveness**: Although the initial cost might be higher, the long-term savings from reduced replacements make it economical.
134
+ - **Sustainability**: Less frequent disposal means lower environmental impact.
135
+
136
+ #### 5. Simplified Cap Mechanism
137
+
138
+ **Change**: Adopt a one-touch, easy-to-open and close cap design, possibly inspired by sports bottle caps.
139
+
140
+ **Benefits**:
141
+ - **User-Friendliness**: Especially beneficial for children, elderly, or those with limited hand dexterity.
142
+ - **Convenience**: Quick access to water encourages more frequent hydration, promoting healthier habits.
143
+
144
+ ### Conclusion
145
+
146
+ This redesigned water bottle addresses key sustainability concerns by minimizing plastic use and waste, while also enhancing user-friendliness through improved functionality, durability, and accessibility. By integrating biodegradable materials, a modular design, a built-in filter, robust construction, and a simple cap mechanism, the bottle not only reduces environmental footprint but also offers a superior user experience.</response>
147
+ ```
148
+ - thinking=False
149
+ ```md
150
+ Item for Redesign: Plastic Bottle (e.g., water or beverage bottle)
151
+
152
+ Redesign Concept: Eco-Friendly, Modular, and Multi-Functional Reusable Bottle
153
+
154
+ Changes:
155
+
156
+ 1. Material: Replace the conventional plastic with food-grade, BPA-free, and recyclable materials such as stainless steel or glass. These materials are durable, non-toxic, and have a longer lifespan, reducing waste.
157
+
158
+ 2. Modular Design: Introduce a modular design that allows users to customize their bottle according to their needs. This could include interchangeable caps, mouthpiece sizes, and carrying loops. Users can purchase additional modules as needed, promoting a more sustainable approach by reducing the need to buy an entirely new bottle for different purposes.
159
+
160
+ 3. Integrated Filter: Incorporate a built-in, washable, and reusable filter that can remove impurities and improve the taste of water. This eliminates the need for single-use disposable filters or bottled water, further reducing plastic waste.
161
+
162
+ 4. Smart Cap: Develop a smart cap with a built-in digital display and temperature sensor. This feature allows users to track their daily water intake, set hydration goals, and monitor the temperature of their beverage. The smart cap can be synced with a mobile app for additional functionality, such as reminders and progress tracking.
163
+
164
+ 5. Easy-to-Clean Design: Ensure the bottle has a wide mouth and smooth interior surfaces for easy cleaning. Include a brush for hard-to-reach areas, making maintenance simple and encouraging regular use.
165
+
166
+ 6. Collapsible Structure: Implement a collapsible design that reduces the bottle's volume when not in use, making it more portable and convenient for storage.
167
+
168
+ Benefits:
169
+
170
+ 1. Sustainability: By using recyclable materials and reducing plastic waste, this redesigned bottle significantly contributes to a more sustainable lifestyle. The modular design and reusable filter also minimize single-use plastic consumption.
171
+
172
+ 2. User-Friendly: The smart cap, easy-to-clean design, and collapsible structure make the bottle convenient and user-friendly. Users can customize their bottle to suit their needs, ensuring a better overall experience.
173
+
174
+ 3. Healthier Option: Using food-grade, BPA-free materials and an integrated filter ensures that the beverages consumed are free from harmful chemicals and impurities, promoting a healthier lifestyle.
175
+
176
+ 4. Cost-Effective: Although the initial investment might be higher, the long-term savings from reduced purchases of single-use plastic bottles and disposable filters make this reusable bottle a cost-effective choice.
177
+
178
+ 5. Encourages Hydration: The smart cap's features, such as hydration tracking and temperature monitoring, can motivate users to stay hydrated and develop healthier habits.
179
+
180
+ By redesigning a common household item like the plastic bottle, we can create a more sustainable, user-friendly, and health-conscious alternative that benefits both individuals and the environment.
181
+ ```
182
+
183
+ **Evaluation Results:**
184
+ <table>
185
+ <thead>
186
+ <caption style="text-align:center"><b>Comparison with different models over various benchmarks<sup id="fnref1"><a href="#fn1">1</a></sup>. Scores of AlpacaEval-2.0 and Arena-Hard are calculated with thinking=True</b></caption>
187
+ <tr>
188
+ <th style="text-align:left; background-color: #001d6c; color: white;">Models</th>
189
+ <th style="text-align:center; background-color: #001d6c; color: white;">Arena-Hard</th>
190
+ <th style="text-align:center; background-color: #001d6c; color: white;">AlpacaEval-2.0</th>
191
+ <th style="text-align:center; background-color: #001d6c; color: white;">MMLU</th>
192
+ <th style="text-align:center; background-color: #001d6c; color: white;">PopQA</th>
193
+ <th style="text-align:center; background-color: #001d6c; color: white;">TruthfulQA</th>
194
+ <th style="text-align:center; background-color: #001d6c; color: white;">BigBenchHard<sup id="fnref2"><a href="#fn2">2</a></sup></th>
195
+ <th style="text-align:center; background-color: #001d6c; color: white;">DROP<sup id="fnref3"><a href="#fn3">3</a></sup></th>
196
+ <th style="text-align:center; background-color: #001d6c; color: white;">GSM8K</th>
197
+ <th style="text-align:center; background-color: #001d6c; color: white;">HumanEval</th>
198
+ <th style="text-align:center; background-color: #001d6c; color: white;">HumanEval+</th>
199
+ <th style="text-align:center; background-color: #001d6c; color: white;">IFEval</th>
200
+ <th style="text-align:center; background-color: #001d6c; color: white;">AttaQ</th>
201
+ </tr></thead>
202
+ <tbody>
203
+ <tr>
204
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Granite-3.1-2B-Instruct</td>
205
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">23.3</td>
206
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">27.17</td>
207
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">57.11</td>
208
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">20.55</td>
209
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">59.79</td>
210
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">61.82</td>
211
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">20.99</td>
212
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">67.55</td>
213
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">79.45</td>
214
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">75.26</td>
215
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">63.59</td>
216
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">84.7</td>
217
+ </tr>
218
+ <tr>
219
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Granite-3.2-2B-Instruct</td>
220
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">24.86</td>
221
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">34.51</td>
222
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">57.18</td>
223
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">20.56</td>
224
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">59.8</td>
225
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">61.39</td>
226
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">23.84</td>
227
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">67.02</td>
228
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">80.13</td>
229
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">73.39</td>
230
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">61.55</td>
231
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">83.23</td>
232
+ </tr>
233
+ <tr>
234
+ <td style="text-align:left; background-color: #DAE8FF; color: black;"><b>Granite-3.3-2B-Instruct</b></td>
235
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 28.86 </td>
236
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 43.45 </td>
237
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 55.88 </td>
238
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 18.4 </td>
239
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 58.97 </td>
240
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 63.91 </td>
241
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 44.33 </td>
242
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 72.48 </td>
243
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 80.51 </td>
244
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 75.68 </td>
245
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 65.8 </td>
246
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">87.47</td>
247
+ </tr>
248
+
249
+ <tr>
250
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Llama-3.1-8B-Instruct</td>
251
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">36.43</td>
252
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">27.22</td>
253
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">69.15</td>
254
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">28.79</td>
255
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">52.79</td>
256
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">73.43</td>
257
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">71.23</td>
258
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">83.24</td>
259
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">85.32</td>
260
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">80.15</td>
261
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">79.10</td>
262
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">83.43</td>
263
+ </tr>
264
+
265
+ <tr>
266
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">DeepSeek-R1-Distill-Llama-8B</td>
267
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">17.17</td>
268
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">21.85</td>
269
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">45.80</td>
270
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">13.25</td>
271
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">47.43</td>
272
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">67.39</td>
273
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">49.73</td>
274
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">72.18</td>
275
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">67.54</td>
276
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">62.91</td>
277
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">66.50</td>
278
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">42.87</td>
279
+ </tr>
280
+
281
+ <tr>
282
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Qwen-2.5-7B-Instruct</td>
283
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">25.44</td>
284
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">30.34</td>
285
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">74.30</td>
286
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">18.12</td>
287
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">63.06</td>
288
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">69.19</td>
289
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">64.06</td>
290
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">84.46</td>
291
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">93.35</td>
292
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">89.91</td>
293
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">74.90</td>
294
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">81.90</td>
295
+ </tr>
296
+
297
+ <tr>
298
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">DeepSeek-R1-Distill-Qwen-7B</td>
299
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">10.36</td>
300
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">15.35</td>
301
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">50.72</td>
302
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">9.94</td>
303
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">47.14</td>
304
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">67.38</td>
305
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">51.78</td>
306
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">78.47</td>
307
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">79.89</td>
308
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">78.43</td>
309
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">59.10</td>
310
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">42.45</td>
311
+ </tr>
312
+ <tr>
313
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Granite-3.1-8B-Instruct</td>
314
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">37.58</td>
315
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">30.34</td>
316
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">66.77</td>
317
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">28.7</td>
318
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">65.84</td>
319
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">69.87</td>
320
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">58.57</td>
321
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">79.15</td>
322
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">89.63</td>
323
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">85.79</td>
324
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">73.20</td>
325
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">85.73</td>
326
+ </tr>
327
+
328
+ <tr>
329
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Granite-3.2-8B-Instruct</td>
330
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">55.25</td>
331
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">61.19</td>
332
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">66.79</td>
333
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">28.04</td>
334
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">66.92</td>
335
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">71.86</td>
336
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">58.29</td>
337
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">81.65</td>
338
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">89.35</td>
339
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">85.72</td>
340
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">74.31</td>
341
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;">84.7</td>
342
+ </tr>
343
+ <tr>
344
+ <td style="text-align:left; background-color: #DAE8FF; color: black;"><b>Granite-3.3-8B-Instruct</b></td>
345
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 57.56 </td>
346
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 62.68 </td>
347
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 65.54 </td>
348
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 26.17 </td>
349
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 66.86 </td>
350
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 69.13 </td>
351
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 59.36 </td>
352
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 80.89 </td>
353
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 89.73 </td>
354
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 86.09 </td>
355
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 74.82 </td>
356
+ <td style="text-align:center; background-color: #DAE8FF; color: black;">88.5</td>
357
+ </tr>
358
+ </tbody></table>
359
+
360
+ <table>
361
+ <caption style="text-align:center"><b>Math Benchmarks</b></caption>
362
+ <thead>
363
+ <tr>
364
+ <th style="text-align:left; background-color: #001d6c; color: white;">Models</th>
365
+ <th style="text-align:center; background-color: #001d6c; color: white;">AIME24</th>
366
+ <th style="text-align:center; background-color: #001d6c; color: white;">MATH-500</th>
367
+ </tr></thead>
368
+ <tbody>
369
+ <tr>
370
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Granite-3.1-2B-Instruct</td>
371
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;"> 0.89 </td>
372
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;"> 35.07 </td>
373
+ </tr>
374
+ <tr>
375
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Granite-3.2-2B-Instruct</td>
376
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;"> 0.89 </td>
377
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;"> 35.54 </td>
378
+ </tr>
379
+ <tr>
380
+ <td style="text-align:left; background-color: #DAE8FF; color: black;"><b>Granite-3.3-2B-Instruct</b></td>
381
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 3.28 </td>
382
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 58.09 </td>
383
+ </tr>
384
+ <tr>
385
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Granite-3.1-8B-Instruct</td>
386
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;"> 1.97 </td>
387
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;"> 48.73 </td>
388
+ </tr>
389
+ <tr>
390
+ <td style="text-align:left; background-color: #FFFFFF; color: #2D2D2D;">Granite-3.2-8B-Instruct</td>
391
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;"> 2.43 </td>
392
+ <td style="text-align:center; background-color: #FFFFFF; color: #2D2D2D;"> 52.8 </td>
393
+ </tr>
394
+ <tr>
395
+ <td style="text-align:left; background-color: #DAE8FF; color: black;"><b>Granite-3.3-8B-Instruct</b></td>
396
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 8.12 </td>
397
+ <td style="text-align:center; background-color: #DAE8FF; color: black;"> 69.02 </td>
398
+ </tr>
399
+ </tbody></table>
400
+
401
+ **Training Data:**
402
+ 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.
403
+ <!-- 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). -->
404
+
405
+ **Infrastructure:**
406
+ We train Granite-3.3-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.
407
+
408
+ **Ethical Considerations and Limitations:**
409
+ Granite-3.3-8B-Instruct builds upon Granite-3.3-8B-Base, 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.3-8B-Base](https://huggingface.co/ibm-granite/granite-3.3-8b-base) remain relevant.
410
+
411
+
412
+ **Resources**
413
+ - ⭐️ Learn about the latest updates with Granite: https://www.ibm.com/granite
414
+ - 📄 Get started with tutorials, best practices, and prompt engineering advice: https://www.ibm.com/granite/docs/
415
+ - 💡 Learn about the latest Granite learning resources: https://github.com/ibm-granite-community/
416
+
417
+ <p><a href="#fnref1" title="Jump back to reference">[1]</a> Evaluated using <a href="https://github.com/allenai/olmes">OLMES</a> (except AttaQ and Arena-Hard scores)</p>
418
+ <p><a href="#fnref2" title="Jump back to reference">[2]</a> Added regex for more efficient asnwer extraction.</a></p>
419
+ <p><a href="#fnref3" title="Jump back to reference">[3]</a> Modified the implementation to handle some of the issues mentioned <a href="https://huggingface.co/blog/open-llm-leaderboard-drop">here</a></p>
420
+ <!-- ## Citation
421
+ <!-- ## Citation
422
+ ```
423
+ @misc{granite-models,
424
+ author = {author 1, author2, ...},
425
+ title = {},
426
+ journal = {},
427
+ volume = {},
428
+ year = {2024},
429
+ url = {https://arxiv.org/abs/0000.00000},
430
+ }
431
+ ``` -->
added_tokens.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "<|end_of_cite|>": 49156,
3
+ "<|end_of_plugin|>": 49158,
4
+ "<|end_of_role|>": 49153,
5
+ "<|start_of_cite|>": 49155,
6
+ "<|start_of_plugin|>": 49157,
7
+ "<|start_of_role|>": 49152,
8
+ "<|tool_call|>": 49154
9
+ }
genai_config.json ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": {
3
+ "bos_token_id": 0,
4
+ "context_length": 131072,
5
+ "decoder": {
6
+ "session_options": {
7
+ "log_id": "onnxruntime-genai",
8
+ "provider_options": []
9
+ },
10
+ "filename": "model.onnx",
11
+ "head_size": 128,
12
+ "hidden_size": 4096,
13
+ "inputs": {
14
+ "input_ids": "input_ids",
15
+ "attention_mask": "attention_mask",
16
+ "position_ids": "position_ids",
17
+ "past_key_names": "past_key_values.%d.key",
18
+ "past_value_names": "past_key_values.%d.value"
19
+ },
20
+ "outputs": {
21
+ "logits": "logits",
22
+ "present_key_names": "present.%d.key",
23
+ "present_value_names": "present.%d.value"
24
+ },
25
+ "num_attention_heads": 32,
26
+ "num_hidden_layers": 40,
27
+ "num_key_value_heads": 8
28
+ },
29
+ "eos_token_id": 0,
30
+ "pad_token_id": 0,
31
+ "type": "granite",
32
+ "vocab_size": 49159
33
+ },
34
+ "search": {
35
+ "diversity_penalty": 0.0,
36
+ "do_sample": false,
37
+ "early_stopping": true,
38
+ "length_penalty": 1.0,
39
+ "max_length": 131072,
40
+ "min_length": 0,
41
+ "no_repeat_ngram_size": 0,
42
+ "num_beams": 1,
43
+ "num_return_sequences": 1,
44
+ "past_present_share_buffer": false,
45
+ "repetition_penalty": 1.0,
46
+ "temperature": 1.0,
47
+ "top_k": 1,
48
+ "top_p": 1.0
49
+ }
50
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f4d8ddc424d677ffeaac314abeb53fd3b3859f1d200a09b62a25fb49256fd4a4
3
+ size 952122
model.onnx.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a0d6b289613807231e23e2370bde15428d31da9f603065e3bed1fa9b027a4e58
3
+ size 16777994240
special_tokens_map.json ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|start_of_role|>",
4
+ "<|end_of_role|>",
5
+ "<|tool_call|>",
6
+ "<|start_of_cite|>",
7
+ "<|end_of_cite|>",
8
+ "<|start_of_plugin|>",
9
+ "<|end_of_plugin|>"
10
+ ],
11
+ "bos_token": {
12
+ "content": "<|end_of_text|>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false
17
+ },
18
+ "eos_token": {
19
+ "content": "<|end_of_text|>",
20
+ "lstrip": false,
21
+ "normalized": false,
22
+ "rstrip": false,
23
+ "single_word": false
24
+ },
25
+ "pad_token": {
26
+ "content": "<|end_of_text|>",
27
+ "lstrip": false,
28
+ "normalized": false,
29
+ "rstrip": false,
30
+ "single_word": false
31
+ },
32
+ "unk_token": {
33
+ "content": "<|end_of_text|>",
34
+ "lstrip": false,
35
+ "normalized": false,
36
+ "rstrip": false,
37
+ "single_word": false
38
+ }
39
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "49155": {
182
+ "content": "<|start_of_cite|>",
183
+ "lstrip": false,
184
+ "normalized": false,
185
+ "rstrip": false,
186
+ "single_word": false,
187
+ "special": true
188
+ },
189
+ "49156": {
190
+ "content": "<|end_of_cite|>",
191
+ "lstrip": false,
192
+ "normalized": false,
193
+ "rstrip": false,
194
+ "single_word": false,
195
+ "special": true
196
+ },
197
+ "49157": {
198
+ "content": "<|start_of_plugin|>",
199
+ "lstrip": false,
200
+ "normalized": false,
201
+ "rstrip": false,
202
+ "single_word": false,
203
+ "special": true
204
+ },
205
+ "49158": {
206
+ "content": "<|end_of_plugin|>",
207
+ "lstrip": false,
208
+ "normalized": false,
209
+ "rstrip": false,
210
+ "single_word": false,
211
+ "special": true
212
+ }
213
+ },
214
+ "additional_special_tokens": [
215
+ "<|start_of_role|>",
216
+ "<|end_of_role|>",
217
+ "<|tool_call|>",
218
+ "<|start_of_cite|>",
219
+ "<|end_of_cite|>",
220
+ "<|start_of_plugin|>",
221
+ "<|end_of_plugin|>"
222
+ ],
223
+ "bos_token": "<|end_of_text|>",
224
+ "chat_template": "{# Alias tools -> available_tools #}\n{%- if tools and not available_tools -%}\n {%- set available_tools = tools -%}\n{%- endif -%}\n{%- 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 available_tools and documents %}\n {%- set system_message = system_message + \" You are a helpful assistant with access to the following tools. When a tool is required to answer the user's query, respond only 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.\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 available_tools %}\n {%- set system_message = system_message + \" You are a helpful assistant with access to the following tools. When a tool is required to answer the user's query, respond only 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 between <think></think> and write your response between <response></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 + '\nUse the symbols <|start_of_cite|> and <|end_of_cite|> to indicate when a fact comes from a document in the search result, e.g <|start_of_cite|> {document_id: 1}my fact <|end_of_cite|> for a fact from document 1. 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 + '\nFinally, after the response is written, include a numbered list of sentences from the response with a corresponding risk value that are 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 available_tools %}\n {{- '<|start_of_role|>available_tools<|end_of_role|>' }}\n {{- available_tools | tojson(indent=4) }}\n {{- '<|end_of_text|>\n' }}\n {%- endif %}\n {%- if documents %}\n {%- for document in documents %}\n {{- '<|start_of_role|>document {\"document_id\": \"' + document['doc_id'] | string + '\"}<|end_of_role|>\n' }}\n {{- document['text'] }}\n {{- '<|end_of_text|>\n' }}\n {%- endfor %}\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 %}",
225
+ "clean_up_tokenization_spaces": true,
226
+ "eos_token": "<|end_of_text|>",
227
+ "errors": "replace",
228
+ "extra_special_tokens": {},
229
+ "model_max_length": 9223372036854775807,
230
+ "pad_token": "<|end_of_text|>",
231
+ "padding_side": "left",
232
+ "tokenizer_class": "GPT2Tokenizer",
233
+ "unk_token": "<|end_of_text|>",
234
+ "vocab_size": 49152
235
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff