dannoncaffeine commited on
Commit
95aa231
·
1 Parent(s): acbf433

feat: update notebook file

Browse files
Files changed (1) hide show
  1. GPT2_124M_wikitext_v0_1.ipynb +1306 -868
GPT2_124M_wikitext_v0_1.ipynb CHANGED
@@ -1,911 +1,1349 @@
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
- "72d3f33c56a14b01bef05ea2ae98e72f": {
20
- "model_module": "@jupyter-widgets/controls",
21
- "model_name": "VBoxModel",
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": "VBoxModel",
28
- "_view_count": null,
29
- "_view_module": "@jupyter-widgets/controls",
30
- "_view_module_version": "1.5.0",
31
- "_view_name": "VBoxView",
32
- "box_style": "",
33
- "children": [
34
- "IPY_MODEL_8d44cf16b34d40bd8702560ae149192c",
35
- "IPY_MODEL_13af4957747d40bbb9501bc13c3c160b",
36
- "IPY_MODEL_1be0b602c74f4a7182bd041aeba58112",
37
- "IPY_MODEL_af225dc2d79649c2ac0e853c517a0482",
38
- "IPY_MODEL_f019d8eee73f4b7b8312029f03040c45"
39
- ],
40
- "layout": "IPY_MODEL_d1deb908be244cfb8dd253b3cc081510"
41
- }
42
- },
43
- "8d44cf16b34d40bd8702560ae149192c": {
44
- "model_module": "@jupyter-widgets/controls",
45
- "model_name": "HTMLModel",
46
- "model_module_version": "1.5.0",
47
- "state": {
48
- "_dom_classes": [],
49
- "_model_module": "@jupyter-widgets/controls",
50
- "_model_module_version": "1.5.0",
51
- "_model_name": "HTMLModel",
52
- "_view_count": null,
53
- "_view_module": "@jupyter-widgets/controls",
54
- "_view_module_version": "1.5.0",
55
- "_view_name": "HTMLView",
56
- "description": "",
57
- "description_tooltip": null,
58
- "layout": "IPY_MODEL_06e659f7bd9149e784a5cb68efbad736",
59
- "placeholder": "​",
60
- "style": "IPY_MODEL_ba1f1326e12d437a9fd76faa226eec44",
61
- "value": "<center> <img\nsrc=https://huggingface.co/front/assets/huggingface_logo-noborder.svg\nalt='Hugging Face'> <br> Copy a token from <a\nhref=\"https://huggingface.co/settings/tokens\" target=\"_blank\">your Hugging Face\ntokens page</a> and paste it below. <br> Immediately click login after copying\nyour token or it might be stored in plain text in this notebook file. </center>"
62
- }
63
- },
64
- "13af4957747d40bbb9501bc13c3c160b": {
65
- "model_module": "@jupyter-widgets/controls",
66
- "model_name": "PasswordModel",
67
- "model_module_version": "1.5.0",
68
- "state": {
69
- "_dom_classes": [],
70
- "_model_module": "@jupyter-widgets/controls",
71
- "_model_module_version": "1.5.0",
72
- "_model_name": "PasswordModel",
73
- "_view_count": null,
74
- "_view_module": "@jupyter-widgets/controls",
75
- "_view_module_version": "1.5.0",
76
- "_view_name": "PasswordView",
77
- "continuous_update": true,
78
- "description": "Token:",
79
- "description_tooltip": null,
80
- "disabled": false,
81
- "layout": "IPY_MODEL_65ea346ce3174bb098344531db439eac",
82
- "placeholder": "​",
83
- "style": "IPY_MODEL_6ac7576be7204aeca73385c48e1c5d0a",
84
- "value": "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"
85
- }
86
- },
87
- "1be0b602c74f4a7182bd041aeba58112": {
88
- "model_module": "@jupyter-widgets/controls",
89
- "model_name": "CheckboxModel",
90
- "model_module_version": "1.5.0",
91
- "state": {
92
- "_dom_classes": [],
93
- "_model_module": "@jupyter-widgets/controls",
94
- "_model_module_version": "1.5.0",
95
- "_model_name": "CheckboxModel",
96
- "_view_count": null,
97
- "_view_module": "@jupyter-widgets/controls",
98
- "_view_module_version": "1.5.0",
99
- "_view_name": "CheckboxView",
100
- "description": "Add token as git credential?",
101
- "description_tooltip": null,
102
- "disabled": false,
103
- "indent": true,
104
- "layout": "IPY_MODEL_7fd3c4de83234008a72d9541c29ce765",
105
- "style": "IPY_MODEL_b81585732ca14c89ae1b5bb25735cd62",
106
- "value": true
107
- }
108
- },
109
- "af225dc2d79649c2ac0e853c517a0482": {
110
- "model_module": "@jupyter-widgets/controls",
111
- "model_name": "ButtonModel",
112
- "model_module_version": "1.5.0",
113
- "state": {
114
- "_dom_classes": [],
115
- "_model_module": "@jupyter-widgets/controls",
116
- "_model_module_version": "1.5.0",
117
- "_model_name": "ButtonModel",
118
- "_view_count": null,
119
- "_view_module": "@jupyter-widgets/controls",
120
- "_view_module_version": "1.5.0",
121
- "_view_name": "ButtonView",
122
- "button_style": "",
123
- "description": "Login",
124
- "disabled": false,
125
- "icon": "",
126
- "layout": "IPY_MODEL_a68a4415305045c0a89c60349175cc82",
127
- "style": "IPY_MODEL_7316ece4ad474193bcc5b5db55632561",
128
- "tooltip": ""
129
- }
130
- },
131
- "f019d8eee73f4b7b8312029f03040c45": {
132
- "model_module": "@jupyter-widgets/controls",
133
- "model_name": "HTMLModel",
134
- "model_module_version": "1.5.0",
135
- "state": {
136
- "_dom_classes": [],
137
- "_model_module": "@jupyter-widgets/controls",
138
- "_model_module_version": "1.5.0",
139
- "_model_name": "HTMLModel",
140
- "_view_count": null,
141
- "_view_module": "@jupyter-widgets/controls",
142
- "_view_module_version": "1.5.0",
143
- "_view_name": "HTMLView",
144
- "description": "",
145
- "description_tooltip": null,
146
- "layout": "IPY_MODEL_c0bb9ace36d64b8296bd35d538bd4f7e",
147
- "placeholder": "​",
148
- "style": "IPY_MODEL_03ad39c22f644e55bcffa070e3832582",
149
- "value": "\n<b>Pro Tip:</b> If you don't already have one, you can create a dedicated\n'notebooks' token with 'write' access, that you can then easily reuse for all\nnotebooks. </center>"
150
- }
151
- },
152
- "d1deb908be244cfb8dd253b3cc081510": {
153
- "model_module": "@jupyter-widgets/base",
154
- "model_name": "LayoutModel",
155
- "model_module_version": "1.2.0",
156
- "state": {
157
- "_model_module": "@jupyter-widgets/base",
158
- "_model_module_version": "1.2.0",
159
- "_model_name": "LayoutModel",
160
- "_view_count": null,
161
- "_view_module": "@jupyter-widgets/base",
162
- "_view_module_version": "1.2.0",
163
- "_view_name": "LayoutView",
164
- "align_content": null,
165
- "align_items": "center",
166
- "align_self": null,
167
- "border": null,
168
- "bottom": null,
169
- "display": "flex",
170
- "flex": null,
171
- "flex_flow": "column",
172
- "grid_area": null,
173
- "grid_auto_columns": null,
174
- "grid_auto_flow": null,
175
- "grid_auto_rows": null,
176
- "grid_column": null,
177
- "grid_gap": null,
178
- "grid_row": null,
179
- "grid_template_areas": null,
180
- "grid_template_columns": null,
181
- "grid_template_rows": null,
182
- "height": null,
183
- "justify_content": null,
184
- "justify_items": null,
185
- "left": null,
186
- "margin": null,
187
- "max_height": null,
188
- "max_width": null,
189
- "min_height": null,
190
- "min_width": null,
191
- "object_fit": null,
192
- "object_position": null,
193
- "order": null,
194
- "overflow": null,
195
- "overflow_x": null,
196
- "overflow_y": null,
197
- "padding": null,
198
- "right": null,
199
- "top": null,
200
- "visibility": null,
201
- "width": "50%"
202
- }
203
- },
204
- "06e659f7bd9149e784a5cb68efbad736": {
205
- "model_module": "@jupyter-widgets/base",
206
- "model_name": "LayoutModel",
207
- "model_module_version": "1.2.0",
208
- "state": {
209
- "_model_module": "@jupyter-widgets/base",
210
- "_model_module_version": "1.2.0",
211
- "_model_name": "LayoutModel",
212
- "_view_count": null,
213
- "_view_module": "@jupyter-widgets/base",
214
- "_view_module_version": "1.2.0",
215
- "_view_name": "LayoutView",
216
- "align_content": null,
217
- "align_items": null,
218
- "align_self": null,
219
- "border": null,
220
- "bottom": null,
221
- "display": null,
222
- "flex": null,
223
- "flex_flow": null,
224
- "grid_area": null,
225
- "grid_auto_columns": null,
226
- "grid_auto_flow": null,
227
- "grid_auto_rows": null,
228
- "grid_column": null,
229
- "grid_gap": null,
230
- "grid_row": null,
231
- "grid_template_areas": null,
232
- "grid_template_columns": null,
233
- "grid_template_rows": null,
234
- "height": null,
235
- "justify_content": null,
236
- "justify_items": null,
237
- "left": null,
238
- "margin": null,
239
- "max_height": null,
240
- "max_width": null,
241
- "min_height": null,
242
- "min_width": null,
243
- "object_fit": null,
244
- "object_position": null,
245
- "order": null,
246
- "overflow": null,
247
- "overflow_x": null,
248
- "overflow_y": null,
249
- "padding": null,
250
- "right": null,
251
- "top": null,
252
- "visibility": null,
253
- "width": null
254
- }
255
- },
256
- "ba1f1326e12d437a9fd76faa226eec44": {
257
- "model_module": "@jupyter-widgets/controls",
258
- "model_name": "DescriptionStyleModel",
259
- "model_module_version": "1.5.0",
260
- "state": {
261
- "_model_module": "@jupyter-widgets/controls",
262
- "_model_module_version": "1.5.0",
263
- "_model_name": "DescriptionStyleModel",
264
- "_view_count": null,
265
- "_view_module": "@jupyter-widgets/base",
266
- "_view_module_version": "1.2.0",
267
- "_view_name": "StyleView",
268
- "description_width": ""
269
- }
270
- },
271
- "65ea346ce3174bb098344531db439eac": {
272
- "model_module": "@jupyter-widgets/base",
273
- "model_name": "LayoutModel",
274
- "model_module_version": "1.2.0",
275
- "state": {
276
- "_model_module": "@jupyter-widgets/base",
277
- "_model_module_version": "1.2.0",
278
- "_model_name": "LayoutModel",
279
- "_view_count": null,
280
- "_view_module": "@jupyter-widgets/base",
281
- "_view_module_version": "1.2.0",
282
- "_view_name": "LayoutView",
283
- "align_content": null,
284
- "align_items": null,
285
- "align_self": null,
286
- "border": null,
287
- "bottom": null,
288
- "display": null,
289
- "flex": null,
290
- "flex_flow": null,
291
- "grid_area": null,
292
- "grid_auto_columns": null,
293
- "grid_auto_flow": null,
294
- "grid_auto_rows": null,
295
- "grid_column": null,
296
- "grid_gap": null,
297
- "grid_row": null,
298
- "grid_template_areas": null,
299
- "grid_template_columns": null,
300
- "grid_template_rows": null,
301
- "height": null,
302
- "justify_content": null,
303
- "justify_items": null,
304
- "left": null,
305
- "margin": null,
306
- "max_height": null,
307
- "max_width": null,
308
- "min_height": null,
309
- "min_width": null,
310
- "object_fit": null,
311
- "object_position": null,
312
- "order": null,
313
- "overflow": null,
314
- "overflow_x": null,
315
- "overflow_y": null,
316
- "padding": null,
317
- "right": null,
318
- "top": null,
319
- "visibility": null,
320
- "width": null
321
- }
322
- },
323
- "6ac7576be7204aeca73385c48e1c5d0a": {
324
- "model_module": "@jupyter-widgets/controls",
325
- "model_name": "DescriptionStyleModel",
326
- "model_module_version": "1.5.0",
327
- "state": {
328
- "_model_module": "@jupyter-widgets/controls",
329
- "_model_module_version": "1.5.0",
330
- "_model_name": "DescriptionStyleModel",
331
- "_view_count": null,
332
- "_view_module": "@jupyter-widgets/base",
333
- "_view_module_version": "1.2.0",
334
- "_view_name": "StyleView",
335
- "description_width": ""
336
- }
337
- },
338
- "7fd3c4de83234008a72d9541c29ce765": {
339
- "model_module": "@jupyter-widgets/base",
340
- "model_name": "LayoutModel",
341
- "model_module_version": "1.2.0",
342
- "state": {
343
- "_model_module": "@jupyter-widgets/base",
344
- "_model_module_version": "1.2.0",
345
- "_model_name": "LayoutModel",
346
- "_view_count": null,
347
- "_view_module": "@jupyter-widgets/base",
348
- "_view_module_version": "1.2.0",
349
- "_view_name": "LayoutView",
350
- "align_content": null,
351
- "align_items": null,
352
- "align_self": null,
353
- "border": null,
354
- "bottom": null,
355
- "display": null,
356
- "flex": null,
357
- "flex_flow": null,
358
- "grid_area": null,
359
- "grid_auto_columns": null,
360
- "grid_auto_flow": null,
361
- "grid_auto_rows": null,
362
- "grid_column": null,
363
- "grid_gap": null,
364
- "grid_row": null,
365
- "grid_template_areas": null,
366
- "grid_template_columns": null,
367
- "grid_template_rows": null,
368
- "height": null,
369
- "justify_content": null,
370
- "justify_items": null,
371
- "left": null,
372
- "margin": null,
373
- "max_height": null,
374
- "max_width": null,
375
- "min_height": null,
376
- "min_width": null,
377
- "object_fit": null,
378
- "object_position": null,
379
- "order": null,
380
- "overflow": null,
381
- "overflow_x": null,
382
- "overflow_y": null,
383
- "padding": null,
384
- "right": null,
385
- "top": null,
386
- "visibility": null,
387
- "width": null
388
- }
389
- },
390
- "b81585732ca14c89ae1b5bb25735cd62": {
391
- "model_module": "@jupyter-widgets/controls",
392
- "model_name": "DescriptionStyleModel",
393
- "model_module_version": "1.5.0",
394
- "state": {
395
- "_model_module": "@jupyter-widgets/controls",
396
- "_model_module_version": "1.5.0",
397
- "_model_name": "DescriptionStyleModel",
398
- "_view_count": null,
399
- "_view_module": "@jupyter-widgets/base",
400
- "_view_module_version": "1.2.0",
401
- "_view_name": "StyleView",
402
- "description_width": ""
403
- }
404
- },
405
- "a68a4415305045c0a89c60349175cc82": {
406
- "model_module": "@jupyter-widgets/base",
407
- "model_name": "LayoutModel",
408
- "model_module_version": "1.2.0",
409
- "state": {
410
- "_model_module": "@jupyter-widgets/base",
411
- "_model_module_version": "1.2.0",
412
- "_model_name": "LayoutModel",
413
- "_view_count": null,
414
- "_view_module": "@jupyter-widgets/base",
415
- "_view_module_version": "1.2.0",
416
- "_view_name": "LayoutView",
417
- "align_content": null,
418
- "align_items": null,
419
- "align_self": null,
420
- "border": null,
421
- "bottom": null,
422
- "display": null,
423
- "flex": null,
424
- "flex_flow": null,
425
- "grid_area": null,
426
- "grid_auto_columns": null,
427
- "grid_auto_flow": null,
428
- "grid_auto_rows": null,
429
- "grid_column": null,
430
- "grid_gap": null,
431
- "grid_row": null,
432
- "grid_template_areas": null,
433
- "grid_template_columns": null,
434
- "grid_template_rows": null,
435
- "height": null,
436
- "justify_content": null,
437
- "justify_items": null,
438
- "left": null,
439
- "margin": null,
440
- "max_height": null,
441
- "max_width": null,
442
- "min_height": null,
443
- "min_width": null,
444
- "object_fit": null,
445
- "object_position": null,
446
- "order": null,
447
- "overflow": null,
448
- "overflow_x": null,
449
- "overflow_y": null,
450
- "padding": null,
451
- "right": null,
452
- "top": null,
453
- "visibility": null,
454
- "width": null
455
- }
456
- },
457
- "7316ece4ad474193bcc5b5db55632561": {
458
- "model_module": "@jupyter-widgets/controls",
459
- "model_name": "ButtonStyleModel",
460
- "model_module_version": "1.5.0",
461
- "state": {
462
- "_model_module": "@jupyter-widgets/controls",
463
- "_model_module_version": "1.5.0",
464
- "_model_name": "ButtonStyleModel",
465
- "_view_count": null,
466
- "_view_module": "@jupyter-widgets/base",
467
- "_view_module_version": "1.2.0",
468
- "_view_name": "StyleView",
469
- "button_color": null,
470
- "font_weight": ""
471
- }
472
- },
473
- "c0bb9ace36d64b8296bd35d538bd4f7e": {
474
- "model_module": "@jupyter-widgets/base",
475
- "model_name": "LayoutModel",
476
- "model_module_version": "1.2.0",
477
- "state": {
478
- "_model_module": "@jupyter-widgets/base",
479
- "_model_module_version": "1.2.0",
480
- "_model_name": "LayoutModel",
481
- "_view_count": null,
482
- "_view_module": "@jupyter-widgets/base",
483
- "_view_module_version": "1.2.0",
484
- "_view_name": "LayoutView",
485
- "align_content": null,
486
- "align_items": null,
487
- "align_self": null,
488
- "border": null,
489
- "bottom": null,
490
- "display": null,
491
- "flex": null,
492
- "flex_flow": null,
493
- "grid_area": null,
494
- "grid_auto_columns": null,
495
- "grid_auto_flow": null,
496
- "grid_auto_rows": null,
497
- "grid_column": null,
498
- "grid_gap": null,
499
- "grid_row": null,
500
- "grid_template_areas": null,
501
- "grid_template_columns": null,
502
- "grid_template_rows": null,
503
- "height": null,
504
- "justify_content": null,
505
- "justify_items": null,
506
- "left": null,
507
- "margin": null,
508
- "max_height": null,
509
- "max_width": null,
510
- "min_height": null,
511
- "min_width": null,
512
- "object_fit": null,
513
- "object_position": null,
514
- "order": null,
515
- "overflow": null,
516
- "overflow_x": null,
517
- "overflow_y": null,
518
- "padding": null,
519
- "right": null,
520
- "top": null,
521
- "visibility": null,
522
- "width": null
523
- }
524
- },
525
- "03ad39c22f644e55bcffa070e3832582": {
526
- "model_module": "@jupyter-widgets/controls",
527
- "model_name": "DescriptionStyleModel",
528
- "model_module_version": "1.5.0",
529
- "state": {
530
- "_model_module": "@jupyter-widgets/controls",
531
- "_model_module_version": "1.5.0",
532
- "_model_name": "DescriptionStyleModel",
533
- "_view_count": null,
534
- "_view_module": "@jupyter-widgets/base",
535
- "_view_module_version": "1.2.0",
536
- "_view_name": "StyleView",
537
- "description_width": ""
538
- }
539
- }
540
- }
541
  }
 
 
 
 
 
