chenxugz commited on
Commit
69b487a
Β·
verified Β·
1 Parent(s): de65034

Upload deepseek_tflite.ipynb

Browse files
Files changed (1) hide show
  1. deepseek_tflite.ipynb +1146 -29
deepseek_tflite.ipynb CHANGED
@@ -11,6 +11,1036 @@
11
  },
12
  "language_info": {
13
  "name": "python"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  }
15
  },
16
  "cells": [
@@ -33,7 +1063,7 @@
33
  "colab": {
34
  "base_uri": "https://localhost:8080/"
35
  },
36
- "outputId": "7ce4d1ef-7d6b-4855-b73b-22482e3c693d"
37
  },
38
  "execution_count": 1,
39
  "outputs": [
@@ -41,9 +1071,14 @@
41
  "output_type": "stream",
42
  "name": "stdout",
43
  "text": [
44
- "Requirement already satisfied: ai-edge-litert in /usr/local/lib/python3.11/dist-packages (1.1.2)\n",
 
45
  "Requirement already satisfied: flatbuffers in /usr/local/lib/python3.11/dist-packages (from ai-edge-litert) (25.2.10)\n",
46
- "Requirement already satisfied: numpy>=1.23.2 in /usr/local/lib/python3.11/dist-packages (from ai-edge-litert) (1.26.4)\n"
 
 
 
 
47
  ]
48
  }
49
  ]
@@ -80,10 +1115,43 @@
80
  "model_path = hf_hub_download(repo_id=\"litert-community/DeepSeek-R1-Distill-Qwen-1.5B\", filename=\"deepseek_q8_seq128_ekv1280.tflite\")"
81
  ],
82
  "metadata": {
83
- "id": "3t47HAG2tvc3"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  },
85
  "execution_count": 3,
86
- "outputs": []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  },
88
  {
89
  "cell_type": "markdown",
@@ -105,10 +1173,68 @@
105
  "tokenizer = AutoTokenizer.from_pretrained(\"deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B\")"
106
  ],
107
  "metadata": {
108
- "id": "Rvdn3EIZhaQn"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  },
110
  "execution_count": 4,
