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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"nbformat": 4,
|
3 |
+
"nbformat_minor": 0,
|
4 |
+
"metadata": {
|
5 |
+
"colab": {
|
6 |
+
"provenance": [],
|
7 |
+
"gpuType": "T4"
|
8 |
+
},
|
9 |
+
"kernelspec": {
|
10 |
+
"name": "python3",
|
11 |
+
"display_name": "Python 3"
|
12 |
+
},
|
13 |
+
"language_info": {
|
14 |
+
"name": "python"
|
15 |
+
},
|
16 |
+
"accelerator": "GPU",
|
17 |
+
"widgets": {
|
18 |
+
"application/vnd.jupyter.widget-state+json": {
|
19 |
+
"754146b195d540208987dfbfb62b1e42": {
|
20 |
+
"model_module": "@jupyter-widgets/controls",
|
21 |
+
"model_name": "HBoxModel",
|
22 |
+
"model_module_version": "1.5.0",
|
23 |
+
"state": {
|
24 |
+
"_dom_classes": [],
|
25 |
+
"_model_module": "@jupyter-widgets/controls",
|
26 |
+
"_model_module_version": "1.5.0",
|
27 |
+
"_model_name": "HBoxModel",
|
28 |
+
"_view_count": null,
|
29 |
+
"_view_module": "@jupyter-widgets/controls",
|
30 |
+
"_view_module_version": "1.5.0",
|
31 |
+
"_view_name": "HBoxView",
|
32 |
+
"box_style": "",
|
33 |
+
"children": [
|
34 |
+
"IPY_MODEL_71baddbb1b0b4593abd31da8f3a7db46",
|
35 |
+
"IPY_MODEL_1f9127a98eb44a459bfc2afcb9d56f08",
|
36 |
+
"IPY_MODEL_a3cd941beb884d40bd68c59f911ddbd1"
|
37 |
+
],
|
38 |
+
"layout": "IPY_MODEL_f2de1572030d4cf1a769e569efeae650"
|
39 |
+
}
|
40 |
+
},
|
41 |
+
"71baddbb1b0b4593abd31da8f3a7db46": {
|
42 |
+
"model_module": "@jupyter-widgets/controls",
|
43 |
+
"model_name": "HTMLModel",
|
44 |
+
"model_module_version": "1.5.0",
|
45 |
+
"state": {
|
46 |
+
"_dom_classes": [],
|
47 |
+
"_model_module": "@jupyter-widgets/controls",
|
48 |
+
"_model_module_version": "1.5.0",
|
49 |
+
"_model_name": "HTMLModel",
|
50 |
+
"_view_count": null,
|
51 |
+
"_view_module": "@jupyter-widgets/controls",
|
52 |
+
"_view_module_version": "1.5.0",
|
53 |
+
"_view_name": "HTMLView",
|
54 |
+
"description": "",
|
55 |
+
"description_tooltip": null,
|
56 |
+
"layout": "IPY_MODEL_0e71b6b8eeec4408a5b536e9b22db760",
|
57 |
+
"placeholder": "โ",
|
58 |
+
"style": "IPY_MODEL_4e2c7c7e15234e4db599221802879bac",
|
59 |
+
"value": "Downloading model.safetensors: 100%"
|
60 |
+
}
|
61 |
+
},
|
62 |
+
"1f9127a98eb44a459bfc2afcb9d56f08": {
|
63 |
+
"model_module": "@jupyter-widgets/controls",
|
64 |
+
"model_name": "FloatProgressModel",
|
65 |
+
"model_module_version": "1.5.0",
|
66 |
+
"state": {
|
67 |
+
"_dom_classes": [],
|
68 |
+
"_model_module": "@jupyter-widgets/controls",
|
69 |
+
"_model_module_version": "1.5.0",
|
70 |
+
"_model_name": "FloatProgressModel",
|
71 |
+
"_view_count": null,
|
72 |
+
"_view_module": "@jupyter-widgets/controls",
|
73 |
+
"_view_module_version": "1.5.0",
|
74 |
+
"_view_name": "ProgressView",
|
75 |
+
"bar_style": "success",
|
76 |
+
"description": "",
|
77 |
+
"description_tooltip": null,
|
78 |
+
"layout": "IPY_MODEL_8dce0bcb78744bb1ad9cad131ccf2dce",
|
79 |
+
"max": 1615784368,
|
80 |
+
"min": 0,
|
81 |
+
"orientation": "horizontal",
|
82 |
+
"style": "IPY_MODEL_dca10a5d095b4061925aa7a68c21809e",
|
83 |
+
"value": 1615784368
|
84 |
+
}
|
85 |
+
},
|
86 |
+
"a3cd941beb884d40bd68c59f911ddbd1": {
|
87 |
+
"model_module": "@jupyter-widgets/controls",
|
88 |
+
"model_name": "HTMLModel",
|
89 |
+
"model_module_version": "1.5.0",
|
90 |
+
"state": {
|
91 |
+
"_dom_classes": [],
|
92 |
+
"_model_module": "@jupyter-widgets/controls",
|
93 |
+
"_model_module_version": "1.5.0",
|
94 |
+
"_model_name": "HTMLModel",
|
95 |
+
"_view_count": null,
|
96 |
+
"_view_module": "@jupyter-widgets/controls",
|
97 |
+
"_view_module_version": "1.5.0",
|
98 |
+
"_view_name": "HTMLView",
|
99 |
+
"description": "",
|
100 |
+
"description_tooltip": null,
|
101 |
+
"layout": "IPY_MODEL_0c958f8b9a9f484db6cbc3f5bfc695e8",
|
102 |
+
"placeholder": "โ",
|
103 |
+
"style": "IPY_MODEL_d0347e27d359452483e0eaf9dcf0679f",
|
104 |
+
"value": " 1.62G/1.62G [00:43<00:00, 47.0MB/s]"
|
105 |
+
}
|
106 |
+
},
|
107 |
+
"f2de1572030d4cf1a769e569efeae650": {
|
108 |
+
"model_module": "@jupyter-widgets/base",
|
109 |
+
"model_name": "LayoutModel",
|
110 |
+
"model_module_version": "1.2.0",
|
111 |
+
"state": {
|
112 |
+
"_model_module": "@jupyter-widgets/base",
|
113 |
+
"_model_module_version": "1.2.0",
|
114 |
+
"_model_name": "LayoutModel",
|
115 |
+
"_view_count": null,
|
116 |
+
"_view_module": "@jupyter-widgets/base",
|
117 |
+
"_view_module_version": "1.2.0",
|
118 |
+
"_view_name": "LayoutView",
|
119 |
+
"align_content": null,
|
120 |
+
"align_items": null,
|
121 |
+
"align_self": null,
|
122 |
+
"border": null,
|
123 |
+
"bottom": null,
|
124 |
+
"display": null,
|
125 |
+
"flex": null,
|
126 |
+
"flex_flow": null,
|
127 |
+
"grid_area": null,
|
128 |
+
"grid_auto_columns": null,
|
129 |
+
"grid_auto_flow": null,
|
130 |
+
"grid_auto_rows": null,
|
131 |
+
"grid_column": null,
|
132 |
+
"grid_gap": null,
|
133 |
+
"grid_row": null,
|
134 |
+
"grid_template_areas": null,
|
135 |
+
"grid_template_columns": null,
|
136 |
+
"grid_template_rows": null,
|
137 |
+
"height": null,
|
138 |
+
"justify_content": null,
|
139 |
+
"justify_items": null,
|
140 |
+
"left": null,
|
141 |
+
"margin": null,
|
142 |
+
"max_height": null,
|
143 |
+
"max_width": null,
|
144 |
+
"min_height": null,
|
145 |
+
"min_width": null,
|
146 |
+
"object_fit": null,
|
147 |
+
"object_position": null,
|
148 |
+
"order": null,
|
149 |
+
"overflow": null,
|
150 |
+
"overflow_x": null,
|
151 |
+
"overflow_y": null,
|
152 |
+
"padding": null,
|
153 |
+
"right": null,
|
154 |
+
"top": null,
|
155 |
+
"visibility": null,
|
156 |
+
"width": null
|
157 |
+
}
|
158 |
+
},
|
159 |
+
"0e71b6b8eeec4408a5b536e9b22db760": {
|
160 |
+
"model_module": "@jupyter-widgets/base",
|
161 |
+
"model_name": "LayoutModel",
|
162 |
+
"model_module_version": "1.2.0",
|
163 |
+
"state": {
|
164 |
+
"_model_module": "@jupyter-widgets/base",
|
165 |
+
"_model_module_version": "1.2.0",
|
166 |
+
"_model_name": "LayoutModel",
|
167 |
+
"_view_count": null,
|
168 |
+
"_view_module": "@jupyter-widgets/base",
|
169 |
+
"_view_module_version": "1.2.0",
|
170 |
+
"_view_name": "LayoutView",
|
171 |
+
"align_content": null,
|
172 |
+
"align_items": null,
|
173 |
+
"align_self": null,
|
174 |
+
"border": null,
|
175 |
+
"bottom": null,
|
176 |
+
"display": null,
|
177 |
+
"flex": null,
|
178 |
+
"flex_flow": null,
|
179 |
+
"grid_area": null,
|
180 |
+
"grid_auto_columns": null,
|
181 |
+
"grid_auto_flow": null,
|
182 |
+
"grid_auto_rows": null,
|
183 |
+
"grid_column": null,
|
184 |
+
"grid_gap": null,
|
185 |
+
"grid_row": null,
|
186 |
+
"grid_template_areas": null,
|
187 |
+
"grid_template_columns": null,
|
188 |
+
"grid_template_rows": null,
|
189 |
+
"height": null,
|
190 |
+
"justify_content": null,
|
191 |
+
"justify_items": null,
|
192 |
+
"left": null,
|
193 |
+
"margin": null,
|
194 |
+
"max_height": null,
|
195 |
+
"max_width": null,
|
196 |
+
"min_height": null,
|
197 |
+
"min_width": null,
|
198 |
+
"object_fit": null,
|
199 |
+
"object_position": null,
|
200 |
+
"order": null,
|
201 |
+
"overflow": null,
|
202 |
+
"overflow_x": null,
|
203 |
+
"overflow_y": null,
|
204 |
+
"padding": null,
|
205 |
+
"right": null,
|
206 |
+
"top": null,
|
207 |
+
"visibility": null,
|
208 |
+
"width": null
|
209 |
+
}
|
210 |
+
},
|
211 |
+
"4e2c7c7e15234e4db599221802879bac": {
|
212 |
+
"model_module": "@jupyter-widgets/controls",
|
213 |
+
"model_name": "DescriptionStyleModel",
|
214 |
+
"model_module_version": "1.5.0",
|
215 |
+
"state": {
|
216 |
+
"_model_module": "@jupyter-widgets/controls",
|
217 |
+
"_model_module_version": "1.5.0",
|
218 |
+
"_model_name": "DescriptionStyleModel",
|
219 |
+
"_view_count": null,
|
220 |
+
"_view_module": "@jupyter-widgets/base",
|
221 |
+
"_view_module_version": "1.2.0",
|
222 |
+
"_view_name": "StyleView",
|
223 |
+
"description_width": ""
|
224 |
+
}
|
225 |
+
},
|
226 |
+
"8dce0bcb78744bb1ad9cad131ccf2dce": {
|
227 |
+
"model_module": "@jupyter-widgets/base",
|
228 |
+
"model_name": "LayoutModel",
|
229 |
+
"model_module_version": "1.2.0",
|
230 |
+
"state": {
|
231 |
+
"_model_module": "@jupyter-widgets/base",
|
232 |
+
"_model_module_version": "1.2.0",
|
233 |
+
"_model_name": "LayoutModel",
|
234 |
+
"_view_count": null,
|
235 |
+
"_view_module": "@jupyter-widgets/base",
|
236 |
+
"_view_module_version": "1.2.0",
|
237 |
+
"_view_name": "LayoutView",
|
238 |
+
"align_content": null,
|
239 |
+
"align_items": null,
|
240 |
+
"align_self": null,
|
241 |
+
"border": null,
|
242 |
+
"bottom": null,
|
243 |
+
"display": null,
|
244 |
+
"flex": null,
|
245 |
+
"flex_flow": null,
|
246 |
+
"grid_area": null,
|
247 |
+
"grid_auto_columns": null,
|
248 |
+
"grid_auto_flow": null,
|
249 |
+
"grid_auto_rows": null,
|
250 |
+
"grid_column": null,
|
251 |
+
"grid_gap": null,
|
252 |
+
"grid_row": null,
|
253 |
+
"grid_template_areas": null,
|
254 |
+
"grid_template_columns": null,
|
255 |
+
"grid_template_rows": null,
|
256 |
+
"height": null,
|
257 |
+
"justify_content": null,
|
258 |
+
"justify_items": null,
|
259 |
+
"left": null,
|
260 |
+
"margin": null,
|
261 |
+
"max_height": null,
|
262 |
+
"max_width": null,
|
263 |
+
"min_height": null,
|
264 |
+
"min_width": null,
|
265 |
+
"object_fit": null,
|
266 |
+
"object_position": null,
|
267 |
+
"order": null,
|
268 |
+
"overflow": null,
|
269 |
+
"overflow_x": null,
|
270 |
+
"overflow_y": null,
|
271 |
+
"padding": null,
|
272 |
+
"right": null,
|
273 |
+
"top": null,
|
274 |
+
"visibility": null,
|
275 |
+
"width": null
|
276 |
+
}
|
277 |
+
},
|
278 |
+
"dca10a5d095b4061925aa7a68c21809e": {
|
279 |
+
"model_module": "@jupyter-widgets/controls",
|
280 |
+
"model_name": "ProgressStyleModel",
|
281 |
+
"model_module_version": "1.5.0",
|
282 |
+
"state": {
|
283 |
+
"_model_module": "@jupyter-widgets/controls",
|
284 |
+
"_model_module_version": "1.5.0",
|
285 |
+
"_model_name": "ProgressStyleModel",
|
286 |
+
"_view_count": null,
|
287 |
+
"_view_module": "@jupyter-widgets/base",
|
288 |
+
"_view_module_version": "1.2.0",
|
289 |
+
"_view_name": "StyleView",
|
290 |
+
"bar_color": null,
|
291 |
+
"description_width": ""
|
292 |
+
}
|
293 |
+
},
|
294 |
+
"0c958f8b9a9f484db6cbc3f5bfc695e8": {
|
295 |
+
"model_module": "@jupyter-widgets/base",
|
296 |
+
"model_name": "LayoutModel",
|
297 |
+
"model_module_version": "1.2.0",
|
298 |
+
"state": {
|
299 |
+
"_model_module": "@jupyter-widgets/base",
|
300 |
+
"_model_module_version": "1.2.0",
|
301 |
+
"_model_name": "LayoutModel",
|
302 |
+
"_view_count": null,
|
303 |
+
"_view_module": "@jupyter-widgets/base",
|
304 |
+
"_view_module_version": "1.2.0",
|
305 |
+
"_view_name": "LayoutView",
|
306 |
+
"align_content": null,
|
307 |
+
"align_items": null,
|
308 |
+
"align_self": null,
|
309 |
+
"border": null,
|
310 |
+
"bottom": null,
|
311 |
+
"display": null,
|
312 |
+
"flex": null,
|
313 |
+
"flex_flow": null,
|
314 |
+
"grid_area": null,
|
315 |
+
"grid_auto_columns": null,
|
316 |
+
"grid_auto_flow": null,
|
317 |
+
"grid_auto_rows": null,
|
318 |
+
"grid_column": null,
|
319 |
+
"grid_gap": null,
|
320 |
+
"grid_row": null,
|
321 |
+
"grid_template_areas": null,
|
322 |
+
"grid_template_columns": null,
|
323 |
+
"grid_template_rows": null,
|
324 |
+
"height": null,
|
325 |
+
"justify_content": null,
|
326 |
+
"justify_items": null,
|
327 |
+
"left": null,
|
328 |
+
"margin": null,
|
329 |
+
"max_height": null,
|
330 |
+
"max_width": null,
|
331 |
+
"min_height": null,
|
332 |
+
"min_width": null,
|
333 |
+
"object_fit": null,
|
334 |
+
"object_position": null,
|
335 |
+
"order": null,
|
336 |
+
"overflow": null,
|
337 |
+
"overflow_x": null,
|
338 |
+
"overflow_y": null,
|
339 |
+
"padding": null,
|
340 |
+
"right": null,
|
341 |
+
"top": null,
|
342 |
+
"visibility": null,
|
343 |
+
"width": null
|
344 |
+
}
|
345 |
+
},
|
346 |
+
"d0347e27d359452483e0eaf9dcf0679f": {
|
347 |
+
"model_module": "@jupyter-widgets/controls",
|
348 |
+
"model_name": "DescriptionStyleModel",
|
349 |
+
"model_module_version": "1.5.0",
|
350 |
+
"state": {
|
351 |
+
"_model_module": "@jupyter-widgets/controls",
|
352 |
+
"_model_module_version": "1.5.0",
|
353 |
+
"_model_name": "DescriptionStyleModel",
|
354 |
+
"_view_count": null,
|
355 |
+
"_view_module": "@jupyter-widgets/base",
|
356 |
+
"_view_module_version": "1.2.0",
|
357 |
+
"_view_name": "StyleView",
|
358 |
+
"description_width": ""
|
359 |
+
}
|
360 |
+
},
|
361 |
+
"46a18ba44e1545449006c308ea555e96": {
|
362 |
+
"model_module": "@jupyter-widgets/controls",
|
363 |
+
"model_name": "HBoxModel",
|
364 |
+
"model_module_version": "1.5.0",
|
365 |
+
"state": {
|
366 |
+
"_dom_classes": [],
|
367 |
+
"_model_module": "@jupyter-widgets/controls",
|
368 |
+
"_model_module_version": "1.5.0",
|
369 |
+
"_model_name": "HBoxModel",
|
370 |
+
"_view_count": null,
|
371 |
+
"_view_module": "@jupyter-widgets/controls",
|
372 |
+
"_view_module_version": "1.5.0",
|
373 |
+
"_view_name": "HBoxView",
|
374 |
+
"box_style": "",
|
375 |
+
"children": [
|
376 |
+
"IPY_MODEL_08bd2d6fcd5f490a8954966ea59ae04f",
|
377 |
+
"IPY_MODEL_ff958ad6f50b4a598ff87023e2845335",
|
378 |
+
"IPY_MODEL_5e73a13aecfd4288b2629ef758576452"
|
379 |
+
],
|
380 |
+
"layout": "IPY_MODEL_e2c87b8d624f4bcaa498f16fefbb0f1c"
|
381 |
+
}
|
382 |
+
},
|
383 |
+
"08bd2d6fcd5f490a8954966ea59ae04f": {
|
384 |
+
"model_module": "@jupyter-widgets/controls",
|
385 |
+
"model_name": "HTMLModel",
|
386 |
+
"model_module_version": "1.5.0",
|
387 |
+
"state": {
|
388 |
+
"_dom_classes": [],
|
389 |
+
"_model_module": "@jupyter-widgets/controls",
|
390 |
+
"_model_module_version": "1.5.0",
|
391 |
+
"_model_name": "HTMLModel",
|
392 |
+
"_view_count": null,
|
393 |
+
"_view_module": "@jupyter-widgets/controls",
|
394 |
+
"_view_module_version": "1.5.0",
|
395 |
+
"_view_name": "HTMLView",
|
396 |
+
"description": "",
|
397 |
+
"description_tooltip": null,
|
398 |
+
"layout": "IPY_MODEL_5f31ce08dc3b41118bf500c31730b621",
|
399 |
+
"placeholder": "โ",
|
400 |
+
"style": "IPY_MODEL_9858845bd97f4f3ca946638919bc8bf1",
|
401 |
+
"value": "Downloading (โฆ)neration_config.json: 100%"
|
402 |
+
}
|
403 |
+
},
|
404 |
+
"ff958ad6f50b4a598ff87023e2845335": {
|
405 |
+
"model_module": "@jupyter-widgets/controls",
|
406 |
+
"model_name": "FloatProgressModel",
|
407 |
+
"model_module_version": "1.5.0",
|
408 |
+
"state": {
|
409 |
+
"_dom_classes": [],
|
410 |
+
"_model_module": "@jupyter-widgets/controls",
|
411 |
+
"_model_module_version": "1.5.0",
|
412 |
+
"_model_name": "FloatProgressModel",
|
413 |
+
"_view_count": null,
|
414 |
+
"_view_module": "@jupyter-widgets/controls",
|
415 |
+
"_view_module_version": "1.5.0",
|
416 |
+
"_view_name": "ProgressView",
|
417 |
+
"bar_style": "success",
|
418 |
+
"description": "",
|
419 |
+
"description_tooltip": null,
|
420 |
+
"layout": "IPY_MODEL_60963f8bd5bd4ae2821ebdbede702b81",
|
421 |
+
"max": 270,
|
422 |
+
"min": 0,
|
423 |
+
"orientation": "horizontal",
|
424 |
+
"style": "IPY_MODEL_9999eaa6381946748302ee1ef98bd588",
|
425 |
+
"value": 270
|
426 |
+
}
|
427 |
+
},
|
428 |
+
"5e73a13aecfd4288b2629ef758576452": {
|
429 |
+
"model_module": "@jupyter-widgets/controls",
|
430 |
+
"model_name": "HTMLModel",
|
431 |
+
"model_module_version": "1.5.0",
|
432 |
+
"state": {
|
433 |
+
"_dom_classes": [],
|
434 |
+
"_model_module": "@jupyter-widgets/controls",
|
435 |
+
"_model_module_version": "1.5.0",
|
436 |
+
"_model_name": "HTMLModel",
|
437 |
+
"_view_count": null,
|
438 |
+
"_view_module": "@jupyter-widgets/controls",
|
439 |
+
"_view_module_version": "1.5.0",
|
440 |
+
"_view_name": "HTMLView",
|
441 |
+
"description": "",
|
442 |
+
"description_tooltip": null,
|
443 |
+
"layout": "IPY_MODEL_23346e7a33fd444494bfd54dfff2b495",
|
444 |
+
"placeholder": "โ",
|
445 |
+
"style": "IPY_MODEL_2480073d215a485693e98298f7547da8",
|
446 |
+
"value": " 270/270 [00:00<00:00, 16.5kB/s]"
|
447 |
+
}
|
448 |
+
},
|
449 |
+
"e2c87b8d624f4bcaa498f16fefbb0f1c": {
|
450 |
+
"model_module": "@jupyter-widgets/base",
|
451 |
+
"model_name": "LayoutModel",
|
452 |
+
"model_module_version": "1.2.0",
|
453 |
+
"state": {
|
454 |
+
"_model_module": "@jupyter-widgets/base",
|
455 |
+
"_model_module_version": "1.2.0",
|
456 |
+
"_model_name": "LayoutModel",
|
457 |
+
"_view_count": null,
|
458 |
+
"_view_module": "@jupyter-widgets/base",
|
459 |
+
"_view_module_version": "1.2.0",
|
460 |
+
"_view_name": "LayoutView",
|
461 |
+
"align_content": null,
|
462 |
+
"align_items": null,
|
463 |
+
"align_self": null,
|
464 |
+
"border": null,
|
465 |
+
"bottom": null,
|
466 |
+
"display": null,
|
467 |
+
"flex": null,
|
468 |
+
"flex_flow": null,
|
469 |
+
"grid_area": null,
|
470 |
+
"grid_auto_columns": null,
|
471 |
+
"grid_auto_flow": null,
|
472 |
+
"grid_auto_rows": null,
|
473 |
+
"grid_column": null,
|
474 |
+
"grid_gap": null,
|
475 |
+
"grid_row": null,
|
476 |
+
"grid_template_areas": null,
|
477 |
+
"grid_template_columns": null,
|
478 |
+
"grid_template_rows": null,
|
479 |
+
"height": null,
|
480 |
+
"justify_content": null,
|
481 |
+
"justify_items": null,
|
482 |
+
"left": null,
|
483 |
+
"margin": null,
|
484 |
+
"max_height": null,
|
485 |
+
"max_width": null,
|
486 |
+
"min_height": null,
|
487 |
+
"min_width": null,
|
488 |
+
"object_fit": null,
|
489 |
+
"object_position": null,
|
490 |
+
"order": null,
|
491 |
+
"overflow": null,
|
492 |
+
"overflow_x": null,
|
493 |
+
"overflow_y": null,
|
494 |
+
"padding": null,
|
495 |
+
"right": null,
|
496 |
+
"top": null,
|
497 |
+
"visibility": null,
|
498 |
+
"width": null
|
499 |
+
}
|
500 |
+
},
|
501 |
+
"5f31ce08dc3b41118bf500c31730b621": {
|
502 |
+
"model_module": "@jupyter-widgets/base",
|
503 |
+
"model_name": "LayoutModel",
|
504 |
+
"model_module_version": "1.2.0",
|
505 |
+
"state": {
|
506 |
+
"_model_module": "@jupyter-widgets/base",
|
507 |
+
"_model_module_version": "1.2.0",
|
508 |
+
"_model_name": "LayoutModel",
|
509 |
+
"_view_count": null,
|
510 |
+
"_view_module": "@jupyter-widgets/base",
|
511 |
+
"_view_module_version": "1.2.0",
|
512 |
+
"_view_name": "LayoutView",
|
513 |
+
"align_content": null,
|
514 |
+
"align_items": null,
|
515 |
+
"align_self": null,
|
516 |
+
"border": null,
|
517 |
+
"bottom": null,
|
518 |
+
"display": null,
|
519 |
+
"flex": null,
|
520 |
+
"flex_flow": null,
|
521 |
+
"grid_area": null,
|
522 |
+
"grid_auto_columns": null,
|
523 |
+
"grid_auto_flow": null,
|
524 |
+
"grid_auto_rows": null,
|
525 |
+
"grid_column": null,
|
526 |
+
"grid_gap": null,
|
527 |
+
"grid_row": null,
|
528 |
+
"grid_template_areas": null,
|
529 |
+
"grid_template_columns": null,
|
530 |
+
"grid_template_rows": null,
|
531 |
+
"height": null,
|
532 |
+
"justify_content": null,
|
533 |
+
"justify_items": null,
|
534 |
+
"left": null,
|
535 |
+
"margin": null,
|
536 |
+
"max_height": null,
|
537 |
+
"max_width": null,
|
538 |
+
"min_height": null,
|
539 |
+
"min_width": null,
|
540 |
+
"object_fit": null,
|
541 |
+
"object_position": null,
|
542 |
+
"order": null,
|
543 |
+
"overflow": null,
|
544 |
+
"overflow_x": null,
|
545 |
+
"overflow_y": null,
|
546 |
+
"padding": null,
|
547 |
+
"right": null,
|
548 |
+
"top": null,
|
549 |
+
"visibility": null,
|
550 |
+
"width": null
|
551 |
+
}
|
552 |
+
},
|
553 |
+
"9858845bd97f4f3ca946638919bc8bf1": {
|
554 |
+
"model_module": "@jupyter-widgets/controls",
|
555 |
+
"model_name": "DescriptionStyleModel",
|
556 |
+
"model_module_version": "1.5.0",
|
557 |
+
"state": {
|
558 |
+
"_model_module": "@jupyter-widgets/controls",
|
559 |
+
"_model_module_version": "1.5.0",
|
560 |
+
"_model_name": "DescriptionStyleModel",
|
561 |
+
"_view_count": null,
|
562 |
+
"_view_module": "@jupyter-widgets/base",
|
563 |
+
"_view_module_version": "1.2.0",
|
564 |
+
"_view_name": "StyleView",
|
565 |
+
"description_width": ""
|
566 |
+
}
|
567 |
+
},
|
568 |
+
"60963f8bd5bd4ae2821ebdbede702b81": {
|
569 |
+
"model_module": "@jupyter-widgets/base",
|
570 |
+
"model_name": "LayoutModel",
|
571 |
+
"model_module_version": "1.2.0",
|
572 |
+
"state": {
|
573 |
+
"_model_module": "@jupyter-widgets/base",
|
574 |
+
"_model_module_version": "1.2.0",
|
575 |
+
"_model_name": "LayoutModel",
|
576 |
+
"_view_count": null,
|
577 |
+
"_view_module": "@jupyter-widgets/base",
|
578 |
+
"_view_module_version": "1.2.0",
|
579 |
+
"_view_name": "LayoutView",
|
580 |
+
"align_content": null,
|
581 |
+
"align_items": null,
|
582 |
+
"align_self": null,
|
583 |
+
"border": null,
|
584 |
+
"bottom": null,
|
585 |
+
"display": null,
|
586 |
+
"flex": null,
|
587 |
+
"flex_flow": null,
|
588 |
+
"grid_area": null,
|
589 |
+
"grid_auto_columns": null,
|
590 |
+
"grid_auto_flow": null,
|
591 |
+
"grid_auto_rows": null,
|
592 |
+
"grid_column": null,
|
593 |
+
"grid_gap": null,
|
594 |
+
"grid_row": null,
|
595 |
+
"grid_template_areas": null,
|
596 |
+
"grid_template_columns": null,
|
597 |
+
"grid_template_rows": null,
|
598 |
+
"height": null,
|
599 |
+
"justify_content": null,
|
600 |
+
"justify_items": null,
|
601 |
+
"left": null,
|
602 |
+
"margin": null,
|
603 |
+
"max_height": null,
|
604 |
+
"max_width": null,
|
605 |
+
"min_height": null,
|
606 |
+
"min_width": null,
|
607 |
+
"object_fit": null,
|
608 |
+
"object_position": null,
|
609 |
+
"order": null,
|
610 |
+
"overflow": null,
|
611 |
+
"overflow_x": null,
|
612 |
+
"overflow_y": null,
|
613 |
+
"padding": null,
|
614 |
+
"right": null,
|
615 |
+
"top": null,
|
616 |
+
"visibility": null,
|
617 |
+
"width": null
|
618 |
+
}
|
619 |
+
},
|
620 |
+
"9999eaa6381946748302ee1ef98bd588": {
|
621 |
+
"model_module": "@jupyter-widgets/controls",
|
622 |
+
"model_name": "ProgressStyleModel",
|
623 |
+
"model_module_version": "1.5.0",
|
624 |
+
"state": {
|
625 |
+
"_model_module": "@jupyter-widgets/controls",
|
626 |
+
"_model_module_version": "1.5.0",
|
627 |
+
"_model_name": "ProgressStyleModel",
|
628 |
+
"_view_count": null,
|
629 |
+
"_view_module": "@jupyter-widgets/base",
|
630 |
+
"_view_module_version": "1.2.0",
|
631 |
+
"_view_name": "StyleView",
|
632 |
+
"bar_color": null,
|
633 |
+
"description_width": ""
|
634 |
+
}
|
635 |
+
},
|
636 |
+
"23346e7a33fd444494bfd54dfff2b495": {
|
637 |
+
"model_module": "@jupyter-widgets/base",
|
638 |
+
"model_name": "LayoutModel",
|
639 |
+
"model_module_version": "1.2.0",
|
640 |
+
"state": {
|
641 |
+
"_model_module": "@jupyter-widgets/base",
|
642 |
+
"_model_module_version": "1.2.0",
|
643 |
+
"_model_name": "LayoutModel",
|
644 |
+
"_view_count": null,
|
645 |
+
"_view_module": "@jupyter-widgets/base",
|
646 |
+
"_view_module_version": "1.2.0",
|
647 |
+
"_view_name": "LayoutView",
|
648 |
+
"align_content": null,
|
649 |
+
"align_items": null,
|
650 |
+
"align_self": null,
|
651 |
+
"border": null,
|
652 |
+
"bottom": null,
|
653 |
+
"display": null,
|
654 |
+
"flex": null,
|
655 |
+
"flex_flow": null,
|
656 |
+
"grid_area": null,
|
657 |
+
"grid_auto_columns": null,
|
658 |
+
"grid_auto_flow": null,
|
659 |
+
"grid_auto_rows": null,
|
660 |
+
"grid_column": null,
|
661 |
+
"grid_gap": null,
|
662 |
+
"grid_row": null,
|
663 |
+
"grid_template_areas": null,
|
664 |
+
"grid_template_columns": null,
|
665 |
+
"grid_template_rows": null,
|
666 |
+
"height": null,
|
667 |
+
"justify_content": null,
|
668 |
+
"justify_items": null,
|
669 |
+
"left": null,
|
670 |
+
"margin": null,
|
671 |
+
"max_height": null,
|
672 |
+
"max_width": null,
|
673 |
+
"min_height": null,
|
674 |
+
"min_width": null,
|
675 |
+
"object_fit": null,
|
676 |
+
"object_position": null,
|
677 |
+
"order": null,
|
678 |
+
"overflow": null,
|
679 |
+
"overflow_x": null,
|
680 |
+
"overflow_y": null,
|
681 |
+
"padding": null,
|
682 |
+
"right": null,
|
683 |
+
"top": null,
|
684 |
+
"visibility": null,
|
685 |
+
"width": null
|
686 |
+
}
|
687 |
+
},
|
688 |
+
"2480073d215a485693e98298f7547da8": {
|
689 |
+
"model_module": "@jupyter-widgets/controls",
|
690 |
+
"model_name": "DescriptionStyleModel",
|
691 |
+
"model_module_version": "1.5.0",
|
692 |
+
"state": {
|
693 |
+
"_model_module": "@jupyter-widgets/controls",
|
694 |
+
"_model_module_version": "1.5.0",
|
695 |
+
"_model_name": "DescriptionStyleModel",
|
696 |
+
"_view_count": null,
|
697 |
+
"_view_module": "@jupyter-widgets/base",
|
698 |
+
"_view_module_version": "1.2.0",
|
699 |
+
"_view_name": "StyleView",
|
700 |
+
"description_width": ""
|
701 |
+
}
|
702 |
+
}
|
703 |
+
}
|
704 |
+
}
|
705 |
+
},
|
706 |
+
"cells": [
|
707 |
+
{
|
708 |
+
"cell_type": "code",
|
709 |
+
"source": [
|
710 |
+
"!pip install transformers safetensors timm"
|
711 |
+
],
|
712 |
+
"metadata": {
|
713 |
+
"colab": {
|
714 |
+
"base_uri": "https://localhost:8080/"
|
715 |
+
},
|
716 |
+
"id": "OlKt6RfDMij7",
|
717 |
+
"outputId": "40545d76-3ff8-49de-df94-2b8c6a306141"
|
718 |
+
},
|
719 |
+
"execution_count": 5,
|
720 |
+
"outputs": [
|
721 |
+
{
|
722 |
+
"output_type": "stream",
|
723 |
+
"name": "stdout",
|
724 |
+
"text": [
|
725 |
+
"Requirement already satisfied: transformers in /usr/local/lib/python3.10/dist-packages (4.34.1)\n",
|
726 |
+
"Requirement already satisfied: safetensors in /usr/local/lib/python3.10/dist-packages (0.4.0)\n",
|
727 |
+
"Collecting timm\n",
|
728 |
+
" Downloading timm-0.9.7-py3-none-any.whl (2.2 MB)\n",
|
729 |
+
"\u001b[2K \u001b[90mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ\u001b[0m \u001b[32m2.2/2.2 MB\u001b[0m \u001b[31m9.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
730 |
+
"\u001b[?25hRequirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from transformers) (3.12.4)\n",
|
731 |
+
"Requirement already satisfied: huggingface-hub<1.0,>=0.16.4 in /usr/local/lib/python3.10/dist-packages (from transformers) (0.17.3)\n",
|
732 |
+
"Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from transformers) (1.23.5)\n",
|
733 |
+
"Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from transformers) (23.2)\n",
|
734 |
+
"Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from transformers) (6.0.1)\n",
|
735 |
+
"Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.10/dist-packages (from transformers) (2023.6.3)\n",
|
736 |
+
"Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from transformers) (2.31.0)\n",
|
737 |
+
"Requirement already satisfied: tokenizers<0.15,>=0.14 in /usr/local/lib/python3.10/dist-packages (from transformers) (0.14.1)\n",
|
738 |
+
"Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.10/dist-packages (from transformers) (4.66.1)\n",
|
739 |
+
"Requirement already satisfied: torch>=1.7 in /usr/local/lib/python3.10/dist-packages (from timm) (2.0.1+cu118)\n",
|
740 |
+
"Requirement already satisfied: torchvision in /usr/local/lib/python3.10/dist-packages (from timm) (0.15.2+cu118)\n",
|
741 |
+
"Requirement already satisfied: fsspec in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<1.0,>=0.16.4->transformers) (2023.6.0)\n",
|
742 |
+
"Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<1.0,>=0.16.4->transformers) (4.5.0)\n",
|
743 |
+
"Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch>=1.7->timm) (1.12)\n",
|
744 |
+
"Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch>=1.7->timm) (3.1)\n",
|
745 |
+
"Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch>=1.7->timm) (3.1.2)\n",
|
746 |
+
"Requirement already satisfied: triton==2.0.0 in /usr/local/lib/python3.10/dist-packages (from torch>=1.7->timm) (2.0.0)\n",
|
747 |
+
"Requirement already satisfied: cmake in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch>=1.7->timm) (3.27.7)\n",
|
748 |
+
"Requirement already satisfied: lit in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch>=1.7->timm) (17.0.2)\n",
|
749 |
+
"Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->transformers) (3.3.0)\n",
|
750 |
+
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->transformers) (3.4)\n",
|
751 |
+
"Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->transformers) (2.0.6)\n",
|
752 |
+
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->transformers) (2023.7.22)\n",
|
753 |
+
"Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in /usr/local/lib/python3.10/dist-packages (from torchvision->timm) (9.4.0)\n",
|
754 |
+
"Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->torch>=1.7->timm) (2.1.3)\n",
|
755 |
+
"Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch>=1.7->timm) (1.3.0)\n",
|
756 |
+
"Installing collected packages: timm\n",
|
757 |
+
"Successfully installed timm-0.9.7\n"
|
758 |
+
]
|
759 |
+
}
|
760 |
+
]
|
761 |
+
},
|
762 |
+
{
|
763 |
+
"cell_type": "code",
|
764 |
+
"source": [
|
765 |
+
"!git clone https://github.com/syncdoth/RetNet"
|
766 |
+
],
|
767 |
+
"metadata": {
|
768 |
+
"colab": {
|
769 |
+
"base_uri": "https://localhost:8080/"
|
770 |
+
},
|
771 |
+
"id": "HTRD6CdEO-vW",
|
772 |
+
"outputId": "aac318db-2314-4f98-fa3a-4fbe3d0ae4e9"
|
773 |
+
},
|
774 |
+
"execution_count": 3,
|
775 |
+
"outputs": [
|
776 |
+
{
|
777 |
+
"output_type": "stream",
|
778 |
+
"name": "stdout",
|
779 |
+
"text": [
|
780 |
+
"Cloning into 'RetNet'...\n",
|
781 |
+
"remote: Enumerating objects: 340, done.\u001b[K\n",
|
782 |
+
"remote: Counting objects: 100% (135/135), done.\u001b[K\n",
|
783 |
+
"remote: Compressing objects: 100% (41/41), done.\u001b[K\n",
|
784 |
+
"remote: Total 340 (delta 113), reused 95 (delta 94), pack-reused 205\u001b[K\n",
|
785 |
+
"Receiving objects: 100% (340/340), 202.75 KiB | 7.24 MiB/s, done.\n",
|
786 |
+
"Resolving deltas: 100% (202/202), done.\n"
|
787 |
+
]
|
788 |
+
}
|
789 |
+
]
|
790 |
+
},
|
791 |
+
{
|
792 |
+
"cell_type": "code",
|
793 |
+
"execution_count": 6,
|
794 |
+
"metadata": {
|
795 |
+
"colab": {
|
796 |
+
"base_uri": "https://localhost:8080/",
|
797 |
+
"height": 117,
|
798 |
+
"referenced_widgets": [
|
799 |
+
"754146b195d540208987dfbfb62b1e42",
|
800 |
+
"71baddbb1b0b4593abd31da8f3a7db46",
|
801 |
+
"1f9127a98eb44a459bfc2afcb9d56f08",
|
802 |
+
"a3cd941beb884d40bd68c59f911ddbd1",
|
803 |
+
"f2de1572030d4cf1a769e569efeae650",
|
804 |
+
"0e71b6b8eeec4408a5b536e9b22db760",
|
805 |
+
"4e2c7c7e15234e4db599221802879bac",
|
806 |
+
"8dce0bcb78744bb1ad9cad131ccf2dce",
|
807 |
+
"dca10a5d095b4061925aa7a68c21809e",
|
808 |
+
"0c958f8b9a9f484db6cbc3f5bfc695e8",
|
809 |
+
"d0347e27d359452483e0eaf9dcf0679f",
|
810 |
+
"46a18ba44e1545449006c308ea555e96",
|
811 |
+
"08bd2d6fcd5f490a8954966ea59ae04f",
|
812 |
+
"ff958ad6f50b4a598ff87023e2845335",
|
813 |
+
"5e73a13aecfd4288b2629ef758576452",
|
814 |
+
"e2c87b8d624f4bcaa498f16fefbb0f1c",
|
815 |
+
"5f31ce08dc3b41118bf500c31730b621",
|
816 |
+
"9858845bd97f4f3ca946638919bc8bf1",
|
817 |
+
"60963f8bd5bd4ae2821ebdbede702b81",
|
818 |
+
"9999eaa6381946748302ee1ef98bd588",
|
819 |
+
"23346e7a33fd444494bfd54dfff2b495",
|
820 |
+
"2480073d215a485693e98298f7547da8"
|
821 |
+
]
|
822 |
+
},
|
823 |
+
"id": "RRH_EDOFMgGq",
|
824 |
+
"outputId": "a9c49753-9240-4454-ac5a-656c6d4efa2e"
|
825 |
+
},
|
826 |
+
"outputs": [
|
827 |
+
{
|
828 |
+
"output_type": "display_data",
|
829 |
+
"data": {
|
830 |
+
"text/plain": [
|
831 |
+
"Downloading model.safetensors: 0%| | 0.00/1.62G [00:00<?, ?B/s]"
|
832 |
+
],
|
833 |
+
"application/vnd.jupyter.widget-view+json": {
|
834 |
+
"version_major": 2,
|
835 |
+
"version_minor": 0,
|
836 |
+
"model_id": "754146b195d540208987dfbfb62b1e42"
|
837 |
+
}
|
838 |
+
},
|
839 |
+
"metadata": {}
|
840 |
+
},
|
841 |
+
{
|
842 |
+
"output_type": "display_data",
|
843 |
+
"data": {
|
844 |
+
"text/plain": [
|
845 |
+
"Downloading (โฆ)neration_config.json: 0%| | 0.00/270 [00:00<?, ?B/s]"
|
846 |
+
],
|
847 |
+
"application/vnd.jupyter.widget-view+json": {
|
848 |
+
"version_major": 2,
|
849 |
+
"version_minor": 0,
|
850 |
+
"model_id": "46a18ba44e1545449006c308ea555e96"
|
851 |
+
}
|
852 |
+
},
|
853 |
+
"metadata": {}
|
854 |
+
},
|
855 |
+
{
|
856 |
+
"output_type": "stream",
|
857 |
+
"name": "stdout",
|
858 |
+
"text": [
|
859 |
+
"Generating...\n",
|
860 |
+
"็ฎใ่ฆใใใจใๅใฏใใใใใไฝใ่ตทใใใฆๅฏใฆใใใ ใใใใฃ!!ใ ๅฃฐใซๅๅฟใใใฎใงๅฃฐใฎๆนใ่ฆใใใใใจใใใซใฏ่ฆ่ฆใใฎใชใๅฅณๆง\n"
|
861 |
+
]
|
862 |
+
}
|
863 |
+
],
|
864 |
+
"source": [
|
865 |
+
"from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig\n",
|
866 |
+
"\n",
|
867 |
+
"MODEL_NAME = \"p1atdev/LightNovel-Intro-RetNet-400M\"\n",
|
868 |
+
"\n",
|
869 |
+
"device = \"cuda\"\n",
|
870 |
+
"\n",
|
871 |
+
"tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)\n",
|
872 |
+
"model = AutoModelForCausalLM.from_pretrained(\n",
|
873 |
+
" MODEL_NAME,\n",
|
874 |
+
" trust_remote_code=True,\n",
|
875 |
+
").to(device)\n",
|
876 |
+
"gen_config = GenerationConfig.from_pretrained(MODEL_NAME)\n",
|
877 |
+
"gen_config.max_new_tokens = 32\n",
|
878 |
+
"\n",
|
879 |
+
"inputs = tokenizer(\"็ฎใ่ฆใใใจใ\", return_tensors=\"pt\", add_special_tokens=False).to(device)\n",
|
880 |
+
"\n",
|
881 |
+
"print(\"Generating...\")\n",
|
882 |
+
"\n",
|
883 |
+
"result = model.generate(**inputs, generation_config=gen_config)\n",
|
884 |
+
"\n",
|
885 |
+
"print(tokenizer.decode(result[0], skip_special_tokens=True))\n",
|
886 |
+
"# ็ฎใ่ฆใใใจใ่ฆ็ฅใใฌ็ฉบ้ใซๅฑ
ใใ ใใ......?ใ ๆใใใใใชๅฃฐใๅบใใใจใซ้ๅๆใๆใใใ็ขบใใๆฐไปใใฐ็งใฏ\n"
|
887 |
+
]
|
888 |
+
}
|
889 |
+
]
|
890 |
+
}
|