542
  },
543
- "cells": [
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
544
  {
545
- "cell_type": "markdown",
546
- "source": [
547
- "# 🧠 GPT-2 124M Fine-tuned on Wikitext\n",
548
- "\n",
549
- "This is an experiment aiming to achieve practical understanding of learning 🤗 Transformers and 🤗 Datasets. To follow the guide outlined [Hugging Face Notebooks](https://github.com/huggingface/notebooks/blob/main/examples/language_modeling_from_scratch.ipynb)."
550
- ],
551
- "metadata": {
552
- "id": "krQK4P9tWs_F"
553
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
554
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
555
  {
556
- "cell_type": "code",
557
- "execution_count": 1,
558
- "metadata": {
559
- "colab": {
560
- "base_uri": "https://localhost:8080/"
561
- },
562
- "id": "9-IVR9eMWY8v",
563
- "outputId": "a2ebf62e-55b2-488e-95c8-b1ee10026308"
564
  },
565
- "outputs": [
566
- {
567
- "output_type": "stream",
568
- "name": "stdout",
569
- "text": [
570
- "Requirement already satisfied: datasets in /usr/local/lib/python3.10/dist-packages (2.15.0)\n",
571
- "Requirement already satisfied: transformers in /usr/local/lib/python3.10/dist-packages (4.35.2)\n",
572
- "Requirement already satisfied: accelerate in /usr/local/lib/python3.10/dist-packages (0.25.0)\n",
573
- "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from datasets) (1.23.5)\n",
574
- "Requirement already satisfied: pyarrow>=8.0.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (9.0.0)\n",
575
- "Requirement already satisfied: pyarrow-hotfix in /usr/local/lib/python3.10/dist-packages (from datasets) (0.6)\n",
576
- "Requirement already satisfied: dill<0.3.8,>=0.3.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (0.3.7)\n",
577
- "Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from datasets) (1.5.3)\n",
578
- "Requirement already satisfied: requests>=2.19.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (2.31.0)\n",
579
- "Requirement already satisfied: tqdm>=4.62.1 in /usr/local/lib/python3.10/dist-packages (from datasets) (4.66.1)\n",
580
- "Requirement already satisfied: xxhash in /usr/local/lib/python3.10/dist-packages (from datasets) (3.4.1)\n",
581
- "Requirement already satisfied: multiprocess in /usr/local/lib/python3.10/dist-packages (from datasets) (0.70.15)\n",
582
- "Requirement already satisfied: fsspec[http]<=2023.10.0,>=2023.1.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (2023.6.0)\n",
583
- "Requirement already satisfied: aiohttp in /usr/local/lib/python3.10/dist-packages (from datasets) (3.9.1)\n",
584
- "Requirement already satisfied: huggingface-hub>=0.18.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (0.19.4)\n",
585
- "Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from datasets) (23.2)\n",
586
- "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from datasets) (6.0.1)\n",
587
- "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from transformers) (3.13.1)\n",
588
- "Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.10/dist-packages (from transformers) (2023.6.3)\n",
589
- "Requirement already satisfied: tokenizers<0.19,>=0.14 in /usr/local/lib/python3.10/dist-packages (from transformers) (0.15.0)\n",
590
- "Requirement already satisfied: safetensors>=0.3.1 in /usr/local/lib/python3.10/dist-packages (from transformers) (0.4.1)\n",
591
- "Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from accelerate) (5.9.5)\n",
592
- "Requirement already satisfied: torch>=1.10.0 in /usr/local/lib/python3.10/dist-packages (from accelerate) (2.1.0+cu118)\n",
593
- "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (23.1.0)\n",
594
- "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (6.0.4)\n",
595
- "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (1.9.3)\n",
596
- "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (1.4.0)\n",
597
- "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (1.3.1)\n",
598
- "Requirement already satisfied: async-timeout<5.0,>=4.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (4.0.3)\n",
599
- "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.18.0->datasets) (4.5.0)\n",
600
- "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets) (3.3.2)\n",
601
- "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets) (3.6)\n",
602
- "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets) (2.0.7)\n",
603
- "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets) (2023.11.17)\n",
604
- "Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch>=1.10.0->accelerate) (1.12)\n",
605
- "Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch>=1.10.0->accelerate) (3.2.1)\n",
606
- "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch>=1.10.0->accelerate) (3.1.2)\n",
607
- "Requirement already satisfied: triton==2.1.0 in /usr/local/lib/python3.10/dist-packages (from torch>=1.10.0->accelerate) (2.1.0)\n",
608
- "Requirement already satisfied: python-dateutil>=2.8.1 in /usr/local/lib/python3.10/dist-packages (from pandas->datasets) (2.8.2)\n",
609
- "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->datasets) (2023.3.post1)\n",
610
- "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.1->pandas->datasets) (1.16.0)\n",
611
- "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->torch>=1.10.0->accelerate) (2.1.3)\n",
612
- "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch>=1.10.0->accelerate) (1.3.0)\n"
613
- ]
614
- }
615
- ],
616
- "source": [
617
- "# Install neccessary packages\n",
618
- "!pip install datasets transformers accelerate"
619
  ]
 
 
 
620
  },
621
  {
622
- "cell_type": "code",
623
- "source": [
624
- "# Authenticate with HuggingFace Hub\n",
625
- "from huggingface_hub import notebook_login\n",
626
- "\n",
627
- "notebook_login()"
628
- ],
629
- "metadata": {
630
- "colab": {
631
- "base_uri": "https://localhost:8080/",
632
- "height": 331,
633
- "referenced_widgets": [
634
- "72d3f33c56a14b01bef05ea2ae98e72f",
635
- "8d44cf16b34d40bd8702560ae149192c",
636
- "13af4957747d40bbb9501bc13c3c160b",
637
- "1be0b602c74f4a7182bd041aeba58112",
638
- "af225dc2d79649c2ac0e853c517a0482",
639
- "f019d8eee73f4b7b8312029f03040c45",
640
- "d1deb908be244cfb8dd253b3cc081510",
641
- "06e659f7bd9149e784a5cb68efbad736",
642
- "ba1f1326e12d437a9fd76faa226eec44",
643
- "65ea346ce3174bb098344531db439eac",
644
- "6ac7576be7204aeca73385c48e1c5d0a",
645
- "7fd3c4de83234008a72d9541c29ce765",
646
- "b81585732ca14c89ae1b5bb25735cd62",
647
- "a68a4415305045c0a89c60349175cc82",
648
- "7316ece4ad474193bcc5b5db55632561",
649
- "c0bb9ace36d64b8296bd35d538bd4f7e",
650
- "03ad39c22f644e55bcffa070e3832582"
651
- ]
652
- },
653
- "id": "lpuAz9I-XsQQ",
654
- "outputId": "bf420c42-7ff0-4a4c-da57-420691eaec5d"
655
  },
656
- "execution_count": 2,
657
- "outputs": [
658
- {
659
- "output_type": "display_data",
660
- "data": {
661
- "text/plain": [
662
- "VBox(children=(HTML(value='<center> <img\\nsrc=https://huggingface.co/front/assets/huggingface_logo-noborder.sv…"
663
- ],
664
- "application/vnd.jupyter.widget-view+json": {
665
- "version_major": 2,
666
- "version_minor": 0,
667
- "model_id": "72d3f33c56a14b01bef05ea2ae98e72f"
668
- }
669
- },
670
- "metadata": {}
671
- }
672
  ]
 
 
 
673
  },
674
  {
675
- "cell_type": "code",
676
- "source": [
677
- "!apt install git-lfs"
678
- ],
679
- "metadata": {
680
- "colab": {
681
- "base_uri": "https://localhost:8080/"
682
- },
683
- "id": "ka0fqf1AYD2N",
684
- "outputId": "8c1b6396-cd72-45fd-9d1f-4fd9c76b0966"
685
  },
686
- "execution_count": 3,
687
- "outputs": [
688
- {
689
- "output_type": "stream",
690
- "name": "stdout",
691
- "text": [
692
- "Reading package lists... Done\n",
693
- "Building dependency tree... Done\n",
694
- "Reading state information... Done\n",
695
- "git-lfs is already the newest version (3.0.2-1ubuntu0.2).\n",
696
- "0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.\n"
697
- ]
698
- }
699
  ]
 
 
 
700
  },
701
  {
702
- "cell_type": "code",
703
- "source": [
704
- "import transformers\n",
705
- "\n",
706
- "print(transformers.__version__)"
707
- ],
708
- "metadata": {
709
- "colab": {
710
- "base_uri": "https://localhost:8080/"
711
- },
712
- "id": "evGbNxr8YIA1",
713
- "outputId": "08025e50-d542-4f92-8c33-505cd2b44802"
714
  },
715
- "execution_count": 4,
716
- "outputs": [
717
- {
718
- "output_type": "stream",
719
- "name": "stdout",
720
- "text": [
721
- "4.35.2\n"
722
- ]
723
- }
724
  ]
 
 
 
725
  },
726
  {
727
- "cell_type": "code",
728
- "source": [
729
- "# Load dataset\n",
730
- "from datasets import load_dataset\n",
731
- "\n",
732
- "datasets = load_dataset('wikitext', 'wikitext-103-raw-v1')"
733
- ],
734
- "metadata": {
735
- "id": "cdNnCQv4YMbT"
736
  },
737
- "execution_count": 5,
738
- "outputs": []
 
 
 
 
739
  },
740
  {
741
- "cell_type": "code",
742
- "source": [
743
- "from transformers import AutoTokenizer\n",
744
- "\n",
745
- "model=\"gpt2\"\n",
746
- "\n",
747
- "tokenizer = AutoTokenizer.from_pretrained(model)\n",
748
- "\n",
749
- "def tokenize_function(examples):\n",
750
- " return tokenizer(examples[\"text\"])\n",
751
- "\n",
752
- "tokenized_datasets = datasets.map(tokenize_function, batched=True, num_proc=4, remove_columns=[\"text\"])"
753
- ],
754
- "metadata": {
755
- "id": "RtYDKWCBY76H"
756
  },
757
- "execution_count": 6,
758
- "outputs": []
 
 
 
 
759
  },
760
  {
761
- "cell_type": "code",
762
- "source": [
763
- "# block_size = tokenizer.model_max_length\n",
764
- "block_size = 256\n",
765
- "\n",
766
- "# Function to group texts\n",
767
- "def group_texts(examples):\n",
768
- " # Concatenate all texts.\n",
769
- " concatenated_examples = {k: sum(examples[k], []) for k in examples.keys()}\n",
770
- " total_length = len(concatenated_examples[list(examples.keys())[0]])\n",
771
- " # We drop the small remainder, we could add padding if the model supported it instead of this drop, you can\n",
772
- " # customize this part to your needs.\n",
773
- " total_length = (total_length // block_size) * block_size\n",
774
- " # Split by chunks of max_len.\n",
775
- " result = {\n",
776
- " k: [t[i : i + block_size] for i in range(0, total_length, block_size)]\n",
777
- " for k, t in concatenated_examples.items()\n",
778
- " }\n",
779
- " result[\"labels\"] = result[\"input_ids\"].copy()\n",
780
- " return result\n",
781
- "\n",
782
- "# Transform from tokenized dataset to lm dataset\n",
783
- "lm_datasets = tokenized_datasets.map(\n",
784
- " group_texts,\n",
785
- " batched=True,\n",
786
- " batch_size=1000,\n",
787
- " num_proc=4,\n",
788
- ")\n",
789
- "\n",
790
- "# Print a chunk of the dataset\n",
791
- "print(tokenizer.decode(lm_datasets[\"train\"][1][\"input_ids\"]))"
792
- ],
793
- "metadata": {
794
- "colab": {
795
- "base_uri": "https://localhost:8080/"
796
- },
797
- "id": "ar5R7hnYZyUm",
798
- "outputId": "ceb702a8-8e60-4850-dfa7-ce111c21d875"
799
  },
800
- "execution_count": 7,
801
- "outputs": [
802
- {
803
- "output_type": "stream",
804
- "name": "stdout",
805
- "text": [
806
- "awa. A large team of writers handled the script. The game's opening theme was sung by May 'n. \n",
807
- " It met with positive sales in Japan, and was praised by both Japanese and western critics. After release, it received downloadable content, along with an expanded edition in November of that year. It was also adapted into manga and an original video animation series. Due to low sales of Valkyria Chronicles II, Valkyria Chronicles III was not localized, but a fan translation compatible with the game's expanded edition was released in 2014. Media.Vision would return to the franchise with the development of Valkyria : Azure Revolution for the PlayStation 4. \n",
808
- " = = Gameplay = = \n",
809
- " As with previous Valkyira Chronicles games, Valkyria Chronicles III is a tactical role @-@ playing game where players take control of a military unit and take part in missions against enemy forces. Stories are told through comic book @-@ like panels with animated character portraits, with characters speaking partially through voiced speech bubbles and partially through unvoiced text. The player progresses through a series of linear missions, gradually unlocked as maps that can be freely scanned through and replayed as they are unlocked. The route to each story location on the map varies\n"
810
- ]
811
- }
812
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
813
  },
 
 
 
814
  {
815
- "cell_type": "code",
816
- "source": [
817
- "# Load GPT2 model\n",
818
- "from transformers import AutoModelForCausalLM, Trainer, TrainingArguments\n",
819
- "import torch\n",
820
- "\n",
821
- "language_model = AutoModelForCausalLM.from_pretrained(model)\n",
822
- "language_model.train()\n",
823
- "\n",
824
- "training_args = TrainingArguments(\n",
825
- " f\"GPT2-124M-wikitext-v0.1\",\n",
826
- " evaluation_strategy = \"epoch\",\n",
827
- " num_train_epochs=5,\n",
828
- " learning_rate=2e-5,\n",
829
- " weight_decay=0.01,\n",
830
- " push_to_hub=True\n",
831
- ")"
832
- ],
833
- "metadata": {
834
- "id": "RZhL1hiibVNK"
835
  },
836
- "execution_count": 8,
837
- "outputs": []
 
 
 
 
838
  },
839
  {
840
- "cell_type": "code",
841
- "source": [
842
- "# Clear CUDA cache\n",
843
- "torch.cuda.empty_cache()\n",
844
- "\n",
845
- "trainer = Trainer(\n",
846
- " model=language_model,\n",
847
- " args=training_args,\n",
848
- " train_dataset=lm_datasets[\"train\"],\n",
849
- " eval_dataset=lm_datasets[\"validation\"],\n",
850
- ")\n",
851
- "\n",
852
- "trainer.train()"
853
- ],
854
- "metadata": {
855
- "colab": {
856
- "base_uri": "https://localhost:8080/",
857
- "height": 75
858
- },
859
- "id": "EvanxM9wfl6_",
860
- "outputId": "194b1923-f8bd-40c8-b62a-a6ae136df8be"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
861
  },
862
- "execution_count": null,
863
- "outputs": [
864
- {
865
- "output_type": "display_data",
866
- "data": {
867
- "text/plain": [
868
- "<IPython.core.display.HTML object>"
869
- ],
870
- "text/html": [
871
- "\n",
872
- " <div>\n",
873
- " \n",
874
- " <progress value='2797' max='287335' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
875
- " [ 2797/287335 28:43 < 48:43:53, 1.62 it/s, Epoch 0.05/5]\n",
876
- " </div>\n",
877
- " <table border=\"1\" class=\"dataframe\">\n",
878
- " <thead>\n",
879
- " <tr style=\"text-align: left;\">\n",
880
- " <th>Epoch</th>\n",
881
- " <th>Training Loss</th>\n",
882
- " <th>Validation Loss</th>\n",
883
- " </tr>\n",
884
- " </thead>\n",
885
- " <tbody>\n",
886
- " </tbody>\n",
887
- "</table><p>"
888
- ]
889
- },
890
- "metadata": {}
891
- }
892
  ]
 
 
 
893
  },
894
  {
895
- "cell_type": "code",
896
- "source": [
897
- "import math\n",
898
- "\n",
899
- "eval_results = trainer.evaluate()\n",
900
- "print(f\"Perplexity: {math.exp(eval_results['eval_loss']):.2f}\")\n",
901
- "\n",
902
- "trainer.push_to_hub()"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
903
  ],
904
- "metadata": {
905
- "id": "77GdAgpkiAOm"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
906
  },
907
- "execution_count": null,
908
- "outputs": []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
909
  }
910
- ]
911
- }
 
 
 
 
 
1
  {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {
6
+ "id": "krQK4P9tWs_F"
7
+ },
8
+ "source": [
9
+ "# 🧠 GPT-2 124M Fine-tuned on Wikitext\n",
10
+ "\n",
11
+ "This is an experiment aiming to achieve practical understanding of learning 🤗 Transformers and 🤗 Datasets. To follow the guide outlined [Hugging Face Notebooks](https://github.com/huggingface/notebooks/blob/main/examples/language_modeling_from_scratch.ipynb)."
12
+ ]
13
+ },
14
+ {
15
+ "cell_type": "code",
16
+ "execution_count": 1,
17
+ "metadata": {
18
  "colab": {
19
+ "base_uri": "https://localhost:8080/"
20
+ },
21
+ "id": "9-IVR9eMWY8v",
22
+ "outputId": "a2ebf62e-55b2-488e-95c8-b1ee10026308"
23
+ },
24
+ "outputs": [
25
+ {
26
+ "name": "stdout",
27
+ "output_type": "stream",
28
+ "text": [
29
+ "Collecting datasets\n",
30
+ " Downloading datasets-2.15.0-py3-none-any.whl.metadata (20 kB)\n",
31
+ "Collecting transformers\n",
32
+ " Downloading transformers-4.35.2-py3-none-any.whl.metadata (123 kB)\n",
33
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m123.5/123.5 kB\u001b[0m \u001b[31m3.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m\n",
34
+ "\u001b[?25hCollecting accelerate\n",
35
+ " Downloading accelerate-0.25.0-py3-none-any.whl.metadata (18 kB)\n",
36
+ "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from datasets) (1.24.1)\n",
37
+ "Collecting pyarrow>=8.0.0 (from datasets)\n",
38
+ " Downloading pyarrow-14.0.1-cp310-cp310-manylinux_2_28_x86_64.whl.metadata (3.0 kB)\n",
39
+ "Collecting pyarrow-hotfix (from datasets)\n",
40
+ " Downloading pyarrow_hotfix-0.6-py3-none-any.whl.metadata (3.6 kB)\n",
41
+ "Collecting dill<0.3.8,>=0.3.0 (from datasets)\n",
42
+ " Downloading dill-0.3.7-py3-none-any.whl.metadata (9.9 kB)\n",
43
+ "Collecting pandas (from datasets)\n",
44
+ " Downloading pandas-2.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (18 kB)\n",
45
+ "Requirement already satisfied: requests>=2.19.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (2.31.0)\n",
46
+ "Collecting tqdm>=4.62.1 (from datasets)\n",
47
+ " Downloading tqdm-4.66.1-py3-none-any.whl.metadata (57 kB)\n",
48
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m57.6/57.6 kB\u001b[0m \u001b[31m17.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
49
+ "\u001b[?25hCollecting xxhash (from datasets)\n",
50
+ " Downloading xxhash-3.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB)\n",
51
+ "Collecting multiprocess (from datasets)\n",
52
+ " Downloading multiprocess-0.70.15-py310-none-any.whl.metadata (7.2 kB)\n",
53
+ "Requirement already satisfied: fsspec<=2023.10.0,>=2023.1.0 in /usr/local/lib/python3.10/dist-packages (from fsspec[http]<=2023.10.0,>=2023.1.0->datasets) (2023.4.0)\n",
54
+ "Collecting aiohttp (from datasets)\n",
55
+ " Downloading aiohttp-3.9.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (7.4 kB)\n",
56
+ "Collecting huggingface-hub>=0.18.0 (from datasets)\n",
57
+ " Downloading huggingface_hub-0.19.4-py3-none-any.whl.metadata (14 kB)\n",
58
+ "Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from datasets) (23.2)\n",
59
+ "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from datasets) (6.0.1)\n",
60
+ "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from transformers) (3.9.0)\n",
61
+ "Collecting regex!=2019.12.17 (from transformers)\n",
62
+ " Downloading regex-2023.10.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (40 kB)\n",
63
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m40.9/40.9 kB\u001b[0m \u001b[31m2.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
64
+ "\u001b[?25hCollecting tokenizers<0.19,>=0.14 (from transformers)\n",
65
+ " Downloading tokenizers-0.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.7 kB)\n",
66
+ "Collecting safetensors>=0.3.1 (from transformers)\n",
67
+ " Downloading safetensors-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.8 kB)\n",
68
+ "Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from accelerate) (5.9.6)\n",
69
+ "Requirement already satisfied: torch>=1.10.0 in /usr/local/lib/python3.10/dist-packages (from accelerate) (2.1.0+cu118)\n",
70
+ "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (23.1.0)\n",
71
+ "Collecting multidict<7.0,>=4.5 (from aiohttp->datasets)\n",
72
+ " Downloading multidict-6.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (114 kB)\n",
73
+ "\u001b[2K \u001b[90m━━━━━━━━��━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m114.5/114.5 kB\u001b[0m \u001b[31m15.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
74
+ "\u001b[?25hCollecting yarl<2.0,>=1.0 (from aiohttp->datasets)\n",
75
+ " Downloading yarl-1.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (28 kB)\n",
76
+ "Collecting frozenlist>=1.1.1 (from aiohttp->datasets)\n",
77
+ " Downloading frozenlist-1.4.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (5.2 kB)\n",
78
+ "Collecting aiosignal>=1.1.2 (from aiohttp->datasets)\n",
79
+ " Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB)\n",
80
+ "Collecting async-timeout<5.0,>=4.0 (from aiohttp->datasets)\n",
81
+ " Downloading async_timeout-4.0.3-py3-none-any.whl.metadata (4.2 kB)\n",
82
+ "INFO: pip is looking at multiple versions of huggingface-hub to determine which version is compatible with other requirements. This could take a while.\n",
83
+ "Collecting huggingface-hub>=0.18.0 (from datasets)\n",
84
+ " Downloading huggingface_hub-0.19.3-py3-none-any.whl.metadata (14 kB)\n",
85
+ " Downloading huggingface_hub-0.19.2-py3-none-any.whl.metadata (13 kB)\n",
86
+ " Downloading huggingface_hub-0.19.1-py3-none-any.whl.metadata (13 kB)\n",
87
+ " Downloading huggingface_hub-0.19.0-py3-none-any.whl.metadata (13 kB)\n",
88
+ " Downloading huggingface_hub-0.18.0-py3-none-any.whl.metadata (13 kB)\n",
89
+ "Collecting fsspec[http]<=2023.10.0,>=2023.1.0 (from datasets)\n",
90
+ " Downloading fsspec-2023.10.0-py3-none-any.whl.metadata (6.8 kB)\n",
91
+ "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.18.0->datasets) (4.4.0)\n",
92
+ "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets) (2.1.1)\n",
93
+ "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets) (3.4)\n",
94
+ "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets) (1.26.13)\n",
95
+ "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets) (2022.12.7)\n",
96
+ "Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch>=1.10.0->accelerate) (1.12)\n",
97
+ "Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch>=1.10.0->accelerate) (3.0)\n",
98
+ "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch>=1.10.0->accelerate) (3.1.2)\n",
99
+ "Requirement already satisfied: triton==2.1.0 in /usr/local/lib/python3.10/dist-packages (from torch>=1.10.0->accelerate) (2.1.0)\n",
100
+ "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.10/dist-packages (from pandas->datasets) (2.8.2)\n",
101
+ "Collecting pytz>=2020.1 (from pandas->datasets)\n",
102
+ " Downloading pytz-2023.3.post1-py2.py3-none-any.whl.metadata (22 kB)\n",
103
+ "Collecting tzdata>=2022.1 (from pandas->datasets)\n",
104
+ " Downloading tzdata-2023.3-py2.py3-none-any.whl (341 kB)\n",
105
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m341.8/341.8 kB\u001b[0m \u001b[31m12.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
106
+ "\u001b[?25hRequirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.8.2->pandas->datasets) (1.16.0)\n",
107
+ "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->torch>=1.10.0->accelerate) (2.1.2)\n",
108
+ "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch>=1.10.0->accelerate) (1.3.0)\n",
109
+ "Downloading datasets-2.15.0-py3-none-any.whl (521 kB)\n",
110
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m521.2/521.2 kB\u001b[0m \u001b[31m56.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
111
+ "\u001b[?25hDownloading transformers-4.35.2-py3-none-any.whl (7.9 MB)\n",
112
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.9/7.9 MB\u001b[0m \u001b[31m98.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m0:01\u001b[0m\n",
113
+ "\u001b[?25hDownloading accelerate-0.25.0-py3-none-any.whl (265 kB)\n",
114
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m265.7/265.7 kB\u001b[0m \u001b[31m72.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
115
+ "\u001b[?25hDownloading dill-0.3.7-py3-none-any.whl (115 kB)\n",
116
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m115.3/115.3 kB\u001b[0m \u001b[31m34.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
117
+ "\u001b[?25hDownloading fsspec-2023.10.0-py3-none-any.whl (166 kB)\n",
118
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m166.4/166.4 kB\u001b[0m \u001b[31m46.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
119
+ "\u001b[?25hDownloading huggingface_hub-0.19.4-py3-none-any.whl (311 kB)\n",
120
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m311.7/311.7 kB\u001b[0m \u001b[31m80.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
121
+ "\u001b[?25hDownloading aiohttp-3.9.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB)\n",
122
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.2/1.2 MB\u001b[0m \u001b[31m73.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
123
+ "\u001b[?25hDownloading pyarrow-14.0.1-cp310-cp310-manylinux_2_28_x86_64.whl (38.0 MB)\n",
124
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m38.0/38.0 MB\u001b[0m \u001b[31m94.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m00:01\u001b[0m\n",
125
+ "\u001b[?25hDownloading regex-2023.10.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (773 kB)\n",
126
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m773.9/773.9 kB\u001b[0m \u001b[31m188.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
127
+ "\u001b[?25hDownloading safetensors-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)\n",
128
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.3/1.3 MB\u001b[0m \u001b[31m239.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
129
+ "\u001b[?25hDownloading tokenizers-0.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8 MB)\n",
130
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.8/3.8 MB\u001b[0m \u001b[31m123.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
131
+ "\u001b[?25hDownloading tqdm-4.66.1-py3-none-any.whl (78 kB)\n",
132
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m78.3/78.3 kB\u001b[0m \u001b[31m26.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
133
+ "\u001b[?25hDownloading multiprocess-0.70.15-py310-none-any.whl (134 kB)\n",
134
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m134.8/134.8 kB\u001b[0m \u001b[31m42.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
135
+ "\u001b[?25hDownloading pandas-2.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.3 MB)\n",
136
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m12.3/12.3 MB\u001b[0m \u001b[31m111.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
137
+ "\u001b[?25hDownloading pyarrow_hotfix-0.6-py3-none-any.whl (7.9 kB)\n",
138
+ "Downloading xxhash-3.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (194 kB)\n",
139
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m194.1/194.1 kB\u001b[0m \u001b[31m75.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
140
+ "\u001b[?25hDownloading async_timeout-4.0.3-py3-none-any.whl (5.7 kB)\n",
141
+ "Downloading frozenlist-1.4.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (225 kB)\n",
142
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m225.7/225.7 kB\u001b[0m \u001b[31m61.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
143
+ "\u001b[?25hDownloading pytz-2023.3.post1-py2.py3-none-any.whl (502 kB)\n",
144
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m502.5/502.5 kB\u001b[0m \u001b[31m108.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
145
+ "\u001b[?25hDownloading yarl-1.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (300 kB)\n",
146
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m300.7/300.7 kB\u001b[0m \u001b[31m79.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
147
+ "\u001b[?25hInstalling collected packages: pytz, xxhash, tzdata, tqdm, safetensors, regex, pyarrow-hotfix, pyarrow, multidict, fsspec, frozenlist, dill, async-timeout, yarl, pandas, multiprocess, huggingface-hub, aiosignal, tokenizers, aiohttp, accelerate, transformers, datasets\n",
148
+ " Attempting uninstall: fsspec\n",
149
+ " Found existing installation: fsspec 2023.4.0\n",
150
+ " Uninstalling fsspec-2023.4.0:\n",
151
+ " Successfully uninstalled fsspec-2023.4.0\n",
152
+ "Successfully installed accelerate-0.25.0 aiohttp-3.9.1 aiosignal-1.3.1 async-timeout-4.0.3 datasets-2.15.0 dill-0.3.7 frozenlist-1.4.0 fsspec-2023.10.0 huggingface-hub-0.19.4 multidict-6.0.4 multiprocess-0.70.15 pandas-2.1.3 pyarrow-14.0.1 pyarrow-hotfix-0.6 pytz-2023.3.post1 regex-2023.10.3 safetensors-0.4.1 tokenizers-0.15.0 tqdm-4.66.1 transformers-4.35.2 tzdata-2023.3 xxhash-3.4.1 yarl-1.9.3\n",
153
+ "\u001b[33mWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\u001b[0m\u001b[33m\n",
154
+ "\u001b[0m"
155
+ ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
  }
157
+ ],
158
+ "source": [
159
+ "# Install neccessary packages\n",
160
+ "!pip install datasets transformers accelerate"
161
+ ]
162
  },
163
+ {
164
+ "cell_type": "code",
165
+ "execution_count": 3,
166
+ "metadata": {
167
+ "colab": {
168
+ "base_uri": "https://localhost:8080/",
169
+ "height": 331,
170
+ "referenced_widgets": [
171
+ "72d3f33c56a14b01bef05ea2ae98e72f",
172
+ "8d44cf16b34d40bd8702560ae149192c",
173
+ "13af4957747d40bbb9501bc13c3c160b",
174
+ "1be0b602c74f4a7182bd041aeba58112",
175
+ "af225dc2d79649c2ac0e853c517a0482",
176
+ "f019d8eee73f4b7b8312029f03040c45",
177
+ "d1deb908be244cfb8dd253b3cc081510",
178
+ "06e659f7bd9149e784a5cb68efbad736",
179
+ "ba1f1326e12d437a9fd76faa226eec44",
180
+ "65ea346ce3174bb098344531db439eac",
181
+ "6ac7576be7204aeca73385c48e1c5d0a",
182
+ "7fd3c4de83234008a72d9541c29ce765",
183
+ "b81585732ca14c89ae1b5bb25735cd62",
184
+ "a68a4415305045c0a89c60349175cc82",
185
+ "7316ece4ad474193bcc5b5db55632561",
186
+ "c0bb9ace36d64b8296bd35d538bd4f7e",
187
+ "03ad39c22f644e55bcffa070e3832582"
188
+ ]
189
+ },
190
+ "id": "lpuAz9I-XsQQ",
191
+ "outputId": "bf420c42-7ff0-4a4c-da57-420691eaec5d"
192
+ },
193
+ "outputs": [
194
  {
195
+ "data": {
196
+ "application/vnd.jupyter.widget-view+json": {
197
+ "model_id": "e61086bda2ca40b5a189544f6a8b43a5",
198
+ "version_major": 2,
199
+ "version_minor": 0
200
+ },
201
+ "text/plain": [
202
+ "VBox(children=(HTML(value='<center> <img\\nsrc=https://huggingface.co/front/assets/huggingface_logo-noborder.sv…"
203
+ ]
204
+ },
205
+ "metadata": {},
206
+ "output_type": "display_data"
207
+ }
208
+ ],
209
+ "source": [
210
+ "# Authenticate with HuggingFace Hub\n",
211
+ "from huggingface_hub import notebook_login\n",
212
+ "\n",
213
+ "notebook_login()"
214
+ ]
215
+ },
216
+ {
217
+ "cell_type": "code",
218
+ "execution_count": 4,
219
+ "metadata": {
220
+ "colab": {
221
+ "base_uri": "https://localhost:8080/"
222
+ },
223
+ "id": "ka0fqf1AYD2N",
224
+ "outputId": "8c1b6396-cd72-45fd-9d1f-4fd9c76b0966"
225
+ },
226
+ "outputs": [
227
+ {
228
+ "name": "stdout",
229
+ "output_type": "stream",
230
+ "text": [
231
+ "Reading package lists... Done\n",
232
+ "Building dependency tree... Done\n",
233
+ "Reading state information... Done\n",
234
+ "git-lfs is already the newest version (3.4.0).\n",
235
+ "0 upgraded, 0 newly installed, 0 to remove and 27 not upgraded.\n"
236
+ ]
237
+ }
238
+ ],
239
+ "source": [
240
+ "!apt install git-lfs"
241
+ ]
242
+ },
243
+ {
244
+ "cell_type": "code",
245
+ "execution_count": 5,
246
+ "metadata": {
247
+ "colab": {
248
+ "base_uri": "https://localhost:8080/"
249
  },
250
+ "id": "evGbNxr8YIA1",
251
+ "outputId": "08025e50-d542-4f92-8c33-505cd2b44802"
252
+ },
253
+ "outputs": [
254
+ {
255
+ "name": "stdout",
256
+ "output_type": "stream",
257
+ "text": [
258
+ "4.35.2\n"
259
+ ]
260
+ }
261
+ ],
262
+ "source": [
263
+ "import transformers\n",
264
+ "\n",
265
+ "print(transformers.__version__)"
266
+ ]
267
+ },
268
+ {
269
+ "cell_type": "code",
270
+ "execution_count": 6,
271
+ "metadata": {
272
+ "id": "cdNnCQv4YMbT"
273
+ },
274
+ "outputs": [
275
  {
276
+ "data": {
277
+ "application/vnd.jupyter.widget-view+json": {
278
+ "model_id": "9bc2efdc8b104cba875de6338be8aa7d",
279
+ "version_major": 2,
280
+ "version_minor": 0
 
 
 
281
  },
282
+ "text/plain": [
283
+ "Downloading builder script: 0%| | 0.00/8.48k [00:00<?, ?B/s]"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  ]
285
+ },
286
+ "metadata": {},
287
+ "output_type": "display_data"
288
  },
289
  {
290
+ "data": {
291
+ "application/vnd.jupyter.widget-view+json": {
292
+ "model_id": "27db41fd4b0647978b8afc17bd08edd5",
293
+ "version_major": 2,
294
+ "version_minor": 0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  },
296
+ "text/plain": [
297
+ "Downloading metadata: 0%| | 0.00/6.84k [00:00<?, ?B/s]"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  ]
299
+ },
300
+ "metadata": {},
301
+ "output_type": "display_data"
302
  },
303
  {
304
+ "data": {
305
+ "application/vnd.jupyter.widget-view+json": {
306
+ "model_id": "9ead5c3dbc6244648b4ad55f57f5dcfd",
307
+ "version_major": 2,
308
+ "version_minor": 0
 
 
 
 
 
309
  },
310
+ "text/plain": [
311
+ "Downloading readme: 0%| | 0.00/9.62k [00:00<?, ?B/s]"
 
 
 
 
 
 
 
 
 
 
 
312
  ]
313
+ },
314
+ "metadata": {},
315
+ "output_type": "display_data"
316
  },
317
  {
318
+ "data": {
319
+ "application/vnd.jupyter.widget-view+json": {
320
+ "model_id": "0d57037874a84ccdb853af35244752e0",
321
+ "version_major": 2,
322
+ "version_minor": 0
 
 
 
 
 
 
 
323
  },
324
+ "text/plain": [
325
+ "Downloading data: 0%| | 0.00/192M [00:00<?, ?B/s]"
 
 
 
 
 
 
 
326
  ]
327
+ },
328
+ "metadata": {},
329
+ "output_type": "display_data"
330
  },
331
  {
332
+ "data": {
333
+ "application/vnd.jupyter.widget-view+json": {
334
+ "model_id": "bb1e8cf41b0346a3a9a652ab901e2c6f",
335
+ "version_major": 2,
336
+ "version_minor": 0
 
 
 
 
337
  },
338
+ "text/plain": [
339
+ "Generating test split: 0%| | 0/4358 [00:00<?, ? examples/s]"
340
+ ]
341
+ },
342
+ "metadata": {},
343
+ "output_type": "display_data"
344
  },
345
  {
346
+ "data": {
347
+ "application/vnd.jupyter.widget-view+json": {
348
+ "model_id": "e421bae84bdd476693e2f8db449fb9b5",
349
+ "version_major": 2,
350
+ "version_minor": 0
 
 
 
 
 
 
 
 
 
 
351
  },
352
+ "text/plain": [
353
+ "Generating train split: 0%| | 0/1801350 [00:00<?, ? examples/s]"
354
+ ]
355
+ },
356
+ "metadata": {},
357
+ "output_type": "display_data"
358
  },
359
  {
360
+ "data": {
361
+ "application/vnd.jupyter.widget-view+json": {
362
+ "model_id": "3324d8e2ad3c4db2a1c9779afa407b07",
363
+ "version_major": 2,
364
+ "version_minor": 0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
365
  },
366
+ "text/plain": [
367
+ "Generating validation split: 0%| | 0/3760 [00:00<?, ? examples/s]"
 
 
 
 
 
 
 
 
 
 
368
  ]
369
+ },
370
+ "metadata": {},
371
+ "output_type": "display_data"
372
+ }
373
+ ],
374
+ "source": [
375
+ "# Load dataset\n",
376
+ "from datasets import load_dataset\n",
377
+ "\n",
378
+ "datasets = load_dataset('wikitext', 'wikitext-103-raw-v1')"
379
+ ]
380
+ },
381
+ {
382
+ "cell_type": "code",
383
+ "execution_count": 7,
384
+ "metadata": {
385
+ "editable": true,
386
+ "id": "RtYDKWCBY76H",
387
+ "slideshow": {
388
+ "slide_type": ""
389
  },
390
+ "tags": []
391
+ },
392
+ "outputs": [
393
  {
394
+ "data": {
395
+ "application/vnd.jupyter.widget-view+json": {
396
+ "model_id": "9879d982c28742faa5dd9a611623da66",
397
+ "version_major": 2,
398
+ "version_minor": 0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  },
400
+ "text/plain": [
401
+ "config.json: 0%| | 0.00/665 [00:00<?, ?B/s]"
402
+ ]
403
+ },
404
+ "metadata": {},
405
+ "output_type": "display_data"
406
  },
407
  {
408
+ "data": {
409
+ "application/vnd.jupyter.widget-view+json": {
410
+ "model_id": "69b00a15589b47f59c7b9591d62dce7c",
411
+ "version_major": 2,
412
+ "version_minor": 0
413
+ },
414
+ "text/plain": [
415
+ "vocab.json: 0%| | 0.00/1.04M [00:00<?, ?B/s]"
416
+ ]
417
+ },
418
+ "metadata": {},
419
+ "output_type": "display_data"
420
+ },
421
+ {
422
+ "data": {
423
+ "application/vnd.jupyter.widget-view+json": {
424
+ "model_id": "286aa0cb68904534aa1fb06dd3674c12",
425
+ "version_major": 2,
426
+ "version_minor": 0
427
+ },
428
+ "text/plain": [
429
+ "merges.txt: 0%| | 0.00/456k [00:00<?, ?B/s]"
430
+ ]
431
+ },
432
+ "metadata": {},
433
+ "output_type": "display_data"
434
+ },
435
+ {
436
+ "data": {
437
+ "application/vnd.jupyter.widget-view+json": {
438
+ "model_id": "dbc0fb3079ff446f9c8a7500c549a7ee",
439
+ "version_major": 2,
440
+ "version_minor": 0
441
+ },
442
+ "text/plain": [
443
+ "tokenizer.json: 0%| | 0.00/1.36M [00:00<?, ?B/s]"
444
+ ]
445
+ },
446
+ "metadata": {},
447
+ "output_type": "display_data"
448
+ },
449
+ {
450
+ "data": {
451
+ "application/vnd.jupyter.widget-view+json": {
452
+ "model_id": "a34f997d324e48628b2f9c7bd3b8cb7b",
453
+ "version_major": 2,
454
+ "version_minor": 0
455
  },
456
+ "text/plain": [
457
+ "Map (num_proc=4): 0%| | 0/4358 [00:00<?, ? examples/s]"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
458
  ]
459
+ },
460
+ "metadata": {},
461
+ "output_type": "display_data"
462
  },
463
  {
464
+ "data": {
465
+ "application/vnd.jupyter.widget-view+json": {
466
+ "model_id": "3c65ed66ddf7416b8fbce34b7a14de0c",
467
+ "version_major": 2,
468
+ "version_minor": 0
469
+ },
470
+ "text/plain": [
471
+ "Map (num_proc=4): 0%| | 0/1801350 [00:00<?, ? examples/s]"
472
+ ]
473
+ },
474
+ "metadata": {},
475
+ "output_type": "display_data"
476
+ },
477
+ {
478
+ "name": "stderr",
479
+ "output_type": "stream",
480
+ "text": [
481
+ "Token indices sequence length is longer than the specified maximum sequence length for this model (1132 > 1024). Running this sequence through the model will result in indexing errors\n",
482
+ "Token indices sequence length is longer than the specified maximum sequence length for this model (1063 > 1024). Running this sequence through the model will result in indexing errors\n"
483
+ ]
484
+ },
485
+ {
486
+ "data": {
487
+ "application/vnd.jupyter.widget-view+json": {
488
+ "model_id": "43a4cddf296748669540d04b6ea1ca98",
489
+ "version_major": 2,
490
+ "version_minor": 0
491
+ },
492
+ "text/plain": [
493
+ "Map (num_proc=4): 0%| | 0/3760 [00:00<?, ? examples/s]"
494
+ ]
495
+ },
496
+ "metadata": {},
497
+ "output_type": "display_data"
498
+ }
499
+ ],
500
+ "source": [
501
+ "from transformers import AutoTokenizer\n",
502
+ "\n",
503
+ "model=\"gpt2\"\n",
504
+ "\n",
505
+ "tokenizer = AutoTokenizer.from_pretrained(model)\n",
506
+ "\n",
507
+ "def tokenize_function(examples):\n",
508
+ " return tokenizer(examples[\"text\"])\n",
509
+ "\n",
510
+ "tokenized_datasets = datasets.map(tokenize_function, batched=True, num_proc=4, remove_columns=[\"text\"])"
511
+ ]
512
+ },
513
+ {
514
+ "cell_type": "code",
515
+ "execution_count": 8,
516
+ "metadata": {
517
+ "colab": {
518
+ "base_uri": "https://localhost:8080/"
519
+ },
520
+ "id": "ar5R7hnYZyUm",
521
+ "outputId": "ceb702a8-8e60-4850-dfa7-ce111c21d875"
522
+ },
523
+ "outputs": [
524
+ {
525
+ "data": {
526
+ "application/vnd.jupyter.widget-view+json": {
527
+ "model_id": "8f7da61dac45436bae1028a5a5830ca3",
528
+ "version_major": 2,
529
+ "version_minor": 0
530
+ },
531
+ "text/plain": [
532
+ "Map (num_proc=4): 0%| | 0/4358 [00:00<?, ? examples/s]"
533
+ ]
534
+ },
535
+ "metadata": {},
536
+ "output_type": "display_data"
537
+ },
538
+ {
539
+ "data": {
540
+ "application/vnd.jupyter.widget-view+json": {
541
+ "model_id": "0d489a0dfd3646efb475785ccfeac718",
542
+ "version_major": 2,
543
+ "version_minor": 0
544
+ },
545
+ "text/plain": [
546
+ "Map (num_proc=4): 0%| | 0/1801350 [00:00<?, ? examples/s]"
547
+ ]
548
+ },
549
+ "metadata": {},
550
+ "output_type": "display_data"
551
+ },
552
+ {
553
+ "data": {
554
+ "application/vnd.jupyter.widget-view+json": {
555
+ "model_id": "0e9ac2773d894bf89177f96df1945eb9",
556
+ "version_major": 2,
557
+ "version_minor": 0
558
+ },
559
+ "text/plain": [
560
+ "Map (num_proc=4): 0%| | 0/3760 [00:00<?, ? examples/s]"
561
+ ]
562
+ },
563
+ "metadata": {},
564
+ "output_type": "display_data"
565
+ },
566
+ {
567
+ "name": "stdout",
568
+ "output_type": "stream",
569
+ "text": [
570
+ "awa. A large team of writers handled the script. The game's opening theme was sung by May 'n. \n",
571
+ " It met with positive sales in Japan, and was praised by both Japanese and western critics. After release, it received downloadable content, along with an expanded edition in November of that year. It was also adapted into manga and an original video animation series. Due to low sales of Valkyria Chronicles II, Valkyria Chronicles III was not localized, but a fan translation compatible with the game's expanded edition was released in 2014. Media.Vision would return to the franchise with the development of Valkyria : Azure Revolution for the PlayStation 4. \n",
572
+ " = = Gameplay = = \n",
573
+ " As with previous Valkyira Chronicles games, Valkyria Chronicles III is a tactical role @-@ playing game where players take control of a military unit and take part in missions against enemy forces. Stories are told through comic book @-@ like panels with animated character portraits, with characters speaking partially through voiced speech bubbles and partially through unvoiced text. The player progresses through a series of linear missions, gradually unlocked as maps that can be freely scanned through and replayed as they are unlocked. The route to each story location on the map varies\n"
574
+ ]
575
+ }
576
+ ],
577
+ "source": [
578
+ "# block_size = tokenizer.model_max_length\n",
579
+ "block_size = 256\n",
580
+ "\n",
581
+ "# Function to group texts\n",
582
+ "def group_texts(examples):\n",
583
+ " # Concatenate all texts.\n",
584
+ " concatenated_examples = {k: sum(examples[k], []) for k in examples.keys()}\n",
585
+ " total_length = len(concatenated_examples[list(examples.keys())[0]])\n",
586
+ " # We drop the small remainder, we could add padding if the model supported it instead of this drop, you can\n",
587
+ " # customize this part to your needs.\n",
588
+ " total_length = (total_length // block_size) * block_size\n",
589
+ " # Split by chunks of max_len.\n",
590
+ " result = {\n",
591
+ " k: [t[i : i + block_size] for i in range(0, total_length, block_size)]\n",
592
+ " for k, t in concatenated_examples.items()\n",
593
+ " }\n",
594
+ " result[\"labels\"] = result[\"input_ids\"].copy()\n",
595
+ " return result\n",
596
+ "\n",
597
+ "# Transform from tokenized dataset to lm dataset\n",
598
+ "lm_datasets = tokenized_datasets.map(\n",
599
+ " group_texts,\n",
600
+ " batched=True,\n",
601
+ " batch_size=1000,\n",
602
+ " num_proc=4,\n",
603
+ ")\n",
604
+ "\n",
605
+ "# Print a chunk of the dataset\n",
606
+ "print(tokenizer.decode(lm_datasets[\"train\"][1][\"input_ids\"]))"
607
+ ]
608
+ },
609
+ {
610
+ "cell_type": "code",
611
+ "execution_count": 13,
612
+ "metadata": {
613
+ "id": "RZhL1hiibVNK"
614
+ },
615
+ "outputs": [],
616
+ "source": [
617
+ "# Load GPT2 model\n",
618
+ "from transformers import AutoModelForCausalLM, Trainer, TrainingArguments\n",
619
+ "import torch\n",
620
+ "\n",
621
+ "language_model = AutoModelForCausalLM.from_pretrained(model)\n",
622
+ "language_model.train()\n",
623
+ "\n",
624
+ "training_args = TrainingArguments(\n",
625
+ " f\"GPT2-124M-wikitext-v0.1\",\n",
626
+ " evaluation_strategy = \"epoch\",\n",
627
+ " num_train_epochs=3,\n",
628
+ " learning_rate=2e-5,\n",
629
+ " weight_decay=0.01,\n",
630
+ " push_to_hub=True\n",
631
+ ")"
632
+ ]
633
+ },
634
+ {
635
+ "cell_type": "code",
636
+ "execution_count": 14,
637
+ "metadata": {
638
+ "colab": {
639
+ "base_uri": "https://localhost:8080/",
640
+ "height": 75
641
+ },
642
+ "editable": true,
643
+ "id": "EvanxM9wfl6_",
644
+ "outputId": "194b1923-f8bd-40c8-b62a-a6ae136df8be",
645
+ "slideshow": {
646
+ "slide_type": ""
647
+ },
648
+ "tags": []
649
+ },
650
+ "outputs": [
651
+ {
652
+ "data": {
653
+ "text/html": [
654
+ "\n",
655
+ " <div>\n",
656
+ " \n",
657
+ " <progress value='172401' max='172401' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
658
+ " [172401/172401 4:00:07, Epoch 3/3]\n",
659
+ " </div>\n",
660
+ " <table border=\"1\" class=\"dataframe\">\n",
661
+ " <thead>\n",
662
+ " <tr style=\"text-align: left;\">\n",
663
+ " <th>Epoch</th>\n",
664
+ " <th>Training Loss</th>\n",
665
+ " <th>Validation Loss</th>\n",
666
+ " </tr>\n",
667
+ " </thead>\n",
668
+ " <tbody>\n",
669
+ " <tr>\n",
670
+ " <td>1</td>\n",
671
+ " <td>3.133500</td>\n",
672
+ " <td>3.036319</td>\n",
673
+ " </tr>\n",
674
+ " <tr>\n",
675
+ " <td>2</td>\n",
676
+ " <td>3.064300</td>\n",
677
+ " <td>2.996815</td>\n",
678
+ " </tr>\n",
679
+ " <tr>\n",
680
+ " <td>3</td>\n",
681
+ " <td>3.038400</td>\n",
682
+ " <td>2.984082</td>\n",
683
+ " </tr>\n",
684
+ " </tbody>\n",
685
+ "</table><p>"
686
+ ],
687
+ "text/plain": [
688
+ "<IPython.core.display.HTML object>"
689
+ ]
690
+ },
691
+ "metadata": {},
692
+ "output_type": "display_data"
693
+ },
694
+ {
695
+ "data": {
696
+ "text/plain": [
697
+ "TrainOutput(global_step=172401, training_loss=3.115963939143425, metrics={'train_runtime': 14407.4906, 'train_samples_per_second': 95.729, 'train_steps_per_second': 11.966, 'total_flos': 1.80188030435328e+17, 'train_loss': 3.115963939143425, 'epoch': 3.0})"
698
+ ]
699
+ },
700
+ "execution_count": 14,
701
+ "metadata": {},
702
+ "output_type": "execute_result"
703
+ }
704
+ ],
705
+ "source": [
706
+ "# Clear CUDA cache\n",
707
+ "torch.cuda.empty_cache()\n",
708
+ "\n",
709
+ "trainer = Trainer(\n",
710
+ " model=language_model,\n",
711
+ " args=training_args,\n",
712
+ " train_dataset=lm_datasets[\"train\"],\n",
713
+ " eval_dataset=lm_datasets[\"validation\"],\n",
714
+ ")\n",
715
+ "\n",
716
+ "trainer.train()"
717
+ ]
718
+ },
719
+ {
720
+ "cell_type": "code",
721
+ "execution_count": 15,
722
+ "metadata": {
723
+ "editable": true,
724
+ "id": "77GdAgpkiAOm",
725
+ "slideshow": {
726
+ "slide_type": ""
727
+ },
728
+ "tags": []
729
+ },
730
+ "outputs": [
731
+ {
732
+ "data": {
733
+ "text/html": [
734
+ "\n",
735
+ " <div>\n",
736
+ " \n",
737
+ " <progress value='121' max='121' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
738
+ " [121/121 00:02]\n",
739
+ " </div>\n",
740
+ " "
741
  ],
742
+ "text/plain": [
743
+ "<IPython.core.display.HTML object>"
744
+ ]
745
+ },
746
+ "metadata": {},
747
+ "output_type": "display_data"
748
+ },
749
+ {
750
+ "name": "stdout",
751
+ "output_type": "stream",
752
+ "text": [
753
+ "Perplexity: 19.77\n"
754
+ ]
755
+ },
756
+ {
757
+ "data": {
758
+ "application/vnd.jupyter.widget-view+json": {
759
+ "model_id": "e09e7aeb94d84691a5d4a31832d64e0d",
760
+ "version_major": 2,
761
+ "version_minor": 0
762
  },
763
+ "text/plain": [
764
+ "model.safetensors: 0%| | 0.00/498M [00:00<?, ?B/s]"
765
+ ]
766
+ },
767
+ "metadata": {},
768
+ "output_type": "display_data"
769
+ },
770
+ {
771
+ "data": {
772
+ "text/plain": [
773
+ "'https://huggingface.co/dannoncaffeine/GPT2-124M-wikitext-v0.1/tree/main/'"
774
+ ]
775
+ },
776
+ "execution_count": 15,
777
+ "metadata": {},
778
+ "output_type": "execute_result"
779
+ }
780
+ ],
781
+ "source": [
782
+ "import math\n",
783
+ "\n",
784
+ "eval_results = trainer.evaluate()\n",
785
+ "print(f\"Perplexity: {math.exp(eval_results['eval_loss']):.2f}\")\n",
786
+ "\n",
787
+ "trainer.push_to_hub()"
788
+ ]
789
+ },
790
+ {
791
+ "cell_type": "code",
792
+ "execution_count": null,
793
+ "metadata": {},
794
+ "outputs": [],
795
+ "source": []
796
+ }
797
+ ],
798
+ "metadata": {
799
+ "accelerator": "GPU",
800
+ "colab": {
801
+ "gpuType": "T4",
802
+ "provenance": []
803
+ },
804
+ "kernelspec": {
805
+ "display_name": "Python 3 (ipykernel)",
806
+ "language": "python",
807
+ "name": "python3"
808
+ },
809
+ "language_info": {
810
+ "codemirror_mode": {
811
+ "name": "ipython",
812
+ "version": 3
813
+ },
814
+ "file_extension": ".py",
815
+ "mimetype": "text/x-python",
816
+ "name": "python",
817
+ "nbconvert_exporter": "python",
818
+ "pygments_lexer": "ipython3",
819
+ "version": "3.10.12"
820
+ },
821
+ "widgets": {
822
+ "application/vnd.jupyter.widget-state+json": {
823
+ "03ad39c22f644e55bcffa070e3832582": {
824
+ "model_module": "@jupyter-widgets/controls",
825
+ "model_module_version": "1.5.0",
826
+ "model_name": "DescriptionStyleModel",
827
+ "state": {
828
+ "_model_module": "@jupyter-widgets/controls",
829
+ "_model_module_version": "1.5.0",
830
+ "_model_name": "DescriptionStyleModel",
831
+ "_view_count": null,
832
+ "_view_module": "@jupyter-widgets/base",
833
+ "_view_module_version": "1.2.0",
834
+ "_view_name": "StyleView",
835
+ "description_width": ""
836
+ }
837
+ },
838
+ "06e659f7bd9149e784a5cb68efbad736": {
839
+ "model_module": "@jupyter-widgets/base",
840
+ "model_module_version": "1.2.0",
841
+ "model_name": "LayoutModel",
842
+ "state": {
843
+ "_model_module": "@jupyter-widgets/base",
844
+ "_model_module_version": "1.2.0",
845
+ "_model_name": "LayoutModel",
846
+ "_view_count": null,
847
+ "_view_module": "@jupyter-widgets/base",
848
+ "_view_module_version": "1.2.0",
849
+ "_view_name": "LayoutView",
850
+ "align_content": null,
851
+ "align_items": null,
852
+ "align_self": null,
853
+ "border": null,
854
+ "bottom": null,
855
+ "display": null,
856
+ "flex": null,
857
+ "flex_flow": null,
858
+ "grid_area": null,
859
+ "grid_auto_columns": null,
860
+ "grid_auto_flow": null,
861
+ "grid_auto_rows": null,
862
+ "grid_column": null,
863
+ "grid_gap": null,
864
+ "grid_row": null,
865
+ "grid_template_areas": null,
866
+ "grid_template_columns": null,
867
+ "grid_template_rows": null,
868
+ "height": null,
869
+ "justify_content": null,
870
+ "justify_items": null,
871
+ "left": null,
872
+ "margin": null,
873
+ "max_height": null,
874
+ "max_width": null,
875
+ "min_height": null,
876
+ "min_width": null,
877
+ "object_fit": null,
878
+ "object_position": null,
879
+ "order": null,
880
+ "overflow": null,
881
+ "overflow_x": null,
882
+ "overflow_y": null,
883
+ "padding": null,
884
+ "right": null,
885
+ "top": null,
886
+ "visibility": null,
887
+ "width": null
888
+ }
889
+ },
890
+ "13af4957747d40bbb9501bc13c3c160b": {
891
+ "model_module": "@jupyter-widgets/controls",
892
+ "model_module_version": "1.5.0",
893
+ "model_name": "PasswordModel",
894
+ "state": {
895
+ "_dom_classes": [],
896
+ "_model_module": "@jupyter-widgets/controls",
897
+ "_model_module_version": "1.5.0",
898
+ "_model_name": "PasswordModel",
899
+ "_view_count": null,
900
+ "_view_module": "@jupyter-widgets/controls",
901
+ "_view_module_version": "1.5.0",
902
+ "_view_name": "PasswordView",
903
+ "continuous_update": true,
904
+ "description": "Token:",
905
+ "description_tooltip": null,
906
+ "disabled": false,
907
+ "layout": "IPY_MODEL_65ea346ce3174bb098344531db439eac",
908
+ "placeholder": "​",
909
+ "style": "IPY_MODEL_6ac7576be7204aeca73385c48e1c5d0a",
910
+ "value": "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"
911
+ }
912
+ },
913
+ "1be0b602c74f4a7182bd041aeba58112": {
914
+ "model_module": "@jupyter-widgets/controls",
915
+ "model_module_version": "1.5.0",
916
+ "model_name": "CheckboxModel",
917
+ "state": {
918
+ "_dom_classes": [],
919
+ "_model_module": "@jupyter-widgets/controls",
920
+ "_model_module_version": "1.5.0",
921
+ "_model_name": "CheckboxModel",
922
+ "_view_count": null,
923
+ "_view_module": "@jupyter-widgets/controls",
924
+ "_view_module_version": "1.5.0",
925
+ "_view_name": "CheckboxView",
926
+ "description": "Add token as git credential?",
927
+ "description_tooltip": null,
928
+ "disabled": false,
929
+ "indent": true,
930
+ "layout": "IPY_MODEL_7fd3c4de83234008a72d9541c29ce765",
931
+ "style": "IPY_MODEL_b81585732ca14c89ae1b5bb25735cd62",
932
+ "value": true
933
+ }
934
+ },
935
+ "65ea346ce3174bb098344531db439eac": {
936
+ "model_module": "@jupyter-widgets/base",
937
+ "model_module_version": "1.2.0",
938
+ "model_name": "LayoutModel",
939
+ "state": {
940
+ "_model_module": "@jupyter-widgets/base",
941
+ "_model_module_version": "1.2.0",
942
+ "_model_name": "LayoutModel",
943
+ "_view_count": null,
944
+ "_view_module": "@jupyter-widgets/base",
945
+ "_view_module_version": "1.2.0",
946
+ "_view_name": "LayoutView",
947
+ "align_content": null,
948
+ "align_items": null,
949
+ "align_self": null,
950
+ "border": null,
951
+ "bottom": null,
952
+ "display": null,
953
+ "flex": null,
954
+ "flex_flow": null,
955
+ "grid_area": null,
956
+ "grid_auto_columns": null,
957
+ "grid_auto_flow": null,
958
+ "grid_auto_rows": null,
959
+ "grid_column": null,
960
+ "grid_gap": null,
961
+ "grid_row": null,
962
+ "grid_template_areas": null,
963
+ "grid_template_columns": null,
964
+ "grid_template_rows": null,
965
+ "height": null,
966
+ "justify_content": null,
967
+ "justify_items": null,
968
+ "left": null,
969
+ "margin": null,
970
+ "max_height": null,
971
+ "max_width": null,
972
+ "min_height": null,
973
+ "min_width": null,
974
+ "object_fit": null,
975
+ "object_position": null,
976
+ "order": null,
977
+ "overflow": null,
978
+ "overflow_x": null,
979
+ "overflow_y": null,
980
+ "padding": null,
981
+ "right": null,
982
+ "top": null,
983
+ "visibility": null,
984
+ "width": null
985
+ }
986
+ },
987
+ "6ac7576be7204aeca73385c48e1c5d0a": {
988
+ "model_module": "@jupyter-widgets/controls",
989
+ "model_module_version": "1.5.0",
990
+ "model_name": "DescriptionStyleModel",
991
+ "state": {
992
+ "_model_module": "@jupyter-widgets/controls",
993
+ "_model_module_version": "1.5.0",
994
+ "_model_name": "DescriptionStyleModel",
995
+ "_view_count": null,
996
+ "_view_module": "@jupyter-widgets/base",
997
+ "_view_module_version": "1.2.0",
998
+ "_view_name": "StyleView",
999
+ "description_width": ""
1000
+ }
1001
+ },
1002
+ "72d3f33c56a14b01bef05ea2ae98e72f": {
1003
+ "model_module": "@jupyter-widgets/controls",
1004
+ "model_module_version": "1.5.0",
1005
+ "model_name": "VBoxModel",
1006
+ "state": {
1007
+ "_dom_classes": [],
1008
+ "_model_module": "@jupyter-widgets/controls",
1009
+ "_model_module_version": "1.5.0",
1010
+ "_model_name": "VBoxModel",
1011
+ "_view_count": null,
1012
+ "_view_module": "@jupyter-widgets/controls",
1013
+ "_view_module_version": "1.5.0",
1014
+ "_view_name": "VBoxView",
1015
+ "box_style": "",
1016
+ "children": [
1017
+ "IPY_MODEL_8d44cf16b34d40bd8702560ae149192c",
1018
+ "IPY_MODEL_13af4957747d40bbb9501bc13c3c160b",
1019
+ "IPY_MODEL_1be0b602c74f4a7182bd041aeba58112",
1020
+ "IPY_MODEL_af225dc2d79649c2ac0e853c517a0482",
1021
+ "IPY_MODEL_f019d8eee73f4b7b8312029f03040c45"
1022
+ ],
1023
+ "layout": "IPY_MODEL_d1deb908be244cfb8dd253b3cc081510"
1024
+ }
1025
+ },
1026
+ "7316ece4ad474193bcc5b5db55632561": {
1027
+ "model_module": "@jupyter-widgets/controls",
1028
+ "model_module_version": "1.5.0",
1029
+ "model_name": "ButtonStyleModel",
1030
+ "state": {
1031
+ "_model_module": "@jupyter-widgets/controls",
1032
+ "_model_module_version": "1.5.0",
1033
+ "_model_name": "ButtonStyleModel",
1034
+ "_view_count": null,
1035
+ "_view_module": "@jupyter-widgets/base",
1036
+ "_view_module_version": "1.2.0",
1037
+ "_view_name": "StyleView",
1038
+ "button_color": null,
1039
+ "font_weight": ""
1040
+ }
1041
+ },
1042
+ "7fd3c4de83234008a72d9541c29ce765": {
1043
+ "model_module": "@jupyter-widgets/base",
1044
+ "model_module_version": "1.2.0",
1045
+ "model_name": "LayoutModel",
1046
+ "state": {
1047
+ "_model_module": "@jupyter-widgets/base",
1048
+ "_model_module_version": "1.2.0",
1049
+ "_model_name": "LayoutModel",
1050
+ "_view_count": null,
1051
+ "_view_module": "@jupyter-widgets/base",
1052
+ "_view_module_version": "1.2.0",
1053
+ "_view_name": "LayoutView",
1054
+ "align_content": null,
1055
+ "align_items": null,
1056
+ "align_self": null,
1057
+ "border": null,
1058
+ "bottom": null,
1059
+ "display": null,
1060
+ "flex": null,
1061
+ "flex_flow": null,
1062
+ "grid_area": null,
1063
+ "grid_auto_columns": null,
1064
+ "grid_auto_flow": null,
1065
+ "grid_auto_rows": null,
1066
+ "grid_column": null,
1067
+ "grid_gap": null,
1068
+ "grid_row": null,
1069
+ "grid_template_areas": null,
1070
+ "grid_template_columns": null,
1071
+ "grid_template_rows": null,
1072
+ "height": null,
1073
+ "justify_content": null,
1074
+ "justify_items": null,
1075
+ "left": null,
1076
+ "margin": null,
1077
+ "max_height": null,
1078
+ "max_width": null,
1079
+ "min_height": null,
1080
+ "min_width": null,
1081
+ "object_fit": null,
1082
+ "object_position": null,
1083
+ "order": null,
1084
+ "overflow": null,
1085
+ "overflow_x": null,
1086
+ "overflow_y": null,
1087
+ "padding": null,
1088
+ "right": null,
1089
+ "top": null,
1090
+ "visibility": null,
1091
+ "width": null
1092
+ }
1093
+ },
1094
+ "8d44cf16b34d40bd8702560ae149192c": {
1095
+ "model_module": "@jupyter-widgets/controls",
1096
+ "model_module_version": "1.5.0",
1097
+ "model_name": "HTMLModel",
1098
+ "state": {
1099
+ "_dom_classes": [],
1100
+ "_model_module": "@jupyter-widgets/controls",
1101
+ "_model_module_version": "1.5.0",
1102
+ "_model_name": "HTMLModel",
1103
+ "_view_count": null,
1104
+ "_view_module": "@jupyter-widgets/controls",
1105
+ "_view_module_version": "1.5.0",
1106
+ "_view_name": "HTMLView",
1107
+ "description": "",
1108
+ "description_tooltip": null,
1109
+ "layout": "IPY_MODEL_06e659f7bd9149e784a5cb68efbad736",
1110
+ "placeholder": "​",
1111
+ "style": "IPY_MODEL_ba1f1326e12d437a9fd76faa226eec44",
1112
+ "value": "<center> <img\nsrc=https://huggingface.co/front/assets/huggingface_logo-noborder.svg\nalt='Hugging Face'> <br> Copy a token from <a\nhref=\"https://huggingface.co/settings/tokens\" target=\"_blank\">your Hugging Face\ntokens page</a> and paste it below. <br> Immediately click login after copying\nyour token or it might be stored in plain text in this notebook file. </center>"
1113
+ }
1114
+ },
1115
+ "a68a4415305045c0a89c60349175cc82": {
1116
+ "model_module": "@jupyter-widgets/base",
1117
+ "model_module_version": "1.2.0",
1118
+ "model_name": "LayoutModel",
1119
+ "state": {
1120
+ "_model_module": "@jupyter-widgets/base",
1121
+ "_model_module_version": "1.2.0",
1122
+ "_model_name": "LayoutModel",
1123
+ "_view_count": null,
1124
+ "_view_module": "@jupyter-widgets/base",
1125
+ "_view_module_version": "1.2.0",
1126
+ "_view_name": "LayoutView",
1127
+ "align_content": null,
1128
+ "align_items": null,
1129
+ "align_self": null,
1130
+ "border": null,
1131
+ "bottom": null,
1132
+ "display": null,
1133
+ "flex": null,
1134
+ "flex_flow": null,
1135
+ "grid_area": null,
1136
+ "grid_auto_columns": null,
1137
+ "grid_auto_flow": null,
1138
+ "grid_auto_rows": null,
1139
+ "grid_column": null,
1140
+ "grid_gap": null,
1141
+ "grid_row": null,
1142
+ "grid_template_areas": null,
1143
+ "grid_template_columns": null,
1144
+ "grid_template_rows": null,
1145
+ "height": null,
1146
+ "justify_content": null,
1147
+ "justify_items": null,
1148
+ "left": null,
1149
+ "margin": null,
1150
+ "max_height": null,
1151
+ "max_width": null,
1152
+ "min_height": null,
1153
+ "min_width": null,
1154
+ "object_fit": null,
1155
+ "object_position": null,
1156
+ "order": null,
1157
+ "overflow": null,
1158
+ "overflow_x": null,
1159
+ "overflow_y": null,
1160
+ "padding": null,
1161
+ "right": null,
1162
+ "top": null,
1163
+ "visibility": null,
1164
+ "width": null
1165
+ }
1166
+ },
1167
+ "af225dc2d79649c2ac0e853c517a0482": {
1168
+ "model_module": "@jupyter-widgets/controls",
1169
+ "model_module_version": "1.5.0",
1170
+ "model_name": "ButtonModel",
1171
+ "state": {
1172
+ "_dom_classes": [],
1173
+ "_model_module": "@jupyter-widgets/controls",
1174
+ "_model_module_version": "1.5.0",
1175
+ "_model_name": "ButtonModel",
1176
+ "_view_count": null,
1177
+ "_view_module": "@jupyter-widgets/controls",
1178
+ "_view_module_version": "1.5.0",
1179
+ "_view_name": "ButtonView",
1180
+ "button_style": "",
1181
+ "description": "Login",
1182
+ "disabled": false,
1183
+ "icon": "",
1184
+ "layout": "IPY_MODEL_a68a4415305045c0a89c60349175cc82",
1185
+ "style": "IPY_MODEL_7316ece4ad474193bcc5b5db55632561",
1186
+ "tooltip": ""
1187
+ }
1188
+ },
1189
+ "b81585732ca14c89ae1b5bb25735cd62": {
1190
+ "model_module": "@jupyter-widgets/controls",
1191
+ "model_module_version": "1.5.0",
1192
+ "model_name": "DescriptionStyleModel",
1193
+ "state": {
1194
+ "_model_module": "@jupyter-widgets/controls",
1195
+ "_model_module_version": "1.5.0",
1196
+ "_model_name": "DescriptionStyleModel",
1197
+ "_view_count": null,
1198
+ "_view_module": "@jupyter-widgets/base",
1199
+ "_view_module_version": "1.2.0",
1200
+ "_view_name": "StyleView",
1201
+ "description_width": ""
1202
+ }
1203
+ },
1204
+ "ba1f1326e12d437a9fd76faa226eec44": {
1205
+ "model_module": "@jupyter-widgets/controls",
1206
+ "model_module_version": "1.5.0",
1207
+ "model_name": "DescriptionStyleModel",
1208
+ "state": {
1209
+ "_model_module": "@jupyter-widgets/controls",
1210
+ "_model_module_version": "1.5.0",
1211
+ "_model_name": "DescriptionStyleModel",
1212
+ "_view_count": null,
1213
+ "_view_module": "@jupyter-widgets/base",
1214
+ "_view_module_version": "1.2.0",
1215
+ "_view_name": "StyleView",
1216
+ "description_width": ""
1217
+ }
1218
+ },
1219
+ "c0bb9ace36d64b8296bd35d538bd4f7e": {
1220
+ "model_module": "@jupyter-widgets/base",
1221
+ "model_module_version": "1.2.0",
1222
+ "model_name": "LayoutModel",
1223
+ "state": {
1224
+ "_model_module": "@jupyter-widgets/base",
1225
+ "_model_module_version": "1.2.0",
1226
+ "_model_name": "LayoutModel",
1227
+ "_view_count": null,
1228
+ "_view_module": "@jupyter-widgets/base",
1229
+ "_view_module_version": "1.2.0",
1230
+ "_view_name": "LayoutView",
1231
+ "align_content": null,
1232
+ "align_items": null,
1233
+ "align_self": null,
1234
+ "border": null,
1235
+ "bottom": null,
1236
+ "display": null,
1237
+ "flex": null,
1238
+ "flex_flow": null,
1239
+ "grid_area": null,
1240
+ "grid_auto_columns": null,
1241
+ "grid_auto_flow": null,
1242
+ "grid_auto_rows": null,
1243
+ "grid_column": null,
1244
+ "grid_gap": null,
1245
+ "grid_row": null,
1246
+ "grid_template_areas": null,
1247
+ "grid_template_columns": null,
1248
+ "grid_template_rows": null,
1249
+ "height": null,
1250
+ "justify_content": null,
1251
+ "justify_items": null,
1252
+ "left": null,
1253
+ "margin": null,
1254
+ "max_height": null,
1255
+ "max_width": null,
1256
+ "min_height": null,
1257
+ "min_width": null,
1258
+ "object_fit": null,
1259
+ "object_position": null,
1260
+ "order": null,
1261
+ "overflow": null,
1262
+ "overflow_x": null,
1263
+ "overflow_y": null,
1264
+ "padding": null,
1265
+ "right": null,
1266
+ "top": null,
1267
+ "visibility": null,
1268
+ "width": null
1269
+ }
1270
+ },
1271
+ "d1deb908be244cfb8dd253b3cc081510": {
1272
+ "model_module": "@jupyter-widgets/base",
1273
+ "model_module_version": "1.2.0",
1274
+ "model_name": "LayoutModel",
1275
+ "state": {
1276
+ "_model_module": "@jupyter-widgets/base",
1277
+ "_model_module_version": "1.2.0",
1278
+ "_model_name": "LayoutModel",
1279
+ "_view_count": null,
1280
+ "_view_module": "@jupyter-widgets/base",
1281
+ "_view_module_version": "1.2.0",
1282
+ "_view_name": "LayoutView",
1283
+ "align_content": null,
1284
+ "align_items": "center",
1285
+ "align_self": null,
1286
+ "border": null,
1287
+ "bottom": null,
1288
+ "display": "flex",
1289
+ "flex": null,
1290
+ "flex_flow": "column",
1291
+ "grid_area": null,
1292
+ "grid_auto_columns": null,
1293
+ "grid_auto_flow": null,
1294
+ "grid_auto_rows": null,
1295
+ "grid_column": null,
1296
+ "grid_gap": null,
1297
+ "grid_row": null,
1298
+ "grid_template_areas": null,
1299
+ "grid_template_columns": null,
1300
+ "grid_template_rows": null,
1301
+ "height": null,
1302
+ "justify_content": null,
1303
+ "justify_items": null,
1304
+ "left": null,
1305
+ "margin": null,
1306
+ "max_height": null,
1307
+ "max_width": null,
1308
+ "min_height": null,
1309
+ "min_width": null,
1310
+ "object_fit": null,
1311
+ "object_position": null,
1312
+ "order": null,
1313
+ "overflow": null,
1314
+ "overflow_x": null,
1315
+ "overflow_y": null,
1316
+ "padding": null,
1317
+ "right": null,
1318
+ "top": null,
1319
+ "visibility": null,
1320
+ "width": "50%"
1321
+ }
1322
+ },
1323
+ "f019d8eee73f4b7b8312029f03040c45": {
1324
+ "model_module": "@jupyter-widgets/controls",
1325
+ "model_module_version": "1.5.0",
1326
+ "model_name": "HTMLModel",
1327
+ "state": {
1328
+ "_dom_classes": [],
1329
+ "_model_module": "@jupyter-widgets/controls",
1330
+ "_model_module_version": "1.5.0",
1331
+ "_model_name": "HTMLModel",
1332
+ "_view_count": null,
1333
+ "_view_module": "@jupyter-widgets/controls",
1334
+ "_view_module_version": "1.5.0",
1335
+ "_view_name": "HTMLView",
1336
+ "description": "",
1337
+ "description_tooltip": null,
1338
+ "layout": "IPY_MODEL_c0bb9ace36d64b8296bd35d538bd4f7e",
1339
+ "placeholder": "​",
1340
+ "style": "IPY_MODEL_03ad39c22f644e55bcffa070e3832582",
1341
+ "value": "\n<b>Pro Tip:</b> If you don't already have one, you can create a dedicated\n'notebooks' token with 'write' access, that you can then easily reuse for all\nnotebooks. </center>"
1342
+ }
1343
  }
1344
+ }
1345
+ }
1346
+ },
1347
+ "nbformat": 4,
1348
+ "nbformat_minor": 4
1349
+ }