111
- "outputs": []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  },
113
  {
114
  "cell_type": "markdown",
@@ -122,8 +1248,6 @@
122
  {
123
  "cell_type": "code",
124
  "source": [
125
- "\n",
126
- "\n",
127
  "class LiteRTLlmPipeline:\n",
128
  "\n",
129
  " def __init__(self, interpreter, tokenizer):\n",
@@ -143,7 +1267,6 @@
143
  " - self._max_seq_len: The maximum sequence length supported by the model.\n",
144
  " - self._max_kv_cache_seq_len: The maximum sequence length supported by the\n",
145
  " KV cache.\n",
146
- " - self._num_layers: The number of layers in the model.\n",
147
  "\n",
148
  " Args:\n",
149
  " num_input_tokens: The number of input tokens.\n",
@@ -169,26 +1292,20 @@
169
  " ]\n",
170
  " self._max_kv_cache_seq_len = kv_cache_shape[1]\n",
171
  "\n",
172
- " # The two arguments excluded are `tokens` and `input_pos`. Dividing by 2\n",
173
- " # because each layer has key and value caches.\n",
174
- " self._num_layers = (\n",
175
- " len(self._prefill_runner.get_input_details().keys()) - 2\n",
176
- " ) // 2\n",
177
- "\n",
178
- "\n",
179
  " def _init_kv_cache(self) -> dict[str, np.ndarray]:\n",
180
  " if self._prefill_runner is None:\n",
181
  " raise ValueError(\"Prefill runner is not initialized.\")\n",
182
  " kv_cache = {}\n",
183
- " for i in range(self._num_layers):\n",
184
- " kv_cache[f\"kv_cache_k_{i}\"] = np.zeros(\n",
185
- " self._prefill_runner.get_input_details()[f\"kv_cache_k_{i}\"][\"shape\"],\n",
186
- " dtype=np.float32,\n",
187
- " )\n",
188
- " kv_cache[f\"kv_cache_v_{i}\"] = np.zeros(\n",
189
- " self._prefill_runner.get_input_details()[f\"kv_cache_v_{i}\"][\"shape\"],\n",
190
- " dtype=np.float32,\n",
191
- " )\n",
 
192
  " return kv_cache\n",
193
  "\n",
194
  " def _get_prefill_runner(self, num_input_tokens: int) :\n",
@@ -342,7 +1459,7 @@
342
  "metadata": {
343
  "id": "UBSGrHrM4ANm"
344
  },
345
- "execution_count": 7,
346
  "outputs": []
347
  },
348
  {
@@ -363,13 +1480,13 @@
363
  "metadata": {
364
  "id": "AZhlDQWg61AL"
365
  },
366
- "execution_count": 8,
367
  "outputs": []
368
  },
369
  {
370
  "cell_type": "code",
371
  "source": [
372
- "prompt = \"what is 8 mod 5\"\n",
373
  "output = pipeline.generate(prompt, max_decode_steps = None)"
374
  ],
375
  "metadata": {
 
11
  },
12
  "language_info": {
13
  "name": "python"
14
+ },
15
+ "widgets": {
16
+ "application/vnd.jupyter.widget-state+json": {
17
+ "47cd47140dbb4e28a4f31d5632bfe82d": {
18
+ "model_module": "@jupyter-widgets/controls",
19
+ "model_name": "HBoxModel",
20
+ "model_module_version": "1.5.0",
21
+ "state": {
22
+ "_dom_classes": [],
23
+ "_model_module": "@jupyter-widgets/controls",
24
+ "_model_module_version": "1.5.0",
25
+ "_model_name": "HBoxModel",
26
+ "_view_count": null,
27
+ "_view_module": "@jupyter-widgets/controls",
28
+ "_view_module_version": "1.5.0",
29
+ "_view_name": "HBoxView",
30
+ "box_style": "",
31
+ "children": [
32
+ "IPY_MODEL_7c0ddb1e0e3145f08ccb0c32b02c562f",
33
+ "IPY_MODEL_85c490db972b4d659caad513359a6700",
34
+ "IPY_MODEL_d61e96ae08d84414a638dd592f13fb18"
35
+ ],
36
+ "layout": "IPY_MODEL_9e7f4734aa034e4aa5207b8a2498ee02"
37
+ }
38
+ },
39
+ "7c0ddb1e0e3145f08ccb0c32b02c562f": {
40
+ "model_module": "@jupyter-widgets/controls",
41
+ "model_name": "HTMLModel",
42
+ "model_module_version": "1.5.0",
43
+ "state": {
44
+ "_dom_classes": [],
45
+ "_model_module": "@jupyter-widgets/controls",
46
+ "_model_module_version": "1.5.0",
47
+ "_model_name": "HTMLModel",
48
+ "_view_count": null,
49
+ "_view_module": "@jupyter-widgets/controls",
50
+ "_view_module_version": "1.5.0",
51
+ "_view_name": "HTMLView",
52
+ "description": "",
53
+ "description_tooltip": null,
54
+ "layout": "IPY_MODEL_df08ba8056fb47cb969e132087987e68",
55
+ "placeholder": "​",
56
+ "style": "IPY_MODEL_470febc3af8348ef8611255e88401229",
57
+ "value": "deepseek_q8_seq128_ekv1280.tflite: 100%"
58
+ }
59
+ },
60
+ "85c490db972b4d659caad513359a6700": {
61
+ "model_module": "@jupyter-widgets/controls",
62
+ "model_name": "FloatProgressModel",
63
+ "model_module_version": "1.5.0",
64
+ "state": {
65
+ "_dom_classes": [],
66
+ "_model_module": "@jupyter-widgets/controls",
67
+ "_model_module_version": "1.5.0",
68
+ "_model_name": "FloatProgressModel",
69
+ "_view_count": null,
70
+ "_view_module": "@jupyter-widgets/controls",
71
+ "_view_module_version": "1.5.0",
72
+ "_view_name": "ProgressView",
73
+ "bar_style": "success",
74
+ "description": "",
75
+ "description_tooltip": null,
76
+ "layout": "IPY_MODEL_39cedca11f574c01808acdc1be9aa68d",
77
+ "max": 1808783640,
78
+ "min": 0,
79
+ "orientation": "horizontal",
80
+ "style": "IPY_MODEL_62bd6d393ca74193bded59a8ebd0a749",
81
+ "value": 1808783640
82
+ }
83
+ },
84
+ "d61e96ae08d84414a638dd592f13fb18": {
85
+ "model_module": "@jupyter-widgets/controls",
86
+ "model_name": "HTMLModel",
87
+ "model_module_version": "1.5.0",
88
+ "state": {
89
+ "_dom_classes": [],
90
+ "_model_module": "@jupyter-widgets/controls",
91
+ "_model_module_version": "1.5.0",
92
+ "_model_name": "HTMLModel",
93
+ "_view_count": null,
94
+ "_view_module": "@jupyter-widgets/controls",
95
+ "_view_module_version": "1.5.0",
96
+ "_view_name": "HTMLView",
97
+ "description": "",
98
+ "description_tooltip": null,
99
+ "layout": "IPY_MODEL_475c5c4fc6eb404180d7b69d75f797ea",
100
+ "placeholder": "​",
101
+ "style": "IPY_MODEL_b815fc17c9ee4913b5cb452653ff1af9",
102
+ "value": " 1.81G/1.81G [00:16<00:00, 160MB/s]"
103
+ }
104
+ },
105
+ "9e7f4734aa034e4aa5207b8a2498ee02": {
106
+ "model_module": "@jupyter-widgets/base",
107
+ "model_name": "LayoutModel",
108
+ "model_module_version": "1.2.0",
109
+ "state": {
110
+ "_model_module": "@jupyter-widgets/base",
111
+ "_model_module_version": "1.2.0",
112
+ "_model_name": "LayoutModel",
113
+ "_view_count": null,
114
+ "_view_module": "@jupyter-widgets/base",
115
+ "_view_module_version": "1.2.0",
116
+ "_view_name": "LayoutView",
117
+ "align_content": null,
118
+ "align_items": null,
119
+ "align_self": null,
120
+ "border": null,
121
+ "bottom": null,
122
+ "display": null,
123
+ "flex": null,
124
+ "flex_flow": null,
125
+ "grid_area": null,
126
+ "grid_auto_columns": null,
127
+ "grid_auto_flow": null,
128
+ "grid_auto_rows": null,
129
+ "grid_column": null,
130
+ "grid_gap": null,
131
+ "grid_row": null,
132
+ "grid_template_areas": null,
133
+ "grid_template_columns": null,
134
+ "grid_template_rows": null,
135
+ "height": null,
136
+ "justify_content": null,
137
+ "justify_items": null,
138
+ "left": null,
139
+ "margin": null,
140
+ "max_height": null,
141
+ "max_width": null,
142
+ "min_height": null,
143
+ "min_width": null,
144
+ "object_fit": null,
145
+ "object_position": null,
146
+ "order": null,
147
+ "overflow": null,
148
+ "overflow_x": null,
149
+ "overflow_y": null,
150
+ "padding": null,
151
+ "right": null,
152
+ "top": null,
153
+ "visibility": null,
154
+ "width": null
155
+ }
156
+ },
157
+ "df08ba8056fb47cb969e132087987e68": {
158
+ "model_module": "@jupyter-widgets/base",
159
+ "model_name": "LayoutModel",
160
+ "model_module_version": "1.2.0",
161
+ "state": {
162
+ "_model_module": "@jupyter-widgets/base",
163
+ "_model_module_version": "1.2.0",
164
+ "_model_name": "LayoutModel",
165
+ "_view_count": null,
166
+ "_view_module": "@jupyter-widgets/base",
167
+ "_view_module_version": "1.2.0",
168
+ "_view_name": "LayoutView",
169
+ "align_content": null,
170
+ "align_items": null,
171
+ "align_self": null,
172
+ "border": null,
173
+ "bottom": null,
174
+ "display": null,
175
+ "flex": null,
176
+ "flex_flow": null,
177
+ "grid_area": null,
178
+ "grid_auto_columns": null,
179
+ "grid_auto_flow": null,
180
+ "grid_auto_rows": null,
181
+ "grid_column": null,
182
+ "grid_gap": null,
183
+ "grid_row": null,
184
+ "grid_template_areas": null,
185
+ "grid_template_columns": null,
186
+ "grid_template_rows": null,
187
+ "height": null,
188
+ "justify_content": null,
189
+ "justify_items": null,
190
+ "left": null,
191
+ "margin": null,
192
+ "max_height": null,
193
+ "max_width": null,
194
+ "min_height": null,
195
+ "min_width": null,
196
+ "object_fit": null,
197
+ "object_position": null,
198
+ "order": null,
199
+ "overflow": null,
200
+ "overflow_x": null,
201
+ "overflow_y": null,
202
+ "padding": null,
203
+ "right": null,
204
+ "top": null,
205
+ "visibility": null,
206
+ "width": null
207
+ }
208
+ },
209
+ "470febc3af8348ef8611255e88401229": {
210
+ "model_module": "@jupyter-widgets/controls",
211
+ "model_name": "DescriptionStyleModel",
212
+ "model_module_version": "1.5.0",
213
+ "state": {
214
+ "_model_module": "@jupyter-widgets/controls",
215
+ "_model_module_version": "1.5.0",
216
+ "_model_name": "DescriptionStyleModel",
217
+ "_view_count": null,
218
+ "_view_module": "@jupyter-widgets/base",
219
+ "_view_module_version": "1.2.0",
220
+ "_view_name": "StyleView",
221
+ "description_width": ""
222
+ }
223
+ },
224
+ "39cedca11f574c01808acdc1be9aa68d": {
225
+ "model_module": "@jupyter-widgets/base",
226
+ "model_name": "LayoutModel",
227
+ "model_module_version": "1.2.0",
228
+ "state": {
229
+ "_model_module": "@jupyter-widgets/base",
230
+ "_model_module_version": "1.2.0",
231
+ "_model_name": "LayoutModel",
232
+ "_view_count": null,
233
+ "_view_module": "@jupyter-widgets/base",
234
+ "_view_module_version": "1.2.0",
235
+ "_view_name": "LayoutView",
236
+ "align_content": null,
237
+ "align_items": null,
238
+ "align_self": null,
239
+ "border": null,
240
+ "bottom": null,
241
+ "display": null,
242
+ "flex": null,
243
+ "flex_flow": null,
244
+ "grid_area": null,
245
+ "grid_auto_columns": null,
246
+ "grid_auto_flow": null,
247
+ "grid_auto_rows": null,
248
+ "grid_column": null,
249
+ "grid_gap": null,
250
+ "grid_row": null,
251
+ "grid_template_areas": null,
252
+ "grid_template_columns": null,
253
+ "grid_template_rows": null,
254
+ "height": null,
255
+ "justify_content": null,
256
+ "justify_items": null,
257
+ "left": null,
258
+ "margin": null,
259
+ "max_height": null,
260
+ "max_width": null,
261
+ "min_height": null,
262
+ "min_width": null,
263
+ "object_fit": null,
264
+ "object_position": null,
265
+ "order": null,
266
+ "overflow": null,
267
+ "overflow_x": null,
268
+ "overflow_y": null,
269
+ "padding": null,
270
+ "right": null,
271
+ "top": null,
272
+ "visibility": null,
273
+ "width": null
274
+ }
275
+ },
276
+ "62bd6d393ca74193bded59a8ebd0a749": {
277
+ "model_module": "@jupyter-widgets/controls",
278
+ "model_name": "ProgressStyleModel",
279
+ "model_module_version": "1.5.0",
280
+ "state": {
281
+ "_model_module": "@jupyter-widgets/controls",
282
+ "_model_module_version": "1.5.0",
283
+ "_model_name": "ProgressStyleModel",
284
+ "_view_count": null,
285
+ "_view_module": "@jupyter-widgets/base",
286
+ "_view_module_version": "1.2.0",
287
+ "_view_name": "StyleView",
288
+ "bar_color": null,
289
+ "description_width": ""
290
+ }
291
+ },
292
+ "475c5c4fc6eb404180d7b69d75f797ea": {
293
+ "model_module": "@jupyter-widgets/base",
294
+ "model_name": "LayoutModel",
295
+ "model_module_version": "1.2.0",
296
+ "state": {
297
+ "_model_module": "@jupyter-widgets/base",
298
+ "_model_module_version": "1.2.0",
299
+ "_model_name": "LayoutModel",
300
+ "_view_count": null,
301
+ "_view_module": "@jupyter-widgets/base",
302
+ "_view_module_version": "1.2.0",
303
+ "_view_name": "LayoutView",
304
+ "align_content": null,
305
+ "align_items": null,
306
+ "align_self": null,
307
+ "border": null,
308
+ "bottom": null,
309
+ "display": null,
310
+ "flex": null,
311
+ "flex_flow": null,
312
+ "grid_area": null,
313
+ "grid_auto_columns": null,
314
+ "grid_auto_flow": null,
315
+ "grid_auto_rows": null,
316
+ "grid_column": null,
317
+ "grid_gap": null,
318
+ "grid_row": null,
319
+ "grid_template_areas": null,
320
+ "grid_template_columns": null,
321
+ "grid_template_rows": null,
322
+ "height": null,
323
+ "justify_content": null,
324
+ "justify_items": null,
325
+ "left": null,
326
+ "margin": null,
327
+ "max_height": null,
328
+ "max_width": null,
329
+ "min_height": null,
330
+ "min_width": null,
331
+ "object_fit": null,
332
+ "object_position": null,
333
+ "order": null,
334
+ "overflow": null,
335
+ "overflow_x": null,
336
+ "overflow_y": null,
337
+ "padding": null,
338
+ "right": null,
339
+ "top": null,
340
+ "visibility": null,
341
+ "width": null
342
+ }
343
+ },
344
+ "b815fc17c9ee4913b5cb452653ff1af9": {
345
+ "model_module": "@jupyter-widgets/controls",
346
+ "model_name": "DescriptionStyleModel",
347
+ "model_module_version": "1.5.0",
348
+ "state": {
349
+ "_model_module": "@jupyter-widgets/controls",
350
+ "_model_module_version": "1.5.0",
351
+ "_model_name": "DescriptionStyleModel",
352
+ "_view_count": null,
353
+ "_view_module": "@jupyter-widgets/base",
354
+ "_view_module_version": "1.2.0",
355
+ "_view_name": "StyleView",
356
+ "description_width": ""
357
+ }
358
+ },
359
+ "8cac4d03da1044d6adb8b62752ed6775": {
360
+ "model_module": "@jupyter-widgets/controls",
361
+ "model_name": "HBoxModel",
362
+ "model_module_version": "1.5.0",
363
+ "state": {
364
+ "_dom_classes": [],
365
+ "_model_module": "@jupyter-widgets/controls",
366
+ "_model_module_version": "1.5.0",
367
+ "_model_name": "HBoxModel",
368
+ "_view_count": null,
369
+ "_view_module": "@jupyter-widgets/controls",
370
+ "_view_module_version": "1.5.0",
371
+ "_view_name": "HBoxView",
372
+ "box_style": "",
373
+ "children": [
374
+ "IPY_MODEL_a201091e2f9b4f6c8a7d780dde854134",
375
+ "IPY_MODEL_16e2c22fb42e41e8b810c4e659091d37",
376
+ "IPY_MODEL_a1f5e814104646cbac5db19fdbcfccb2"
377
+ ],
378
+ "layout": "IPY_MODEL_3186fb1553884a7da72a387f1e00eca5"
379
+ }
380
+ },
381
+ "a201091e2f9b4f6c8a7d780dde854134": {
382
+ "model_module": "@jupyter-widgets/controls",
383
+ "model_name": "HTMLModel",
384
+ "model_module_version": "1.5.0",
385
+ "state": {
386
+ "_dom_classes": [],
387
+ "_model_module": "@jupyter-widgets/controls",
388
+ "_model_module_version": "1.5.0",
389
+ "_model_name": "HTMLModel",
390
+ "_view_count": null,
391
+ "_view_module": "@jupyter-widgets/controls",
392
+ "_view_module_version": "1.5.0",
393
+ "_view_name": "HTMLView",
394
+ "description": "",
395
+ "description_tooltip": null,
396
+ "layout": "IPY_MODEL_875fbcb976bf486092d3c6f483b9e042",
397
+ "placeholder": "​",
398
+ "style": "IPY_MODEL_e2a24c0c90b149508715998b1cf301f7",
399
+ "value": "tokenizer_config.json: 100%"
400
+ }
401
+ },
402
+ "16e2c22fb42e41e8b810c4e659091d37": {
403
+ "model_module": "@jupyter-widgets/controls",
404
+ "model_name": "FloatProgressModel",
405
+ "model_module_version": "1.5.0",
406
+ "state": {
407
+ "_dom_classes": [],
408
+ "_model_module": "@jupyter-widgets/controls",
409
+ "_model_module_version": "1.5.0",
410
+ "_model_name": "FloatProgressModel",
411
+ "_view_count": null,
412
+ "_view_module": "@jupyter-widgets/controls",
413
+ "_view_module_version": "1.5.0",
414
+ "_view_name": "ProgressView",
415
+ "bar_style": "success",
416
+ "description": "",
417
+ "description_tooltip": null,
418
+ "layout": "IPY_MODEL_c730ecd68ae547b1822039b86bd22322",
419
+ "max": 3071,
420
+ "min": 0,
421
+ "orientation": "horizontal",
422
+ "style": "IPY_MODEL_0cd73c61a5e04ae1854eb1f1c4d92317",
423
+ "value": 3071
424
+ }
425
+ },
426
+ "a1f5e814104646cbac5db19fdbcfccb2": {
427
+ "model_module": "@jupyter-widgets/controls",
428
+ "model_name": "HTMLModel",
429
+ "model_module_version": "1.5.0",
430
+ "state": {
431
+ "_dom_classes": [],
432
+ "_model_module": "@jupyter-widgets/controls",
433
+ "_model_module_version": "1.5.0",
434
+ "_model_name": "HTMLModel",
435
+ "_view_count": null,
436
+ "_view_module": "@jupyter-widgets/controls",
437
+ "_view_module_version": "1.5.0",
438
+ "_view_name": "HTMLView",
439
+ "description": "",
440
+ "description_tooltip": null,
441
+ "layout": "IPY_MODEL_c46a9a3e8c7d4560ae71226920e17acd",
442
+ "placeholder": "​",
443
+ "style": "IPY_MODEL_2303aed14ff44e178ed20edf1f2e5359",
444
+ "value": " 3.07k/3.07k [00:00<00:00, 267kB/s]"
445
+ }
446
+ },
447
+ "3186fb1553884a7da72a387f1e00eca5": {
448
+ "model_module": "@jupyter-widgets/base",
449
+ "model_name": "LayoutModel",
450
+ "model_module_version": "1.2.0",
451
+ "state": {
452
+ "_model_module": "@jupyter-widgets/base",
453
+ "_model_module_version": "1.2.0",
454
+ "_model_name": "LayoutModel",
455
+ "_view_count": null,
456
+ "_view_module": "@jupyter-widgets/base",
457
+ "_view_module_version": "1.2.0",
458
+ "_view_name": "LayoutView",
459
+ "align_content": null,
460
+ "align_items": null,
461
+ "align_self": null,
462
+ "border": null,
463
+ "bottom": null,
464
+ "display": null,
465
+ "flex": null,
466
+ "flex_flow": null,
467
+ "grid_area": null,
468
+ "grid_auto_columns": null,
469
+ "grid_auto_flow": null,
470
+ "grid_auto_rows": null,
471
+ "grid_column": null,
472
+ "grid_gap": null,
473
+ "grid_row": null,
474
+ "grid_template_areas": null,
475
+ "grid_template_columns": null,
476
+ "grid_template_rows": null,
477
+ "height": null,
478
+ "justify_content": null,
479
+ "justify_items": null,
480
+ "left": null,
481
+ "margin": null,
482
+ "max_height": null,
483
+ "max_width": null,
484
+ "min_height": null,
485
+ "min_width": null,
486
+ "object_fit": null,
487
+ "object_position": null,
488
+ "order": null,
489
+ "overflow": null,
490
+ "overflow_x": null,
491
+ "overflow_y": null,
492
+ "padding": null,
493
+ "right": null,
494
+ "top": null,
495
+ "visibility": null,
496
+ "width": null
497
+ }
498
+ },
499
+ "875fbcb976bf486092d3c6f483b9e042": {
500
+ "model_module": "@jupyter-widgets/base",
501
+ "model_name": "LayoutModel",
502
+ "model_module_version": "1.2.0",
503
+ "state": {
504
+ "_model_module": "@jupyter-widgets/base",
505
+ "_model_module_version": "1.2.0",
506
+ "_model_name": "LayoutModel",
507
+ "_view_count": null,
508
+ "_view_module": "@jupyter-widgets/base",
509
+ "_view_module_version": "1.2.0",
510
+ "_view_name": "LayoutView",
511
+ "align_content": null,
512
+ "align_items": null,
513
+ "align_self": null,
514
+ "border": null,
515
+ "bottom": null,
516
+ "display": null,
517
+ "flex": null,
518
+ "flex_flow": null,
519
+ "grid_area": null,
520
+ "grid_auto_columns": null,
521
+ "grid_auto_flow": null,
522
+ "grid_auto_rows": null,
523
+ "grid_column": null,
524
+ "grid_gap": null,
525
+ "grid_row": null,
526
+ "grid_template_areas": null,
527
+ "grid_template_columns": null,
528
+ "grid_template_rows": null,
529
+ "height": null,
530
+ "justify_content": null,
531
+ "justify_items": null,
532
+ "left": null,
533
+ "margin": null,
534
+ "max_height": null,
535
+ "max_width": null,
536
+ "min_height": null,
537
+ "min_width": null,
538
+ "object_fit": null,
539
+ "object_position": null,
540
+ "order": null,
541
+ "overflow": null,
542
+ "overflow_x": null,
543
+ "overflow_y": null,
544
+ "padding": null,
545
+ "right": null,
546
+ "top": null,
547
+ "visibility": null,
548
+ "width": null
549
+ }
550
+ },
551
+ "e2a24c0c90b149508715998b1cf301f7": {
552
+ "model_module": "@jupyter-widgets/controls",
553
+ "model_name": "DescriptionStyleModel",
554
+ "model_module_version": "1.5.0",
555
+ "state": {
556
+ "_model_module": "@jupyter-widgets/controls",
557
+ "_model_module_version": "1.5.0",
558
+ "_model_name": "DescriptionStyleModel",
559
+ "_view_count": null,
560
+ "_view_module": "@jupyter-widgets/base",
561
+ "_view_module_version": "1.2.0",
562
+ "_view_name": "StyleView",
563
+ "description_width": ""
564
+ }
565
+ },
566
+ "c730ecd68ae547b1822039b86bd22322": {
567
+ "model_module": "@jupyter-widgets/base",
568
+ "model_name": "LayoutModel",
569
+ "model_module_version": "1.2.0",
570
+ "state": {
571
+ "_model_module": "@jupyter-widgets/base",
572
+ "_model_module_version": "1.2.0",
573
+ "_model_name": "LayoutModel",
574
+ "_view_count": null,
575
+ "_view_module": "@jupyter-widgets/base",
576
+ "_view_module_version": "1.2.0",
577
+ "_view_name": "LayoutView",
578
+ "align_content": null,
579
+ "align_items": null,
580
+ "align_self": null,
581
+ "border": null,
582
+ "bottom": null,
583
+ "display": null,
584
+ "flex": null,
585
+ "flex_flow": null,
586
+ "grid_area": null,
587
+ "grid_auto_columns": null,
588
+ "grid_auto_flow": null,
589
+ "grid_auto_rows": null,
590
+ "grid_column": null,
591
+ "grid_gap": null,
592
+ "grid_row": null,
593
+ "grid_template_areas": null,
594
+ "grid_template_columns": null,
595
+ "grid_template_rows": null,
596
+ "height": null,
597
+ "justify_content": null,
598
+ "justify_items": null,
599
+ "left": null,
600
+ "margin": null,
601
+ "max_height": null,
602
+ "max_width": null,
603
+ "min_height": null,
604
+ "min_width": null,
605
+ "object_fit": null,
606
+ "object_position": null,
607
+ "order": null,
608
+ "overflow": null,
609
+ "overflow_x": null,
610
+ "overflow_y": null,
611
+ "padding": null,
612
+ "right": null,
613
+ "top": null,
614
+ "visibility": null,
615
+ "width": null
616
+ }
617
+ },
618
+ "0cd73c61a5e04ae1854eb1f1c4d92317": {
619
+ "model_module": "@jupyter-widgets/controls",
620
+ "model_name": "ProgressStyleModel",
621
+ "model_module_version": "1.5.0",
622
+ "state": {
623
+ "_model_module": "@jupyter-widgets/controls",
624
+ "_model_module_version": "1.5.0",
625
+ "_model_name": "ProgressStyleModel",
626
+ "_view_count": null,
627
+ "_view_module": "@jupyter-widgets/base",
628
+ "_view_module_version": "1.2.0",
629
+ "_view_name": "StyleView",
630
+ "bar_color": null,
631
+ "description_width": ""
632
+ }
633
+ },
634
+ "c46a9a3e8c7d4560ae71226920e17acd": {
635
+ "model_module": "@jupyter-widgets/base",
636
+ "model_name": "LayoutModel",
637
+ "model_module_version": "1.2.0",
638
+ "state": {
639
+ "_model_module": "@jupyter-widgets/base",
640
+ "_model_module_version": "1.2.0",
641
+ "_model_name": "LayoutModel",
642
+ "_view_count": null,
643
+ "_view_module": "@jupyter-widgets/base",
644
+ "_view_module_version": "1.2.0",
645
+ "_view_name": "LayoutView",
646
+ "align_content": null,
647
+ "align_items": null,
648
+ "align_self": null,
649
+ "border": null,
650
+ "bottom": null,
651
+ "display": null,
652
+ "flex": null,
653
+ "flex_flow": null,
654
+ "grid_area": null,
655
+ "grid_auto_columns": null,
656
+ "grid_auto_flow": null,
657
+ "grid_auto_rows": null,
658
+ "grid_column": null,
659
+ "grid_gap": null,
660
+ "grid_row": null,
661
+ "grid_template_areas": null,
662
+ "grid_template_columns": null,
663
+ "grid_template_rows": null,
664
+ "height": null,
665
+ "justify_content": null,
666
+ "justify_items": null,
667
+ "left": null,
668
+ "margin": null,
669
+ "max_height": null,
670
+ "max_width": null,
671
+ "min_height": null,
672
+ "min_width": null,
673
+ "object_fit": null,
674
+ "object_position": null,
675
+ "order": null,
676
+ "overflow": null,
677
+ "overflow_x": null,
678
+ "overflow_y": null,
679
+ "padding": null,
680
+ "right": null,
681
+ "top": null,
682
+ "visibility": null,
683
+ "width": null
684
+ }
685
+ },
686
+ "2303aed14ff44e178ed20edf1f2e5359": {
687
+ "model_module": "@jupyter-widgets/controls",
688
+ "model_name": "DescriptionStyleModel",
689
+ "model_module_version": "1.5.0",
690
+ "state": {
691
+ "_model_module": "@jupyter-widgets/controls",
692
+ "_model_module_version": "1.5.0",
693
+ "_model_name": "DescriptionStyleModel",
694
+ "_view_count": null,
695
+ "_view_module": "@jupyter-widgets/base",
696
+ "_view_module_version": "1.2.0",
697
+ "_view_name": "StyleView",
698
+ "description_width": ""
699
+ }
700
+ },
701
+ "072e1baca7d64766807df5454dc9e3cc": {
702
+ "model_module": "@jupyter-widgets/controls",
703
+ "model_name": "HBoxModel",
704
+ "model_module_version": "1.5.0",
705
+ "state": {
706
+ "_dom_classes": [],
707
+ "_model_module": "@jupyter-widgets/controls",
708
+ "_model_module_version": "1.5.0",
709
+ "_model_name": "HBoxModel",
710
+ "_view_count": null,
711
+ "_view_module": "@jupyter-widgets/controls",
712
+ "_view_module_version": "1.5.0",
713
+ "_view_name": "HBoxView",
714
+ "box_style": "",
715
+ "children": [
716
+ "IPY_MODEL_6da37a13974c4c3890c7676d194021bc",
717
+ "IPY_MODEL_2f5b6f1af091405287c35c53ad169354",
718
+ "IPY_MODEL_b977fb3e42a14fe1bec47426ae1efded"
719
+ ],
720
+ "layout": "IPY_MODEL_a063adb2cc1c44438d5f631fb16297ae"
721
+ }
722
+ },
723
+ "6da37a13974c4c3890c7676d194021bc": {
724
+ "model_module": "@jupyter-widgets/controls",
725
+ "model_name": "HTMLModel",
726
+ "model_module_version": "1.5.0",
727
+ "state": {
728
+ "_dom_classes": [],
729
+ "_model_module": "@jupyter-widgets/controls",
730
+ "_model_module_version": "1.5.0",
731
+ "_model_name": "HTMLModel",
732
+ "_view_count": null,
733
+ "_view_module": "@jupyter-widgets/controls",
734
+ "_view_module_version": "1.5.0",
735
+ "_view_name": "HTMLView",
736
+ "description": "",
737
+ "description_tooltip": null,
738
+ "layout": "IPY_MODEL_50f86e2ac8444d1986d8d9afe9fcee37",
739
+ "placeholder": "​",
740
+ "style": "IPY_MODEL_da323d8a744a43d8901f19c48b1e1223",
741
+ "value": "tokenizer.json: 100%"
742
+ }
743
+ },
744
+ "2f5b6f1af091405287c35c53ad169354": {
745
+ "model_module": "@jupyter-widgets/controls",
746
+ "model_name": "FloatProgressModel",
747
+ "model_module_version": "1.5.0",
748
+ "state": {
749
+ "_dom_classes": [],
750
+ "_model_module": "@jupyter-widgets/controls",
751
+ "_model_module_version": "1.5.0",
752
+ "_model_name": "FloatProgressModel",
753
+ "_view_count": null,
754
+ "_view_module": "@jupyter-widgets/controls",
755
+ "_view_module_version": "1.5.0",
756
+ "_view_name": "ProgressView",
757
+ "bar_style": "success",
758
+ "description": "",
759
+ "description_tooltip": null,
760
+ "layout": "IPY_MODEL_69afe592335b4d73b51b63e4c56407fc",
761
+ "max": 7031660,
762
+ "min": 0,
763
+ "orientation": "horizontal",
764
+ "style": "IPY_MODEL_f3605ab95cbf4ebda9a678a0788e9682",
765
+ "value": 7031660
766
+ }
767
+ },
768
+ "b977fb3e42a14fe1bec47426ae1efded": {
769
+ "model_module": "@jupyter-widgets/controls",
770
+ "model_name": "HTMLModel",
771
+ "model_module_version": "1.5.0",
772
+ "state": {
773
+ "_dom_classes": [],
774
+ "_model_module": "@jupyter-widgets/controls",
775
+ "_model_module_version": "1.5.0",
776
+ "_model_name": "HTMLModel",
777
+ "_view_count": null,
778
+ "_view_module": "@jupyter-widgets/controls",
779
+ "_view_module_version": "1.5.0",
780
+ "_view_name": "HTMLView",
781
+ "description": "",
782
+ "description_tooltip": null,
783
+ "layout": "IPY_MODEL_7d2023b2a9054a3991983a30fdc6555b",
784
+ "placeholder": "​",
785
+ "style": "IPY_MODEL_17d028b387724317ae9994819a97a3a4",
786
+ "value": " 7.03M/7.03M [00:00<00:00, 28.7MB/s]"
787
+ }
788
+ },
789
+ "a063adb2cc1c44438d5f631fb16297ae": {
790
+ "model_module": "@jupyter-widgets/base",
791
+ "model_name": "LayoutModel",
792
+ "model_module_version": "1.2.0",
793
+ "state": {
794
+ "_model_module": "@jupyter-widgets/base",
795
+ "_model_module_version": "1.2.0",
796
+ "_model_name": "LayoutModel",
797
+ "_view_count": null,
798
+ "_view_module": "@jupyter-widgets/base",
799
+ "_view_module_version": "1.2.0",
800
+ "_view_name": "LayoutView",
801
+ "align_content": null,
802
+ "align_items": null,
803
+ "align_self": null,
804
+ "border": null,
805
+ "bottom": null,
806
+ "display": null,
807
+ "flex": null,
808
+ "flex_flow": null,
809
+ "grid_area": null,
810
+ "grid_auto_columns": null,
811
+ "grid_auto_flow": null,
812
+ "grid_auto_rows": null,
813
+ "grid_column": null,
814
+ "grid_gap": null,
815
+ "grid_row": null,
816
+ "grid_template_areas": null,
817
+ "grid_template_columns": null,
818
+ "grid_template_rows": null,
819
+ "height": null,
820
+ "justify_content": null,
821
+ "justify_items": null,
822
+ "left": null,
823
+ "margin": null,
824
+ "max_height": null,
825
+ "max_width": null,
826
+ "min_height": null,
827
+ "min_width": null,
828
+ "object_fit": null,
829
+ "object_position": null,
830
+ "order": null,
831
+ "overflow": null,
832
+ "overflow_x": null,
833
+ "overflow_y": null,
834
+ "padding": null,
835
+ "right": null,
836
+ "top": null,
837
+ "visibility": null,
838
+ "width": null
839
+ }
840
+ },
841
+ "50f86e2ac8444d1986d8d9afe9fcee37": {
842
+ "model_module": "@jupyter-widgets/base",
843
+ "model_name": "LayoutModel",
844
+ "model_module_version": "1.2.0",
845
+ "state": {
846
+ "_model_module": "@jupyter-widgets/base",
847
+ "_model_module_version": "1.2.0",
848
+ "_model_name": "LayoutModel",
849
+ "_view_count": null,
850
+ "_view_module": "@jupyter-widgets/base",
851
+ "_view_module_version": "1.2.0",
852
+ "_view_name": "LayoutView",
853
+ "align_content": null,
854
+ "align_items": null,
855
+ "align_self": null,
856
+ "border": null,
857
+ "bottom": null,
858
+ "display": null,
859
+ "flex": null,
860
+ "flex_flow": null,
861
+ "grid_area": null,
862
+ "grid_auto_columns": null,
863
+ "grid_auto_flow": null,
864
+ "grid_auto_rows": null,
865
+ "grid_column": null,
866
+ "grid_gap": null,
867
+ "grid_row": null,
868
+ "grid_template_areas": null,
869
+ "grid_template_columns": null,
870
+ "grid_template_rows": null,
871
+ "height": null,
872
+ "justify_content": null,
873
+ "justify_items": null,
874
+ "left": null,
875
+ "margin": null,
876
+ "max_height": null,
877
+ "max_width": null,
878
+ "min_height": null,
879
+ "min_width": null,
880
+ "object_fit": null,
881
+ "object_position": null,
882
+ "order": null,
883
+ "overflow": null,
884
+ "overflow_x": null,
885
+ "overflow_y": null,
886
+ "padding": null,
887
+ "right": null,
888
+ "top": null,
889
+ "visibility": null,
890
+ "width": null
891
+ }
892
+ },
893
+ "da323d8a744a43d8901f19c48b1e1223": {
894
+ "model_module": "@jupyter-widgets/controls",
895
+ "model_name": "DescriptionStyleModel",
896
+ "model_module_version": "1.5.0",
897
+ "state": {
898
+ "_model_module": "@jupyter-widgets/controls",
899
+ "_model_module_version": "1.5.0",
900
+ "_model_name": "DescriptionStyleModel",
901
+ "_view_count": null,
902
+ "_view_module": "@jupyter-widgets/base",
903
+ "_view_module_version": "1.2.0",
904
+ "_view_name": "StyleView",
905
+ "description_width": ""
906
+ }
907
+ },
908
+ "69afe592335b4d73b51b63e4c56407fc": {
909
+ "model_module": "@jupyter-widgets/base",
910
+ "model_name": "LayoutModel",
911
+ "model_module_version": "1.2.0",
912
+ "state": {
913
+ "_model_module": "@jupyter-widgets/base",
914
+ "_model_module_version": "1.2.0",
915
+ "_model_name": "LayoutModel",
916
+ "_view_count": null,
917
+ "_view_module": "@jupyter-widgets/base",
918
+ "_view_module_version": "1.2.0",
919
+ "_view_name": "LayoutView",
920
+ "align_content": null,
921
+ "align_items": null,
922
+ "align_self": null,
923
+ "border": null,
924
+ "bottom": null,
925
+ "display": null,
926
+ "flex": null,
927
+ "flex_flow": null,
928
+ "grid_area": null,
929
+ "grid_auto_columns": null,
930
+ "grid_auto_flow": null,
931
+ "grid_auto_rows": null,
932
+ "grid_column": null,
933
+ "grid_gap": null,
934
+ "grid_row": null,
935
+ "grid_template_areas": null,
936
+ "grid_template_columns": null,
937
+ "grid_template_rows": null,
938
+ "height": null,
939
+ "justify_content": null,
940
+ "justify_items": null,
941
+ "left": null,
942
+ "margin": null,
943
+ "max_height": null,
944
+ "max_width": null,
945
+ "min_height": null,
946
+ "min_width": null,
947
+ "object_fit": null,
948
+ "object_position": null,
949
+ "order": null,
950
+ "overflow": null,
951
+ "overflow_x": null,
952
+ "overflow_y": null,
953
+ "padding": null,
954
+ "right": null,
955
+ "top": null,
956
+ "visibility": null,
957
+ "width": null
958
+ }
959
+ },
960
+ "f3605ab95cbf4ebda9a678a0788e9682": {
961
+ "model_module": "@jupyter-widgets/controls",
962
+ "model_name": "ProgressStyleModel",
963
+ "model_module_version": "1.5.0",
964
+ "state": {
965
+ "_model_module": "@jupyter-widgets/controls",
966
+ "_model_module_version": "1.5.0",
967
+ "_model_name": "ProgressStyleModel",
968
+ "_view_count": null,
969
+ "_view_module": "@jupyter-widgets/base",
970
+ "_view_module_version": "1.2.0",
971
+ "_view_name": "StyleView",
972
+ "bar_color": null,
973
+ "description_width": ""
974
+ }
975
+ },
976
+ "7d2023b2a9054a3991983a30fdc6555b": {
977
+ "model_module": "@jupyter-widgets/base",
978
+ "model_name": "LayoutModel",
979
+ "model_module_version": "1.2.0",
980
+ "state": {
981
+ "_model_module": "@jupyter-widgets/base",
982
+ "_model_module_version": "1.2.0",
983
+ "_model_name": "LayoutModel",
984
+ "_view_count": null,
985
+ "_view_module": "@jupyter-widgets/base",
986
+ "_view_module_version": "1.2.0",
987
+ "_view_name": "LayoutView",
988
+ "align_content": null,
989
+ "align_items": null,
990
+ "align_self": null,
991
+ "border": null,
992
+ "bottom": null,
993
+ "display": null,
994
+ "flex": null,
995
+ "flex_flow": null,
996
+ "grid_area": null,
997
+ "grid_auto_columns": null,
998
+ "grid_auto_flow": null,
999
+ "grid_auto_rows": null,
1000
+ "grid_column": null,
1001
+ "grid_gap": null,
1002
+ "grid_row": null,
1003
+ "grid_template_areas": null,
1004
+ "grid_template_columns": null,
1005
+ "grid_template_rows": null,
1006
+ "height": null,
1007
+ "justify_content": null,
1008
+ "justify_items": null,
1009
+ "left": null,
1010
+ "margin": null,
1011
+ "max_height": null,
1012
+ "max_width": null,
1013
+ "min_height": null,
1014
+ "min_width": null,
1015
+ "object_fit": null,
1016
+ "object_position": null,
1017
+ "order": null,
1018
+ "overflow": null,
1019
+ "overflow_x": null,
1020
+ "overflow_y": null,
1021
+ "padding": null,
1022
+ "right": null,
1023
+ "top": null,
1024
+ "visibility": null,
1025
+ "width": null
1026
+ }
1027
+ },
1028
+ "17d028b387724317ae9994819a97a3a4": {
1029
+ "model_module": "@jupyter-widgets/controls",
1030
+ "model_name": "DescriptionStyleModel",
1031
+ "model_module_version": "1.5.0",
1032
+ "state": {
1033
+ "_model_module": "@jupyter-widgets/controls",
1034
+ "_model_module_version": "1.5.0",
1035
+ "_model_name": "DescriptionStyleModel",
1036
+ "_view_count": null,
1037
+ "_view_module": "@jupyter-widgets/base",
1038
+ "_view_module_version": "1.2.0",
1039
+ "_view_name": "StyleView",
1040
+ "description_width": ""
1041
+ }
1042
+ }
1043
+ }
1044
  }
1045
  },
1046
  "cells": [
 
1063
  "colab": {
1064
  "base_uri": "https://localhost:8080/"
1065
  },
1066
+ "outputId": "76cd0d1b-7de2-4519-c0ae-1b9e6ee37653"
1067
  },
1068
  "execution_count": 1,
1069
  "outputs": [
 
1071
  "output_type": "stream",
1072
  "name": "stdout",
1073
  "text": [
1074
+ "Collecting ai-edge-litert\n",
1075
+ " Downloading ai_edge_litert-1.1.2-cp311-cp311-manylinux_2_17_x86_64.whl.metadata (1.6 kB)\n",
1076
  "Requirement already satisfied: flatbuffers in /usr/local/lib/python3.11/dist-packages (from ai-edge-litert) (25.2.10)\n",
1077
+ "Requirement already satisfied: numpy>=1.23.2 in /usr/local/lib/python3.11/dist-packages (from ai-edge-litert) (1.26.4)\n",
1078
+ "Downloading ai_edge_litert-1.1.2-cp311-cp311-manylinux_2_17_x86_64.whl (3.5 MB)\n",
1079
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.5/3.5 MB\u001b[0m \u001b[31m23.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
1080
+ "\u001b[?25hInstalling collected packages: ai-edge-litert\n",
1081
+ "Successfully installed ai-edge-litert-1.1.2\n"
1082
  ]
1083
  }
1084
  ]
 
1115
  "model_path = hf_hub_download(repo_id=\"litert-community/DeepSeek-R1-Distill-Qwen-1.5B\", filename=\"deepseek_q8_seq128_ekv1280.tflite\")"
1116
  ],
1117
  "metadata": {
1118
+ "id": "3t47HAG2tvc3",
1119
+ "colab": {
1120
+ "base_uri": "https://localhost:8080/",
1121
+ "height": 49,
1122
+ "referenced_widgets": [
1123
+ "47cd47140dbb4e28a4f31d5632bfe82d",
1124
+ "7c0ddb1e0e3145f08ccb0c32b02c562f",
1125
+ "85c490db972b4d659caad513359a6700",
1126
+ "d61e96ae08d84414a638dd592f13fb18",
1127
+ "9e7f4734aa034e4aa5207b8a2498ee02",
1128
+ "df08ba8056fb47cb969e132087987e68",
1129
+ "470febc3af8348ef8611255e88401229",
1130
+ "39cedca11f574c01808acdc1be9aa68d",
1131
+ "62bd6d393ca74193bded59a8ebd0a749",
1132
+ "475c5c4fc6eb404180d7b69d75f797ea",
1133
+ "b815fc17c9ee4913b5cb452653ff1af9"
1134
+ ]
1135
+ },
1136
+ "outputId": "d1d8ed1a-5ec6-4121-9d3c-fada487fc8ed"
1137
  },
1138
  "execution_count": 3,
1139
+ "outputs": [
1140
+ {
1141
+ "output_type": "display_data",
1142
+ "data": {
1143
+ "text/plain": [
1144
+ "deepseek_q8_seq128_ekv1280.tflite: 0%| | 0.00/1.81G [00:00<?, ?B/s]"
1145
+ ],
1146
+ "application/vnd.jupyter.widget-view+json": {
1147
+ "version_major": 2,
1148
+ "version_minor": 0,
1149
+ "model_id": "47cd47140dbb4e28a4f31d5632bfe82d"
1150
+ }
1151
+ },
1152
+ "metadata": {}
1153
+ }
1154
+ ]
1155
  },
1156
  {
1157
  "cell_type": "markdown",
 
1173
  "tokenizer = AutoTokenizer.from_pretrained(\"deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B\")"
1174
  ],
1175
  "metadata": {
1176
+ "id": "Rvdn3EIZhaQn",
1177
+ "colab": {
1178
+ "base_uri": "https://localhost:8080/",
1179
+ "height": 81,
1180
+ "referenced_widgets": [
1181
+ "8cac4d03da1044d6adb8b62752ed6775",
1182
+ "a201091e2f9b4f6c8a7d780dde854134",
1183
+ "16e2c22fb42e41e8b810c4e659091d37",
1184
+ "a1f5e814104646cbac5db19fdbcfccb2",
1185
+ "3186fb1553884a7da72a387f1e00eca5",
1186
+ "875fbcb976bf486092d3c6f483b9e042",
1187
+ "e2a24c0c90b149508715998b1cf301f7",
1188
+ "c730ecd68ae547b1822039b86bd22322",
1189
+ "0cd73c61a5e04ae1854eb1f1c4d92317",
1190
+ "c46a9a3e8c7d4560ae71226920e17acd",
1191
+ "2303aed14ff44e178ed20edf1f2e5359",
1192
+ "072e1baca7d64766807df5454dc9e3cc",
1193
+ "6da37a13974c4c3890c7676d194021bc",
1194
+ "2f5b6f1af091405287c35c53ad169354",
1195
+ "b977fb3e42a14fe1bec47426ae1efded",
1196
+ "a063adb2cc1c44438d5f631fb16297ae",
1197
+ "50f86e2ac8444d1986d8d9afe9fcee37",
1198
+ "da323d8a744a43d8901f19c48b1e1223",
1199
+ "69afe592335b4d73b51b63e4c56407fc",
1200
+ "f3605ab95cbf4ebda9a678a0788e9682",
1201
+ "7d2023b2a9054a3991983a30fdc6555b",
1202
+ "17d028b387724317ae9994819a97a3a4"
1203
+ ]
1204
+ },
1205
+ "outputId": "e05a5944-5312-41c4-e38e-7e26a921e63c"
1206
  },
1207
  "execution_count": 4,
1208
+ "outputs": [
1209
+ {
1210
+ "output_type": "display_data",
1211
+ "data": {
1212
+ "text/plain": [
1213
+ "tokenizer_config.json: 0%| | 0.00/3.07k [00:00<?, ?B/s]"
1214
+ ],
1215
+ "application/vnd.jupyter.widget-view+json": {
1216
+ "version_major": 2,
1217
+ "version_minor": 0,
1218
+ "model_id": "8cac4d03da1044d6adb8b62752ed6775"
1219
+ }
1220
+ },
1221
+ "metadata": {}
1222
+ },
1223
+ {
1224
+ "output_type": "display_data",
1225
+ "data": {
1226
+ "text/plain": [
1227
+ "tokenizer.json: 0%| | 0.00/7.03M [00:00<?, ?B/s]"
1228
+ ],
1229
+ "application/vnd.jupyter.widget-view+json": {
1230
+ "version_major": 2,
1231
+ "version_minor": 0,
1232
+ "model_id": "072e1baca7d64766807df5454dc9e3cc"
1233
+ }
1234
+ },
1235
+ "metadata": {}
1236
+ }
1237
+ ]
1238
  },
1239
  {
1240
  "cell_type": "markdown",
 
1248
  {
1249
  "cell_type": "code",
1250
  "source": [
 
 
1251
  "class LiteRTLlmPipeline:\n",
1252
  "\n",
1253
  " def __init__(self, interpreter, tokenizer):\n",
 
1267
  " - self._max_seq_len: The maximum sequence length supported by the model.\n",
1268
  " - self._max_kv_cache_seq_len: The maximum sequence length supported by the\n",
1269
  " KV cache.\n",
 
1270
  "\n",
1271
  " Args:\n",
1272
  " num_input_tokens: The number of input tokens.\n",
 
1292
  " ]\n",
1293
  " self._max_kv_cache_seq_len = kv_cache_shape[1]\n",
1294
  "\n",
 
 
 
 
 
 
 
1295
  " def _init_kv_cache(self) -> dict[str, np.ndarray]:\n",
1296
  " if self._prefill_runner is None:\n",
1297
  " raise ValueError(\"Prefill runner is not initialized.\")\n",
1298
  " kv_cache = {}\n",
1299
+ " for input_key in self._prefill_runner.get_input_details().keys():\n",
1300
+ " if \"kv_cache\" in input_key:\n",
1301
+ " kv_cache[input_key] = np.zeros(\n",
1302
+ " self._prefill_runner.get_input_details()[input_key][\"shape\"],\n",
1303
+ " dtype=np.float32,\n",
1304
+ " )\n",
1305
+ " kv_cache[input_key] = np.zeros(\n",
1306
+ " self._prefill_runner.get_input_details()[input_key][\"shape\"],\n",
1307
+ " dtype=np.float32,\n",
1308
+ " )\n",
1309
  " return kv_cache\n",
1310
  "\n",
1311
  " def _get_prefill_runner(self, num_input_tokens: int) :\n",
 
1459
  "metadata": {
1460
  "id": "UBSGrHrM4ANm"
1461
  },
1462
+ "execution_count": 15,
1463
  "outputs": []
1464
  },
1465
  {
 
1480
  "metadata": {
1481
  "id": "AZhlDQWg61AL"
1482
  },
1483
+ "execution_count": 16,
1484
  "outputs": []
1485
  },
1486
  {
1487
  "cell_type": "code",
1488
  "source": [
1489
+ "prompt = \"what is the capital of France\"\n",
1490
  "output = pipeline.generate(prompt, max_decode_steps = None)"
1491
  ],
1492
  "metadata": {