codeShare commited on
Commit
37ef5d0
·
verified ·
1 Parent(s): a3ba9b3

Upload lora_forward_pass_test.ipynb

Browse files
Files changed (1) hide show
  1. lora_forward_pass_test.ipynb +1127 -387
lora_forward_pass_test.ipynb CHANGED
@@ -5,7 +5,7 @@
5
  "colab": {
6
  "provenance": [],
7
  "collapsed_sections": [
8
- "4MRDxrA5hZus"
9
  ],
10
  "gpuType": "T4"
11
  },
@@ -19,7 +19,7 @@
19
  "accelerator": "GPU",
20
  "widgets": {
21
  "application/vnd.jupyter.widget-state+json": {
22
- "e92b0b3c7f044251a0289901bee2f82a": {
23
  "model_module": "@jupyter-widgets/controls",
24
  "model_name": "HBoxModel",
25
  "model_module_version": "1.5.0",
@@ -34,14 +34,14 @@
34
  "_view_name": "HBoxView",
35
  "box_style": "",
36
  "children": [
37
- "IPY_MODEL_0276f15dbaa9435e8a3420f3939d5e7a",
38
- "IPY_MODEL_bd0d7e0850994a798511124f9cd2c36b",
39
- "IPY_MODEL_93a1625b6107455687959f85a0c26036"
40
  ],
41
- "layout": "IPY_MODEL_5d8c410673b348f98602f96a924bc0e9"
42
  }
43
  },
44
- "0276f15dbaa9435e8a3420f3939d5e7a": {
45
  "model_module": "@jupyter-widgets/controls",
46
  "model_name": "HTMLModel",
47
  "model_module_version": "1.5.0",
@@ -56,13 +56,13 @@
56
  "_view_name": "HTMLView",
57
  "description": "",
58
  "description_tooltip": null,
59
- "layout": "IPY_MODEL_62eb1b7e8c4f435286452af8815492d9",
60
  "placeholder": "​",
61
- "style": "IPY_MODEL_f75188e67d414be6a65f7ec255c30b44",
62
- "value": "model_index.json: 100%"
63
  }
64
  },
65
- "bd0d7e0850994a798511124f9cd2c36b": {
66
  "model_module": "@jupyter-widgets/controls",
67
  "model_name": "FloatProgressModel",
68
  "model_module_version": "1.5.0",
@@ -75,18 +75,18 @@
75
  "_view_module": "@jupyter-widgets/controls",
76
  "_view_module_version": "1.5.0",
77
  "_view_name": "ProgressView",
78
- "bar_style": "success",
79
  "description": "",
80
  "description_tooltip": null,
81
- "layout": "IPY_MODEL_6af443717e194476808f07780bb002a4",
82
- "max": 446,
83
  "min": 0,
84
  "orientation": "horizontal",
85
- "style": "IPY_MODEL_3e3b2659cbf5439180a03249f74f9749",
86
- "value": 446
87
  }
88
  },
89
- "93a1625b6107455687959f85a0c26036": {
90
  "model_module": "@jupyter-widgets/controls",
91
  "model_name": "HTMLModel",
92
  "model_module_version": "1.5.0",
@@ -101,13 +101,13 @@
101
  "_view_name": "HTMLView",
102
  "description": "",
103
  "description_tooltip": null,
104
- "layout": "IPY_MODEL_65c44774b09a4e9a8570c004ee329e52",
105
  "placeholder": "​",
106
- "style": "IPY_MODEL_c74c35a12b8e428b8427e2eaccfe0ec1",
107
- "value": " 446/446 [00:00<00:00, 44.1kB/s]"
108
  }
109
  },
110
- "5d8c410673b348f98602f96a924bc0e9": {
111
  "model_module": "@jupyter-widgets/base",
112
  "model_name": "LayoutModel",
113
  "model_module_version": "1.2.0",
@@ -159,7 +159,7 @@
159
  "width": null
160
  }
161
  },
162
- "62eb1b7e8c4f435286452af8815492d9": {
163
  "model_module": "@jupyter-widgets/base",
164
  "model_name": "LayoutModel",
165
  "model_module_version": "1.2.0",
@@ -211,7 +211,7 @@
211
  "width": null
212
  }
213
  },
214
- "f75188e67d414be6a65f7ec255c30b44": {
215
  "model_module": "@jupyter-widgets/controls",
216
  "model_name": "DescriptionStyleModel",
217
  "model_module_version": "1.5.0",
@@ -226,7 +226,7 @@
226
  "description_width": ""
227
  }
228
  },
229
- "6af443717e194476808f07780bb002a4": {
230
  "model_module": "@jupyter-widgets/base",
231
  "model_name": "LayoutModel",
232
  "model_module_version": "1.2.0",
@@ -278,7 +278,7 @@
278
  "width": null
279
  }
280
  },
281
- "3e3b2659cbf5439180a03249f74f9749": {
282
  "model_module": "@jupyter-widgets/controls",
283
  "model_name": "ProgressStyleModel",
284
  "model_module_version": "1.5.0",
@@ -294,7 +294,7 @@
294
  "description_width": ""
295
  }
296
  },
297
- "65c44774b09a4e9a8570c004ee329e52": {
298
  "model_module": "@jupyter-widgets/base",
299
  "model_name": "LayoutModel",
300
  "model_module_version": "1.2.0",
@@ -346,7 +346,7 @@
346
  "width": null
347
  }
348
  },
349
- "c74c35a12b8e428b8427e2eaccfe0ec1": {
350
  "model_module": "@jupyter-widgets/controls",
351
  "model_name": "DescriptionStyleModel",
352
  "model_module_version": "1.5.0",
@@ -361,7 +361,7 @@
361
  "description_width": ""
362
  }
363
  },
364
- "27d8c71b19fa4bd7890e3d1fc8d3bc49": {
365
  "model_module": "@jupyter-widgets/controls",
366
  "model_name": "HBoxModel",
367
  "model_module_version": "1.5.0",
@@ -376,14 +376,14 @@
376
  "_view_name": "HBoxView",
377
  "box_style": "",
378
  "children": [
379
- "IPY_MODEL_476bfd38ea1e42d19b4dffb7a8086d0c",
380
- "IPY_MODEL_8adcafa5457e4002a28995736232bcb8",
381
- "IPY_MODEL_ad7f0a3eae184262b5baf7b10e78bc98"
382
  ],
383
- "layout": "IPY_MODEL_b27d5714749d487eac4c9c274026ce0d"
384
  }
385
  },
386
- "476bfd38ea1e42d19b4dffb7a8086d0c": {
387
  "model_module": "@jupyter-widgets/controls",
388
  "model_name": "HTMLModel",
389
  "model_module_version": "1.5.0",
@@ -398,13 +398,13 @@
398
  "_view_name": "HTMLView",
399
  "description": "",
400
  "description_tooltip": null,
401
- "layout": "IPY_MODEL_2f98f880f38241b3b347e9f525cba770",
402
  "placeholder": "​",
403
- "style": "IPY_MODEL_30648ad629334535a273db6e9a32c292",
404
- "value": "Download complete: "
405
  }
406
  },
407
- "8adcafa5457e4002a28995736232bcb8": {
408
  "model_module": "@jupyter-widgets/controls",
409
  "model_name": "FloatProgressModel",
410
  "model_module_version": "1.5.0",
@@ -420,15 +420,15 @@
420
  "bar_style": "success",
421
  "description": "",
422
  "description_tooltip": null,
423
- "layout": "IPY_MODEL_ad7194c5b3684ef3924ccb87e17c1c6c",
424
- "max": 1,
425
  "min": 0,
426
  "orientation": "horizontal",
427
- "style": "IPY_MODEL_2d48c0ee58004954ab0ca73de2714b2f",
428
- "value": 1
429
  }
430
  },
431
- "ad7f0a3eae184262b5baf7b10e78bc98": {
432
  "model_module": "@jupyter-widgets/controls",
433
  "model_name": "HTMLModel",
434
  "model_module_version": "1.5.0",
@@ -443,13 +443,13 @@
443
  "_view_name": "HTMLView",
444
  "description": "",
445
  "description_tooltip": null,
446
- "layout": "IPY_MODEL_28fb66c4cb1d441ea252deef82cf7c0d",
447
  "placeholder": "​",
448
- "style": "IPY_MODEL_c190d2a89c2049afae8bbcbc33b21760",
449
- "value": " 5.92G/? [02:48<00:00, 30.6MB/s]"
450
  }
451
  },
452
- "b27d5714749d487eac4c9c274026ce0d": {
453
  "model_module": "@jupyter-widgets/base",
454
  "model_name": "LayoutModel",
455
  "model_module_version": "1.2.0",
@@ -501,7 +501,7 @@
501
  "width": null
502
  }
503
  },
504
- "2f98f880f38241b3b347e9f525cba770": {
505
  "model_module": "@jupyter-widgets/base",
506
  "model_name": "LayoutModel",
507
  "model_module_version": "1.2.0",
@@ -553,7 +553,7 @@
553
  "width": null
554
  }
555
  },
556
- "30648ad629334535a273db6e9a32c292": {
557
  "model_module": "@jupyter-widgets/controls",
558
  "model_name": "DescriptionStyleModel",
559
  "model_module_version": "1.5.0",
@@ -568,7 +568,7 @@
568
  "description_width": ""
569
  }
570
  },
571
- "ad7194c5b3684ef3924ccb87e17c1c6c": {
572
  "model_module": "@jupyter-widgets/base",
573
  "model_name": "LayoutModel",
574
  "model_module_version": "1.2.0",
@@ -617,10 +617,10 @@
617
  "right": null,
618
  "top": null,
619
  "visibility": null,
620
- "width": "20px"
621
  }
622
  },
623
- "2d48c0ee58004954ab0ca73de2714b2f": {
624
  "model_module": "@jupyter-widgets/controls",
625
  "model_name": "ProgressStyleModel",
626
  "model_module_version": "1.5.0",
@@ -636,7 +636,7 @@
636
  "description_width": ""
637
  }
638
  },
639
- "28fb66c4cb1d441ea252deef82cf7c0d": {
640
  "model_module": "@jupyter-widgets/base",
641
  "model_name": "LayoutModel",
642
  "model_module_version": "1.2.0",
@@ -688,7 +688,7 @@
688
  "width": null
689
  }
690
  },
691
- "c190d2a89c2049afae8bbcbc33b21760": {
692
  "model_module": "@jupyter-widgets/controls",
693
  "model_name": "DescriptionStyleModel",
694
  "model_module_version": "1.5.0",
@@ -703,7 +703,7 @@
703
  "description_width": ""
704
  }
705
  },
706
- "948a5c177a6d4db38d15659319185550": {
707
  "model_module": "@jupyter-widgets/controls",
708
  "model_name": "HBoxModel",
709
  "model_module_version": "1.5.0",
@@ -718,14 +718,14 @@
718
  "_view_name": "HBoxView",
719
  "box_style": "",
720
  "children": [
721
- "IPY_MODEL_b15e391fdd2d4f85852478d8649664f0",
722
- "IPY_MODEL_d05168b8a5674a78b4f790c7f360d8f3",
723
- "IPY_MODEL_866c36fea15e4913ac057b98555a4854"
724
  ],
725
- "layout": "IPY_MODEL_b2c18ae53c72495788dfe5b774d1f3c0"
726
  }
727
  },
728
- "b15e391fdd2d4f85852478d8649664f0": {
729
  "model_module": "@jupyter-widgets/controls",
730
  "model_name": "HTMLModel",
731
  "model_module_version": "1.5.0",
@@ -740,13 +740,13 @@
740
  "_view_name": "HTMLView",
741
  "description": "",
742
  "description_tooltip": null,
743
- "layout": "IPY_MODEL_fc8a9051e1564ac8b3ffb6cd63cc67f5",
744
  "placeholder": "​",
745
- "style": "IPY_MODEL_5d405b4a294f4e4c86a8e613256ef88c",
746
- "value": "Fetching 11 files: 100%"
747
  }
748
  },
749
- "d05168b8a5674a78b4f790c7f360d8f3": {
750
  "model_module": "@jupyter-widgets/controls",
751
  "model_name": "FloatProgressModel",
752
  "model_module_version": "1.5.0",
@@ -762,15 +762,15 @@
762
  "bar_style": "success",
763
  "description": "",
764
  "description_tooltip": null,
765
- "layout": "IPY_MODEL_664281fbc9f54c1ca742ad362b1a5aae",
766
- "max": 11,
767
  "min": 0,
768
  "orientation": "horizontal",
769
- "style": "IPY_MODEL_c89a2c76df214327bd83fb6247de0284",
770
- "value": 11
771
  }
772
  },
773
- "866c36fea15e4913ac057b98555a4854": {
774
  "model_module": "@jupyter-widgets/controls",
775
  "model_name": "HTMLModel",
776
  "model_module_version": "1.5.0",
@@ -785,13 +785,13 @@
785
  "_view_name": "HTMLView",
786
  "description": "",
787
  "description_tooltip": null,
788
- "layout": "IPY_MODEL_516e4a487b9148168fae7275e68fd886",
789
  "placeholder": "​",
790
- "style": "IPY_MODEL_f0fe8566d388490e853ed1e2e662d9ff",
791
- "value": " 11/11 [02:46<00:00, 49.06s/it]"
792
  }
793
  },
794
- "b2c18ae53c72495788dfe5b774d1f3c0": {
795
  "model_module": "@jupyter-widgets/base",
796
  "model_name": "LayoutModel",
797
  "model_module_version": "1.2.0",
@@ -843,7 +843,7 @@
843
  "width": null
844
  }
845
  },
846
- "fc8a9051e1564ac8b3ffb6cd63cc67f5": {
847
  "model_module": "@jupyter-widgets/base",
848
  "model_name": "LayoutModel",
849
  "model_module_version": "1.2.0",
@@ -895,7 +895,7 @@
895
  "width": null
896
  }
897
  },
898
- "5d405b4a294f4e4c86a8e613256ef88c": {
899
  "model_module": "@jupyter-widgets/controls",
900
  "model_name": "DescriptionStyleModel",
901
  "model_module_version": "1.5.0",
@@ -910,7 +910,7 @@
910
  "description_width": ""
911
  }
912
  },
913
- "664281fbc9f54c1ca742ad362b1a5aae": {
914
  "model_module": "@jupyter-widgets/base",
915
  "model_name": "LayoutModel",
916
  "model_module_version": "1.2.0",
@@ -959,10 +959,10 @@
959
  "right": null,
960
  "top": null,
961
  "visibility": null,
962
- "width": null
963
  }
964
  },
965
- "c89a2c76df214327bd83fb6247de0284": {
966
  "model_module": "@jupyter-widgets/controls",
967
  "model_name": "ProgressStyleModel",
968
  "model_module_version": "1.5.0",
@@ -978,7 +978,7 @@
978
  "description_width": ""
979
  }
980
  },
981
- "516e4a487b9148168fae7275e68fd886": {
982
  "model_module": "@jupyter-widgets/base",
983
  "model_name": "LayoutModel",
984
  "model_module_version": "1.2.0",
@@ -1030,7 +1030,7 @@
1030
  "width": null
1031
  }
1032
  },
1033
- "f0fe8566d388490e853ed1e2e662d9ff": {
1034
  "model_module": "@jupyter-widgets/controls",
1035
  "model_name": "DescriptionStyleModel",
1036
  "model_module_version": "1.5.0",
@@ -1045,7 +1045,7 @@
1045
  "description_width": ""
1046
  }
1047
  },
1048
- "cc0bcb4e2ce04abeb2793067ee2fb6e2": {
1049
  "model_module": "@jupyter-widgets/controls",
1050
  "model_name": "HBoxModel",
1051
  "model_module_version": "1.5.0",
@@ -1060,14 +1060,14 @@
1060
  "_view_name": "HBoxView",
1061
  "box_style": "",
1062
  "children": [
1063
- "IPY_MODEL_acbf5a1db5da41258e16c588519cd161",
1064
- "IPY_MODEL_355bdcc5b3ce41dc88a34b7eee9c0c9b",
1065
- "IPY_MODEL_824811f114d64563ae0ccdd2efa7b6ce"
1066
  ],
1067
- "layout": "IPY_MODEL_a1615c3e4bb34aec9a44e07a6a998055"
1068
  }
1069
  },
1070
- "acbf5a1db5da41258e16c588519cd161": {
1071
  "model_module": "@jupyter-widgets/controls",
1072
  "model_name": "HTMLModel",
1073
  "model_module_version": "1.5.0",
@@ -1082,13 +1082,13 @@
1082
  "_view_name": "HTMLView",
1083
  "description": "",
1084
  "description_tooltip": null,
1085
- "layout": "IPY_MODEL_46ff5df071734e67a301a18cad817fcc",
1086
  "placeholder": "​",
1087
- "style": "IPY_MODEL_df81b919011a4e619dc657e9751c8466",
1088
- "value": "Loading pipeline components...: 100%"
1089
  }
1090
  },
1091
- "355bdcc5b3ce41dc88a34b7eee9c0c9b": {
1092
  "model_module": "@jupyter-widgets/controls",
1093
  "model_name": "FloatProgressModel",
1094
  "model_module_version": "1.5.0",
@@ -1104,15 +1104,15 @@
1104
  "bar_style": "success",
1105
  "description": "",
1106
  "description_tooltip": null,
1107
- "layout": "IPY_MODEL_faf28686333645fa8059419743d3d87e",
1108
- "max": 5,
1109
  "min": 0,
1110
  "orientation": "horizontal",
1111
- "style": "IPY_MODEL_1dd526a3884a406f9275cf36eb3a470c",
1112
- "value": 5
1113
  }
1114
  },
1115
- "824811f114d64563ae0ccdd2efa7b6ce": {
1116
  "model_module": "@jupyter-widgets/controls",
1117
  "model_name": "HTMLModel",
1118
  "model_module_version": "1.5.0",
@@ -1127,13 +1127,13 @@
1127
  "_view_name": "HTMLView",
1128
  "description": "",
1129
  "description_tooltip": null,
1130
- "layout": "IPY_MODEL_5aa58197987a4f25b14a406d658f7f7a",
1131
  "placeholder": "​",
1132
- "style": "IPY_MODEL_35844b6ea72e4b3f8b3199e6d12ac66b",
1133
- "value": " 5/5 [00:25<00:00,  4.69s/it]"
1134
  }
1135
  },
1136
- "a1615c3e4bb34aec9a44e07a6a998055": {
1137
  "model_module": "@jupyter-widgets/base",
1138
  "model_name": "LayoutModel",
1139
  "model_module_version": "1.2.0",
@@ -1185,7 +1185,7 @@
1185
  "width": null
1186
  }
1187
  },
1188
- "46ff5df071734e67a301a18cad817fcc": {
1189
  "model_module": "@jupyter-widgets/base",
1190
  "model_name": "LayoutModel",
1191
  "model_module_version": "1.2.0",
@@ -1237,7 +1237,7 @@
1237
  "width": null
1238
  }
1239
  },
1240
- "df81b919011a4e619dc657e9751c8466": {
1241
  "model_module": "@jupyter-widgets/controls",
1242
  "model_name": "DescriptionStyleModel",
1243
  "model_module_version": "1.5.0",
@@ -1252,7 +1252,7 @@
1252
  "description_width": ""
1253
  }
1254
  },
1255
- "faf28686333645fa8059419743d3d87e": {
1256
  "model_module": "@jupyter-widgets/base",
1257
  "model_name": "LayoutModel",
1258
  "model_module_version": "1.2.0",
@@ -1304,7 +1304,7 @@
1304
  "width": null
1305
  }
1306
  },
1307
- "1dd526a3884a406f9275cf36eb3a470c": {
1308
  "model_module": "@jupyter-widgets/controls",
1309
  "model_name": "ProgressStyleModel",
1310
  "model_module_version": "1.5.0",
@@ -1320,7 +1320,7 @@
1320
  "description_width": ""
1321
  }
1322
  },
1323
- "5aa58197987a4f25b14a406d658f7f7a": {
1324
  "model_module": "@jupyter-widgets/base",
1325
  "model_name": "LayoutModel",
1326
  "model_module_version": "1.2.0",
@@ -1372,7 +1372,7 @@
1372
  "width": null
1373
  }
1374
  },
1375
- "35844b6ea72e4b3f8b3199e6d12ac66b": {
1376
  "model_module": "@jupyter-widgets/controls",
1377
  "model_name": "DescriptionStyleModel",
1378
  "model_module_version": "1.5.0",
@@ -1387,7 +1387,7 @@
1387
  "description_width": ""
1388
  }
1389
  },
1390
- "ecfc0839b350477da8961ae4b097fcfb": {
1391
  "model_module": "@jupyter-widgets/controls",
1392
  "model_name": "HBoxModel",
1393
  "model_module_version": "1.5.0",
@@ -1402,14 +1402,14 @@
1402
  "_view_name": "HBoxView",
1403
  "box_style": "",
1404
  "children": [
1405
- "IPY_MODEL_8889ebc784494395b672a7e5c3d6a699",
1406
- "IPY_MODEL_fb26cd1919984a58900ca12ba61b8b09",
1407
- "IPY_MODEL_66843928f0024fd6a6be502b9a86a5e9"
1408
  ],
1409
- "layout": "IPY_MODEL_1b4f934ef6264ab6bad39366087f246f"
1410
  }
1411
  },
1412
- "8889ebc784494395b672a7e5c3d6a699": {
1413
  "model_module": "@jupyter-widgets/controls",
1414
  "model_name": "HTMLModel",
1415
  "model_module_version": "1.5.0",
@@ -1424,13 +1424,13 @@
1424
  "_view_name": "HTMLView",
1425
  "description": "",
1426
  "description_tooltip": null,
1427
- "layout": "IPY_MODEL_b97b9510b9ac4dafaa4cb4a231fd121e",
1428
  "placeholder": "​",
1429
- "style": "IPY_MODEL_25761a9d3a2a4b58b878a7ae2de38c44",
1430
- "value": "Loading weights: 100%"
1431
  }
1432
  },
1433
- "fb26cd1919984a58900ca12ba61b8b09": {
1434
  "model_module": "@jupyter-widgets/controls",
1435
  "model_name": "FloatProgressModel",
1436
  "model_module_version": "1.5.0",
@@ -1446,15 +1446,15 @@
1446
  "bar_style": "success",
1447
  "description": "",
1448
  "description_tooltip": null,
1449
- "layout": "IPY_MODEL_9a136d3640b94d46b597fd89e3987c52",
1450
- "max": 902,
1451
  "min": 0,
1452
  "orientation": "horizontal",
1453
- "style": "IPY_MODEL_bbe867fd6c1743b895160cfa7bc003db",
1454
- "value": 902
1455
  }
1456
  },
1457
- "66843928f0024fd6a6be502b9a86a5e9": {
1458
  "model_module": "@jupyter-widgets/controls",
1459
  "model_name": "HTMLModel",
1460
  "model_module_version": "1.5.0",
@@ -1469,13 +1469,13 @@
1469
  "_view_name": "HTMLView",
1470
  "description": "",
1471
  "description_tooltip": null,
1472
- "layout": "IPY_MODEL_c0fdb53573534e619ab6c202fd110a6a",
1473
  "placeholder": "​",
1474
- "style": "IPY_MODEL_fe37b9f178b04c63a1a33fc779ae3561",
1475
- "value": " 902/902 [00:05<00:00, 618.25it/s, Materializing param=model.norm.weight]"
1476
  }
1477
  },
1478
- "1b4f934ef6264ab6bad39366087f246f": {
1479
  "model_module": "@jupyter-widgets/base",
1480
  "model_name": "LayoutModel",
1481
  "model_module_version": "1.2.0",
@@ -1527,7 +1527,7 @@
1527
  "width": null
1528
  }
1529
  },
1530
- "b97b9510b9ac4dafaa4cb4a231fd121e": {
1531
  "model_module": "@jupyter-widgets/base",
1532
  "model_name": "LayoutModel",
1533
  "model_module_version": "1.2.0",
@@ -1579,7 +1579,7 @@
1579
  "width": null
1580
  }
1581
  },
1582
- "25761a9d3a2a4b58b878a7ae2de38c44": {
1583
  "model_module": "@jupyter-widgets/controls",
1584
  "model_name": "DescriptionStyleModel",
1585
  "model_module_version": "1.5.0",
@@ -1594,7 +1594,7 @@
1594
  "description_width": ""
1595
  }
1596
  },
1597
- "9a136d3640b94d46b597fd89e3987c52": {
1598
  "model_module": "@jupyter-widgets/base",
1599
  "model_name": "LayoutModel",
1600
  "model_module_version": "1.2.0",
@@ -1646,7 +1646,7 @@
1646
  "width": null
1647
  }
1648
  },
1649
- "bbe867fd6c1743b895160cfa7bc003db": {
1650
  "model_module": "@jupyter-widgets/controls",
1651
  "model_name": "ProgressStyleModel",
1652
  "model_module_version": "1.5.0",
@@ -1662,7 +1662,7 @@
1662
  "description_width": ""
1663
  }
1664
  },
1665
- "c0fdb53573534e619ab6c202fd110a6a": {
1666
  "model_module": "@jupyter-widgets/base",
1667
  "model_name": "LayoutModel",
1668
  "model_module_version": "1.2.0",
@@ -1714,7 +1714,7 @@
1714
  "width": null
1715
  }
1716
  },
1717
- "fe37b9f178b04c63a1a33fc779ae3561": {
1718
  "model_module": "@jupyter-widgets/controls",
1719
  "model_name": "DescriptionStyleModel",
1720
  "model_module_version": "1.5.0",
@@ -1729,7 +1729,7 @@
1729
  "description_width": ""
1730
  }
1731
  },
1732
- "11539f142025414e804b5fdc9c48eda6": {
1733
  "model_module": "@jupyter-widgets/controls",
1734
  "model_name": "HBoxModel",
1735
  "model_module_version": "1.5.0",
@@ -1744,14 +1744,14 @@
1744
  "_view_name": "HBoxView",
1745
  "box_style": "",
1746
  "children": [
1747
- "IPY_MODEL_72b20197d10041d48b038eaa8256183f",
1748
- "IPY_MODEL_557e328cf1a74de08084e897affd0e44",
1749
- "IPY_MODEL_c51efbe30cfa44f4a1635722aea0aa8a"
1750
  ],
1751
- "layout": "IPY_MODEL_b28f6f41640a4c69a114324839b40b8e"
1752
  }
1753
  },
1754
- "72b20197d10041d48b038eaa8256183f": {
1755
  "model_module": "@jupyter-widgets/controls",
1756
  "model_name": "HTMLModel",
1757
  "model_module_version": "1.5.0",
@@ -1766,13 +1766,13 @@
1766
  "_view_name": "HTMLView",
1767
  "description": "",
1768
  "description_tooltip": null,
1769
- "layout": "IPY_MODEL_e628945c395249e38ab5988236460f4a",
1770
  "placeholder": "​",
1771
- "style": "IPY_MODEL_e48a04cbfbab4ce3a9f8190e2a56aecc",
1772
- "value": "Epoch 1/30:   0%"
1773
  }
1774
  },
1775
- "557e328cf1a74de08084e897affd0e44": {
1776
  "model_module": "@jupyter-widgets/controls",
1777
  "model_name": "FloatProgressModel",
1778
  "model_module_version": "1.5.0",
@@ -1785,18 +1785,18 @@
1785
  "_view_module": "@jupyter-widgets/controls",
1786
  "_view_module_version": "1.5.0",
1787
  "_view_name": "ProgressView",
1788
- "bar_style": "danger",
1789
  "description": "",
1790
  "description_tooltip": null,
1791
- "layout": "IPY_MODEL_1004326b9b104a46a32aacd6c946df83",
1792
- "max": 2,
1793
  "min": 0,
1794
  "orientation": "horizontal",
1795
- "style": "IPY_MODEL_5ebbca15a97745dc95afcf5388c69def",
1796
- "value": 0
1797
  }
1798
  },
1799
- "c51efbe30cfa44f4a1635722aea0aa8a": {
1800
  "model_module": "@jupyter-widgets/controls",
1801
  "model_name": "HTMLModel",
1802
  "model_module_version": "1.5.0",
@@ -1811,13 +1811,13 @@
1811
  "_view_name": "HTMLView",
1812
  "description": "",
1813
  "description_tooltip": null,
1814
- "layout": "IPY_MODEL_f7f7a5dd82984c3cac21a394c5f6e9f0",
1815
  "placeholder": "​",
1816
- "style": "IPY_MODEL_86e499cc81b24d1c8d2aa6675d33095a",
1817
- "value": " 0/2 [00:01<?, ?it/s]"
1818
  }
1819
  },
1820
- "b28f6f41640a4c69a114324839b40b8e": {
1821
  "model_module": "@jupyter-widgets/base",
1822
  "model_name": "LayoutModel",
1823
  "model_module_version": "1.2.0",
@@ -1869,7 +1869,7 @@
1869
  "width": null
1870
  }
1871
  },
1872
- "e628945c395249e38ab5988236460f4a": {
1873
  "model_module": "@jupyter-widgets/base",
1874
  "model_name": "LayoutModel",
1875
  "model_module_version": "1.2.0",
@@ -1921,7 +1921,7 @@
1921
  "width": null
1922
  }
1923
  },
1924
- "e48a04cbfbab4ce3a9f8190e2a56aecc": {
1925
  "model_module": "@jupyter-widgets/controls",
1926
  "model_name": "DescriptionStyleModel",
1927
  "model_module_version": "1.5.0",
@@ -1936,7 +1936,7 @@
1936
  "description_width": ""
1937
  }
1938
  },
1939
- "1004326b9b104a46a32aacd6c946df83": {
1940
  "model_module": "@jupyter-widgets/base",
1941
  "model_name": "LayoutModel",
1942
  "model_module_version": "1.2.0",
@@ -1988,7 +1988,7 @@
1988
  "width": null
1989
  }
1990
  },
1991
- "5ebbca15a97745dc95afcf5388c69def": {
1992
  "model_module": "@jupyter-widgets/controls",
1993
  "model_name": "ProgressStyleModel",
1994
  "model_module_version": "1.5.0",
@@ -2004,7 +2004,7 @@
2004
  "description_width": ""
2005
  }
2006
  },
2007
- "f7f7a5dd82984c3cac21a394c5f6e9f0": {
2008
  "model_module": "@jupyter-widgets/base",
2009
  "model_name": "LayoutModel",
2010
  "model_module_version": "1.2.0",
@@ -2056,7 +2056,7 @@
2056
  "width": null
2057
  }
2058
  },
2059
- "86e499cc81b24d1c8d2aa6675d33095a": {
2060
  "model_module": "@jupyter-widgets/controls",
2061
  "model_name": "DescriptionStyleModel",
2062
  "model_module_version": "1.5.0",
@@ -2070,238 +2070,988 @@
2070
  "_view_name": "StyleView",
2071
  "description_width": ""
2072
  }
2073
- }
2074
- }
2075
- }
2076
- },
2077
- "cells": [
2078
- {
2079
- "cell_type": "code",
2080
- "execution_count": 1,
2081
- "metadata": {
2082
- "colab": {
2083
- "base_uri": "https://localhost:8080/",
2084
- "height": 319,
2085
- "referenced_widgets": [
2086
- "e92b0b3c7f044251a0289901bee2f82a",
2087
- "0276f15dbaa9435e8a3420f3939d5e7a",
2088
- "bd0d7e0850994a798511124f9cd2c36b",
2089
- "93a1625b6107455687959f85a0c26036",
2090
- "5d8c410673b348f98602f96a924bc0e9",
2091
- "62eb1b7e8c4f435286452af8815492d9",
2092
- "f75188e67d414be6a65f7ec255c30b44",
2093
- "6af443717e194476808f07780bb002a4",
2094
- "3e3b2659cbf5439180a03249f74f9749",
2095
- "65c44774b09a4e9a8570c004ee329e52",
2096
- "c74c35a12b8e428b8427e2eaccfe0ec1",
2097
- "27d8c71b19fa4bd7890e3d1fc8d3bc49",
2098
- "476bfd38ea1e42d19b4dffb7a8086d0c",
2099
- "8adcafa5457e4002a28995736232bcb8",
2100
- "ad7f0a3eae184262b5baf7b10e78bc98",
2101
- "b27d5714749d487eac4c9c274026ce0d",
2102
- "2f98f880f38241b3b347e9f525cba770",
2103
- "30648ad629334535a273db6e9a32c292",
2104
- "ad7194c5b3684ef3924ccb87e17c1c6c",
2105
- "2d48c0ee58004954ab0ca73de2714b2f",
2106
- "28fb66c4cb1d441ea252deef82cf7c0d",
2107
- "c190d2a89c2049afae8bbcbc33b21760",
2108
- "948a5c177a6d4db38d15659319185550",
2109
- "b15e391fdd2d4f85852478d8649664f0",
2110
- "d05168b8a5674a78b4f790c7f360d8f3",
2111
- "866c36fea15e4913ac057b98555a4854",
2112
- "b2c18ae53c72495788dfe5b774d1f3c0",
2113
- "fc8a9051e1564ac8b3ffb6cd63cc67f5",
2114
- "5d405b4a294f4e4c86a8e613256ef88c",
2115
- "664281fbc9f54c1ca742ad362b1a5aae",
2116
- "c89a2c76df214327bd83fb6247de0284",
2117
- "516e4a487b9148168fae7275e68fd886",
2118
- "f0fe8566d388490e853ed1e2e662d9ff",
2119
- "cc0bcb4e2ce04abeb2793067ee2fb6e2",
2120
- "acbf5a1db5da41258e16c588519cd161",
2121
- "355bdcc5b3ce41dc88a34b7eee9c0c9b",
2122
- "824811f114d64563ae0ccdd2efa7b6ce",
2123
- "a1615c3e4bb34aec9a44e07a6a998055",
2124
- "46ff5df071734e67a301a18cad817fcc",
2125
- "df81b919011a4e619dc657e9751c8466",
2126
- "faf28686333645fa8059419743d3d87e",
2127
- "1dd526a3884a406f9275cf36eb3a470c",
2128
- "5aa58197987a4f25b14a406d658f7f7a",
2129
- "35844b6ea72e4b3f8b3199e6d12ac66b",
2130
- "ecfc0839b350477da8961ae4b097fcfb",
2131
- "8889ebc784494395b672a7e5c3d6a699",
2132
- "fb26cd1919984a58900ca12ba61b8b09",
2133
- "66843928f0024fd6a6be502b9a86a5e9",
2134
- "1b4f934ef6264ab6bad39366087f246f",
2135
- "b97b9510b9ac4dafaa4cb4a231fd121e",
2136
- "25761a9d3a2a4b58b878a7ae2de38c44",
2137
- "9a136d3640b94d46b597fd89e3987c52",
2138
- "bbe867fd6c1743b895160cfa7bc003db",
2139
- "c0fdb53573534e619ab6c202fd110a6a",
2140
- "fe37b9f178b04c63a1a33fc779ae3561"
2141
- ]
2142
- },
2143
- "id": "9ul9xNLYEzTj",
2144
- "outputId": "b3117e7e-5b77-4351-c909-69406f6338c6"
2145
- },
2146
- "outputs": [
2147
- {
2148
- "output_type": "stream",
2149
- "name": "stdout",
2150
- "text": [
2151
- "Mounted at /content/drive\n",
2152
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m113.2/113.2 kB\u001b[0m \u001b[31m4.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
2153
- "\u001b[?25h✅ Dependencies installed\n",
2154
- "✅ Logged into Hugging Face\n"
2155
- ]
2156
- },
2157
- {
2158
- "output_type": "stream",
2159
- "name": "stderr",
2160
- "text": [
2161
- "Flax classes are deprecated and will be removed in Diffusers v1.0.0. We recommend migrating to PyTorch classes or pinning your version of Diffusers.\n",
2162
- "Flax classes are deprecated and will be removed in Diffusers v1.0.0. We recommend migrating to PyTorch classes or pinning your version of Diffusers.\n"
2163
- ]
2164
- },
2165
- {
2166
- "output_type": "display_data",
2167
- "data": {
2168
- "text/plain": [
2169
- "model_index.json: 0%| | 0.00/446 [00:00<?, ?B/s]"
2170
- ],
2171
- "application/vnd.jupyter.widget-view+json": {
2172
- "version_major": 2,
2173
- "version_minor": 0,
2174
- "model_id": "e92b0b3c7f044251a0289901bee2f82a"
2175
- }
2176
- },
2177
- "metadata": {}
2178
  },
2179
- {
2180
- "output_type": "display_data",
2181
- "data": {
2182
- "text/plain": [
2183
- "Downloading (incomplete total...): 0.00B [00:00, ?B/s]"
 
 
 
 
 
 
 
 
 
 
 
 
 
2184
  ],
2185
- "application/vnd.jupyter.widget-view+json": {
2186
- "version_major": 2,
2187
- "version_minor": 0,
2188
- "model_id": "27d8c71b19fa4bd7890e3d1fc8d3bc49"
2189
- }
2190
- },
2191
- "metadata": {}
2192
  },
2193
- {
2194
- "output_type": "display_data",
2195
- "data": {
2196
- "text/plain": [
2197
- "Fetching 11 files: 0%| | 0/11 [00:00<?, ?it/s]"
2198
- ],
2199
- "application/vnd.jupyter.widget-view+json": {
2200
- "version_major": 2,
2201
- "version_minor": 0,
2202
- "model_id": "948a5c177a6d4db38d15659319185550"
2203
- }
2204
- },
2205
- "metadata": {}
 
 
 
 
 
 
 
2206
  },
2207
- {
2208
- "output_type": "display_data",
2209
- "data": {
2210
- "text/plain": [
2211
- "Loading pipeline components...: 0%| | 0/5 [00:00<?, ?it/s]"
2212
- ],
2213
- "application/vnd.jupyter.widget-view+json": {
2214
- "version_major": 2,
2215
- "version_minor": 0,
2216
- "model_id": "cc0bcb4e2ce04abeb2793067ee2fb6e2"
2217
- }
2218
- },
2219
- "metadata": {}
 
 
 
 
 
 
 
 
 
 
2220
  },
2221
- {
2222
- "output_type": "display_data",
2223
- "data": {
2224
- "text/plain": [
2225
- "Loading weights: 0%| | 0/902 [00:00<?, ?it/s]"
2226
- ],
2227
- "application/vnd.jupyter.widget-view+json": {
2228
- "version_major": 2,
2229
- "version_minor": 0,
2230
- "model_id": "ecfc0839b350477da8961ae4b097fcfb"
2231
- }
2232
- },
2233
- "metadata": {}
 
 
 
 
 
 
 
2234
  },
2235
- {
2236
- "output_type": "stream",
2237
- "name": "stderr",
2238
- "text": [
2239
- "The config attributes {'decoder_block_out_channels': None} were passed to AutoencoderKLFlux2, but are not expected and will be ignored. Please verify your config.json configuration file.\n"
2240
- ]
2241
- }
2242
- ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2243
  "source": [
2244
- "#@markdown # CELL 1 — Setup environment + login\n",
2245
- "\n",
2246
- "from google.colab import drive, userdata\n",
2247
- "from huggingface_hub import login\n",
2248
- "import torch, os, gc\n",
2249
- "\n",
2250
- "drive.mount(\"/content/drive\")\n",
2251
- "\n",
2252
- "hf_token = userdata.get(\"HF_TOKEN\")\n",
2253
- "if hf_token:\n",
2254
- " login(token=hf_token)\n",
2255
- "else:\n",
2256
- " raise ValueError(\"HF_TOKEN not found in Google Colab secrets\")\n",
 
 
 
2257
  "\n",
2258
- "#@markdown # CELL 2 — Install dependencies\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2259
  "\n",
2260
- "!pip install -q safetensors huggingface_hub diffusers transformers accelerate sdnq\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2261
  "\n",
2262
- "#images for testing\n",
2263
- "# Resize so longest side is no greater than 1024px prior to\n",
2264
- "#prior to encoding into VAE\n",
2265
  "image1_path = '/content/drive/MyDrive/image1.jpg'\n",
2266
  "image2_path = '/content/drive/MyDrive/image2.jpg'\n",
2267
  "\n",
2268
- "# Test prompts\n",
2269
- "prompt1= 'a cute dog on grass'\n",
2270
  "prompt2 = 'a golden retriever on a road'\n",
2271
- "#-----#\n",
2272
  "\n",
2273
- "print(\"✅ Dependencies installed\")\n",
 
2274
  "\n",
2275
- "print(\"✅ Logged into Hugging Face\")\n",
 
 
 
 
 
 
 
 
 
2276
  "\n",
2277
- "import gc\n",
2278
- "import torch\n",
2279
- "from diffusers import Flux2KleinPipeline\n",
2280
- "#----#\n",
2281
- "from sdnq import SDNQConfig\n",
2282
- "from sdnq.common import use_torch_compile as triton_is_available\n",
2283
- "from sdnq.training import convert_sdnq_model_to_training\n",
2284
- "from sdnq.training import sdnq_training_post_load_quant\n",
2285
- "from sdnq.loader import apply_sdnq_options_to_model\n",
2286
- "#----#\n",
2287
- "from functools import partial\n",
2288
- "from safetensors.torch import load_file, save_file\n",
2289
- "from huggingface_hub import hf_hub_download\n",
2290
- "import hashlib\n",
2291
- "from pathlib import Path\n",
2292
  "\n",
2293
- "#SD NExt Quantization uint4 FLux2 Klein 4B model https://github.com/Disty0/sdnq\n",
2294
- "MODEL_ID = 'codeShare/Flux.2-Klein-4B-SDNQ-4bit'\n",
2295
  "\n",
2296
- "pipe = Flux2KleinPipeline.from_pretrained(\n",
2297
- " MODEL_ID,\n",
2298
- " torch_dtype=torch.float16,\n",
2299
- " low_cpu_mem_usage=True,\n",
2300
- " device_map=\"cpu\",\n",
2301
- ")\n",
2302
- "\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2303
  ]
2304
  },
 
 
 
 
 
 
 
 
 
2305
  {
2306
  "cell_type": "code",
2307
  "source": [
@@ -2352,7 +3102,7 @@
2352
  "id": "sQamMz50JoXM",
2353
  "outputId": "fe17c7f2-6a9c-4c34-ab26-215c3cfe8f04"
2354
  },
2355
- "execution_count": 2,
2356
  "outputs": [
2357
  {
2358
  "output_type": "stream",
@@ -2412,7 +3162,7 @@
2412
  "id": "FNma-jSihzrP",
2413
  "outputId": "79dbfbee-948f-4f98-f385-913934996ee0"
2414
  },
2415
- "execution_count": 3,
2416
  "outputs": [
2417
  {
2418
  "output_type": "stream",
@@ -2455,15 +3205,7 @@
2455
  },
2456
  {
2457
  "cell_type": "code",
2458
- "source": [
2459
- "#@markdown # CELL 3.5 — Update torchao (Critical Fix)\n",
2460
- "\n",
2461
- "!pip uninstall -q torchao -y\n",
2462
- "!pip install -q torchao==0.17.0 --no-deps\n",
2463
- "\n",
2464
- "import torchao\n",
2465
- "print(f\"✅ torchao updated to version: {torchao.__version__}\")"
2466
- ],
2467
  "metadata": {
2468
  "colab": {
2469
  "base_uri": "https://localhost:8080/"
@@ -2471,7 +3213,7 @@
2471
  "id": "_fmTXBufjVLz",
2472
  "outputId": "69164b6a-9ea7-4c56-d2c8-078812c4e6ad"
2473
  },
2474
- "execution_count": 7,
2475
  "outputs": [
2476
  {
2477
  "output_type": "stream",
@@ -2521,7 +3263,7 @@
2521
  "id": "jTb-ifqeh5OC",
2522
  "outputId": "61e228c3-85e7-40f8-c2f6-52bc68080f5d"
2523
  },
2524
- "execution_count": 10,
2525
  "outputs": [
2526
  {
2527
  "output_type": "stream",
@@ -2660,7 +3402,7 @@
2660
  "id": "7p26uoeIjAe4",
2661
  "outputId": "cd9488cc-ab59-4ed6-e58c-92fba3aee489"
2662
  },
2663
- "execution_count": 12,
2664
  "outputs": [
2665
  {
2666
  "output_type": "stream",
@@ -2793,9 +3535,7 @@
2793
  },
2794
  {
2795
  "cell_type": "markdown",
2796
- "source": [
2797
- "# OLD CODE"
2798
- ],
2799
  "metadata": {
2800
  "id": "4MRDxrA5hZus"
2801
  }
@@ -2849,7 +3589,7 @@
2849
  "id": "Gz6zaIR9GPY-",
2850
  "outputId": "74cea392-32ce-4cf9-b07f-e14a9a53453e"
2851
  },
2852
- "execution_count": 3,
2853
  "outputs": [
2854
  {
2855
  "output_type": "stream",
@@ -2911,7 +3651,7 @@
2911
  "id": "O76DmAIFL_rL",
2912
  "outputId": "81655137-8cd0-41f6-a1dc-cf3ae9eb2bfd"
2913
  },
2914
- "execution_count": 4,
2915
  "outputs": [
2916
  {
2917
  "output_type": "stream",
@@ -2935,7 +3675,7 @@
2935
  "metadata": {
2936
  "id": "xy9HRVAqMJBf"
2937
  },
2938
- "execution_count": 15,
2939
  "outputs": []
2940
  },
2941
  {
@@ -3015,7 +3755,7 @@
3015
  "id": "gXdtTyDqMIN_",
3016
  "outputId": "7f181167-269e-46e7-bdf5-616debd658ff"
3017
  },
3018
- "execution_count": 24,
3019
  "outputs": [
3020
  {
3021
  "output_type": "stream",
 
5
  "colab": {
6
  "provenance": [],
7
  "collapsed_sections": [
8
+ "u6BXluFgu5Rl"
9
  ],
10
  "gpuType": "T4"
11
  },
 
19
  "accelerator": "GPU",
20
  "widgets": {
21
  "application/vnd.jupyter.widget-state+json": {
22
+ "11539f142025414e804b5fdc9c48eda6": {
23
  "model_module": "@jupyter-widgets/controls",
24
  "model_name": "HBoxModel",
25
  "model_module_version": "1.5.0",
 
34
  "_view_name": "HBoxView",
35
  "box_style": "",
36
  "children": [
37
+ "IPY_MODEL_72b20197d10041d48b038eaa8256183f",
38
+ "IPY_MODEL_557e328cf1a74de08084e897affd0e44",
39
+ "IPY_MODEL_c51efbe30cfa44f4a1635722aea0aa8a"
40
  ],
41
+ "layout": "IPY_MODEL_b28f6f41640a4c69a114324839b40b8e"
42
  }
43
  },
44
+ "72b20197d10041d48b038eaa8256183f": {
45
  "model_module": "@jupyter-widgets/controls",
46
  "model_name": "HTMLModel",
47
  "model_module_version": "1.5.0",
 
56
  "_view_name": "HTMLView",
57
  "description": "",
58
  "description_tooltip": null,
59
+ "layout": "IPY_MODEL_e628945c395249e38ab5988236460f4a",
60
  "placeholder": "​",
61
+ "style": "IPY_MODEL_e48a04cbfbab4ce3a9f8190e2a56aecc",
62
+ "value": "Epoch 1/30:   0%"
63
  }
64
  },
65
+ "557e328cf1a74de08084e897affd0e44": {
66
  "model_module": "@jupyter-widgets/controls",
67
  "model_name": "FloatProgressModel",
68
  "model_module_version": "1.5.0",
 
75
  "_view_module": "@jupyter-widgets/controls",
76
  "_view_module_version": "1.5.0",
77
  "_view_name": "ProgressView",
78
+ "bar_style": "danger",
79
  "description": "",
80
  "description_tooltip": null,
81
+ "layout": "IPY_MODEL_1004326b9b104a46a32aacd6c946df83",
82
+ "max": 2,
83
  "min": 0,
84
  "orientation": "horizontal",
85
+ "style": "IPY_MODEL_5ebbca15a97745dc95afcf5388c69def",
86
+ "value": 0
87
  }
88
  },
89
+ "c51efbe30cfa44f4a1635722aea0aa8a": {
90
  "model_module": "@jupyter-widgets/controls",
91
  "model_name": "HTMLModel",
92
  "model_module_version": "1.5.0",
 
101
  "_view_name": "HTMLView",
102
  "description": "",
103
  "description_tooltip": null,
104
+ "layout": "IPY_MODEL_f7f7a5dd82984c3cac21a394c5f6e9f0",
105
  "placeholder": "​",
106
+ "style": "IPY_MODEL_86e499cc81b24d1c8d2aa6675d33095a",
107
+ "value": " 0/2 [00:01&lt;?, ?it/s]"
108
  }
109
  },
110
+ "b28f6f41640a4c69a114324839b40b8e": {
111
  "model_module": "@jupyter-widgets/base",
112
  "model_name": "LayoutModel",
113
  "model_module_version": "1.2.0",
 
159
  "width": null
160
  }
161
  },
162
+ "e628945c395249e38ab5988236460f4a": {
163
  "model_module": "@jupyter-widgets/base",
164
  "model_name": "LayoutModel",
165
  "model_module_version": "1.2.0",
 
211
  "width": null
212
  }
213
  },
214
+ "e48a04cbfbab4ce3a9f8190e2a56aecc": {
215
  "model_module": "@jupyter-widgets/controls",
216
  "model_name": "DescriptionStyleModel",
217
  "model_module_version": "1.5.0",
 
226
  "description_width": ""
227
  }
228
  },
229
+ "1004326b9b104a46a32aacd6c946df83": {
230
  "model_module": "@jupyter-widgets/base",
231
  "model_name": "LayoutModel",
232
  "model_module_version": "1.2.0",
 
278
  "width": null
279
  }
280
  },
281
+ "5ebbca15a97745dc95afcf5388c69def": {
282
  "model_module": "@jupyter-widgets/controls",
283
  "model_name": "ProgressStyleModel",
284
  "model_module_version": "1.5.0",
 
294
  "description_width": ""
295
  }
296
  },
297
+ "f7f7a5dd82984c3cac21a394c5f6e9f0": {
298
  "model_module": "@jupyter-widgets/base",
299
  "model_name": "LayoutModel",
300
  "model_module_version": "1.2.0",
 
346
  "width": null
347
  }
348
  },
349
+ "86e499cc81b24d1c8d2aa6675d33095a": {
350
  "model_module": "@jupyter-widgets/controls",
351
  "model_name": "DescriptionStyleModel",
352
  "model_module_version": "1.5.0",
 
361
  "description_width": ""
362
  }
363
  },
364
+ "16577fe1698040568ea4dba67a1fa7d0": {
365
  "model_module": "@jupyter-widgets/controls",
366
  "model_name": "HBoxModel",
367
  "model_module_version": "1.5.0",
 
376
  "_view_name": "HBoxView",
377
  "box_style": "",
378
  "children": [
379
+ "IPY_MODEL_b85487705df34c2e867fcbb7024b4b5b",
380
+ "IPY_MODEL_c0ab2e603303426f879e8f0abf4b7393",
381
+ "IPY_MODEL_fd28a908626645819424f1afe289375d"
382
  ],
383
+ "layout": "IPY_MODEL_475e1827136247a6b58d353ea694bd19"
384
  }
385
  },
386
+ "b85487705df34c2e867fcbb7024b4b5b": {
387
  "model_module": "@jupyter-widgets/controls",
388
  "model_name": "HTMLModel",
389
  "model_module_version": "1.5.0",
 
398
  "_view_name": "HTMLView",
399
  "description": "",
400
  "description_tooltip": null,
401
+ "layout": "IPY_MODEL_4d7f3b4f3fee49ac9092af94f2b2be1f",
402
  "placeholder": "​",
403
+ "style": "IPY_MODEL_1a9301da3ba34b7fbd3c18f826b058fd",
404
+ "value": "model_index.json: 100%"
405
  }
406
  },
407
+ "c0ab2e603303426f879e8f0abf4b7393": {
408
  "model_module": "@jupyter-widgets/controls",
409
  "model_name": "FloatProgressModel",
410
  "model_module_version": "1.5.0",
 
420
  "bar_style": "success",
421
  "description": "",
422
  "description_tooltip": null,
423
+ "layout": "IPY_MODEL_15999cdf364c48aaba6bc3d99dad3a63",
424
+ "max": 446,
425
  "min": 0,
426
  "orientation": "horizontal",
427
+ "style": "IPY_MODEL_e953a19bb91b4ed5aa4e4244e3c91405",
428
+ "value": 446
429
  }
430
  },
431
+ "fd28a908626645819424f1afe289375d": {
432
  "model_module": "@jupyter-widgets/controls",
433
  "model_name": "HTMLModel",
434
  "model_module_version": "1.5.0",
 
443
  "_view_name": "HTMLView",
444
  "description": "",
445
  "description_tooltip": null,
446
+ "layout": "IPY_MODEL_9261c32d28854c9eb50a2e5581de4caf",
447
  "placeholder": "​",
448
+ "style": "IPY_MODEL_f1083e6575824427be954bc52a119423",
449
+ "value": " 446/446 [00:00&lt;00:00, 37.8kB/s]"
450
  }
451
  },
452
+ "475e1827136247a6b58d353ea694bd19": {
453
  "model_module": "@jupyter-widgets/base",
454
  "model_name": "LayoutModel",
455
  "model_module_version": "1.2.0",
 
501
  "width": null
502
  }
503
  },
504
+ "4d7f3b4f3fee49ac9092af94f2b2be1f": {
505
  "model_module": "@jupyter-widgets/base",
506
  "model_name": "LayoutModel",
507
  "model_module_version": "1.2.0",
 
553
  "width": null
554
  }
555
  },
556
+ "1a9301da3ba34b7fbd3c18f826b058fd": {
557
  "model_module": "@jupyter-widgets/controls",
558
  "model_name": "DescriptionStyleModel",
559
  "model_module_version": "1.5.0",
 
568
  "description_width": ""
569
  }
570
  },
571
+ "15999cdf364c48aaba6bc3d99dad3a63": {
572
  "model_module": "@jupyter-widgets/base",
573
  "model_name": "LayoutModel",
574
  "model_module_version": "1.2.0",
 
617
  "right": null,
618
  "top": null,
619
  "visibility": null,
620
+ "width": null
621
  }
622
  },
623
+ "e953a19bb91b4ed5aa4e4244e3c91405": {
624
  "model_module": "@jupyter-widgets/controls",
625
  "model_name": "ProgressStyleModel",
626
  "model_module_version": "1.5.0",
 
636
  "description_width": ""
637
  }
638
  },
639
+ "9261c32d28854c9eb50a2e5581de4caf": {
640
  "model_module": "@jupyter-widgets/base",
641
  "model_name": "LayoutModel",
642
  "model_module_version": "1.2.0",
 
688
  "width": null
689
  }
690
  },
691
+ "f1083e6575824427be954bc52a119423": {
692
  "model_module": "@jupyter-widgets/controls",
693
  "model_name": "DescriptionStyleModel",
694
  "model_module_version": "1.5.0",
 
703
  "description_width": ""
704
  }
705
  },
706
+ "f3d3ac18dc9c4ddeb1ed19f0fdfffe46": {
707
  "model_module": "@jupyter-widgets/controls",
708
  "model_name": "HBoxModel",
709
  "model_module_version": "1.5.0",
 
718
  "_view_name": "HBoxView",
719
  "box_style": "",
720
  "children": [
721
+ "IPY_MODEL_2cb257c3b846484c90e27e38571252d0",
722
+ "IPY_MODEL_7c93c8bd0be445c68254272da976888f",
723
+ "IPY_MODEL_7d2113f0421f4880a12d5bb0308fef49"
724
  ],
725
+ "layout": "IPY_MODEL_b91eefa3c4e84d73bcaab6f0d8bd93bc"
726
  }
727
  },
728
+ "2cb257c3b846484c90e27e38571252d0": {
729
  "model_module": "@jupyter-widgets/controls",
730
  "model_name": "HTMLModel",
731
  "model_module_version": "1.5.0",
 
740
  "_view_name": "HTMLView",
741
  "description": "",
742
  "description_tooltip": null,
743
+ "layout": "IPY_MODEL_37ffe4997f1647eb81e7a7d78107fdf1",
744
  "placeholder": "​",
745
+ "style": "IPY_MODEL_1f19f094677e4e97ba4998adad062b69",
746
+ "value": "Download complete: "
747
  }
748
  },
749
+ "7c93c8bd0be445c68254272da976888f": {
750
  "model_module": "@jupyter-widgets/controls",
751
  "model_name": "FloatProgressModel",
752
  "model_module_version": "1.5.0",
 
762
  "bar_style": "success",
763
  "description": "",
764
  "description_tooltip": null,
765
+ "layout": "IPY_MODEL_a6457a01fe5d47ff804d0d78a3fadd1e",
766
+ "max": 1,
767
  "min": 0,
768
  "orientation": "horizontal",
769
+ "style": "IPY_MODEL_8f8355073ff140f38077ab6a29c0ae0d",
770
+ "value": 1
771
  }
772
  },
773
+ "7d2113f0421f4880a12d5bb0308fef49": {
774
  "model_module": "@jupyter-widgets/controls",
775
  "model_name": "HTMLModel",
776
  "model_module_version": "1.5.0",
 
785
  "_view_name": "HTMLView",
786
  "description": "",
787
  "description_tooltip": null,
788
+ "layout": "IPY_MODEL_3dd5809a6c0c4c43b1d5166496a9fab6",
789
  "placeholder": "​",
790
+ "style": "IPY_MODEL_23d0690c63194efa8d77311d9812eb96",
791
+ "value": " 5.92G/? [00:48&lt;00:00, 233MB/s]"
792
  }
793
  },
794
+ "b91eefa3c4e84d73bcaab6f0d8bd93bc": {
795
  "model_module": "@jupyter-widgets/base",
796
  "model_name": "LayoutModel",
797
  "model_module_version": "1.2.0",
 
843
  "width": null
844
  }
845
  },
846
+ "37ffe4997f1647eb81e7a7d78107fdf1": {
847
  "model_module": "@jupyter-widgets/base",
848
  "model_name": "LayoutModel",
849
  "model_module_version": "1.2.0",
 
895
  "width": null
896
  }
897
  },
898
+ "1f19f094677e4e97ba4998adad062b69": {
899
  "model_module": "@jupyter-widgets/controls",
900
  "model_name": "DescriptionStyleModel",
901
  "model_module_version": "1.5.0",
 
910
  "description_width": ""
911
  }
912
  },
913
+ "a6457a01fe5d47ff804d0d78a3fadd1e": {
914
  "model_module": "@jupyter-widgets/base",
915
  "model_name": "LayoutModel",
916
  "model_module_version": "1.2.0",
 
959
  "right": null,
960
  "top": null,
961
  "visibility": null,
962
+ "width": "20px"
963
  }
964
  },
965
+ "8f8355073ff140f38077ab6a29c0ae0d": {
966
  "model_module": "@jupyter-widgets/controls",
967
  "model_name": "ProgressStyleModel",
968
  "model_module_version": "1.5.0",
 
978
  "description_width": ""
979
  }
980
  },
981
+ "3dd5809a6c0c4c43b1d5166496a9fab6": {
982
  "model_module": "@jupyter-widgets/base",
983
  "model_name": "LayoutModel",
984
  "model_module_version": "1.2.0",
 
1030
  "width": null
1031
  }
1032
  },
1033
+ "23d0690c63194efa8d77311d9812eb96": {
1034
  "model_module": "@jupyter-widgets/controls",
1035
  "model_name": "DescriptionStyleModel",
1036
  "model_module_version": "1.5.0",
 
1045
  "description_width": ""
1046
  }
1047
  },
1048
+ "fa76c5a087f34b53956918bea856e80b": {
1049
  "model_module": "@jupyter-widgets/controls",
1050
  "model_name": "HBoxModel",
1051
  "model_module_version": "1.5.0",
 
1060
  "_view_name": "HBoxView",
1061
  "box_style": "",
1062
  "children": [
1063
+ "IPY_MODEL_b7101eaa248c48a6ac29a28d44efdfdd",
1064
+ "IPY_MODEL_fde9d91e04b24c04b27e6a9da56aeb61",
1065
+ "IPY_MODEL_66a0f92f4bff492c937a9d32f60d0cb5"
1066
  ],
1067
+ "layout": "IPY_MODEL_295e8356948745e28fe33dd29b690aab"
1068
  }
1069
  },
1070
+ "b7101eaa248c48a6ac29a28d44efdfdd": {
1071
  "model_module": "@jupyter-widgets/controls",
1072
  "model_name": "HTMLModel",
1073
  "model_module_version": "1.5.0",
 
1082
  "_view_name": "HTMLView",
1083
  "description": "",
1084
  "description_tooltip": null,
1085
+ "layout": "IPY_MODEL_9173730e1275476e8de4c9a7da30ae24",
1086
  "placeholder": "​",
1087
+ "style": "IPY_MODEL_8c5932aebc2e4968bee9bf47eec8057a",
1088
+ "value": "Fetching 11 files: 100%"
1089
  }
1090
  },
1091
+ "fde9d91e04b24c04b27e6a9da56aeb61": {
1092
  "model_module": "@jupyter-widgets/controls",
1093
  "model_name": "FloatProgressModel",
1094
  "model_module_version": "1.5.0",
 
1104
  "bar_style": "success",
1105
  "description": "",
1106
  "description_tooltip": null,
1107
+ "layout": "IPY_MODEL_66e49d85a7014dacbc318467ebf45be8",
1108
+ "max": 11,
1109
  "min": 0,
1110
  "orientation": "horizontal",
1111
+ "style": "IPY_MODEL_8d929c0f97504fb6af4c503d333e4512",
1112
+ "value": 11
1113
  }
1114
  },
1115
+ "66a0f92f4bff492c937a9d32f60d0cb5": {
1116
  "model_module": "@jupyter-widgets/controls",
1117
  "model_name": "HTMLModel",
1118
  "model_module_version": "1.5.0",
 
1127
  "_view_name": "HTMLView",
1128
  "description": "",
1129
  "description_tooltip": null,
1130
+ "layout": "IPY_MODEL_ac114e56e12b410f83cbaca782ea72f1",
1131
  "placeholder": "​",
1132
+ "style": "IPY_MODEL_69c8a7fdc49145eca068262d61f37775",
1133
+ "value": " 11/11 [00:47&lt;00:00, 14.05s/it]"
1134
  }
1135
  },
1136
+ "295e8356948745e28fe33dd29b690aab": {
1137
  "model_module": "@jupyter-widgets/base",
1138
  "model_name": "LayoutModel",
1139
  "model_module_version": "1.2.0",
 
1185
  "width": null
1186
  }
1187
  },
1188
+ "9173730e1275476e8de4c9a7da30ae24": {
1189
  "model_module": "@jupyter-widgets/base",
1190
  "model_name": "LayoutModel",
1191
  "model_module_version": "1.2.0",
 
1237
  "width": null
1238
  }
1239
  },
1240
+ "8c5932aebc2e4968bee9bf47eec8057a": {
1241
  "model_module": "@jupyter-widgets/controls",
1242
  "model_name": "DescriptionStyleModel",
1243
  "model_module_version": "1.5.0",
 
1252
  "description_width": ""
1253
  }
1254
  },
1255
+ "66e49d85a7014dacbc318467ebf45be8": {
1256
  "model_module": "@jupyter-widgets/base",
1257
  "model_name": "LayoutModel",
1258
  "model_module_version": "1.2.0",
 
1304
  "width": null
1305
  }
1306
  },
1307
+ "8d929c0f97504fb6af4c503d333e4512": {
1308
  "model_module": "@jupyter-widgets/controls",
1309
  "model_name": "ProgressStyleModel",
1310
  "model_module_version": "1.5.0",
 
1320
  "description_width": ""
1321
  }
1322
  },
1323
+ "ac114e56e12b410f83cbaca782ea72f1": {
1324
  "model_module": "@jupyter-widgets/base",
1325
  "model_name": "LayoutModel",
1326
  "model_module_version": "1.2.0",
 
1372
  "width": null
1373
  }
1374
  },
1375
+ "69c8a7fdc49145eca068262d61f37775": {
1376
  "model_module": "@jupyter-widgets/controls",
1377
  "model_name": "DescriptionStyleModel",
1378
  "model_module_version": "1.5.0",
 
1387
  "description_width": ""
1388
  }
1389
  },
1390
+ "ea7307ba2daa475ca4e55214b16239a4": {
1391
  "model_module": "@jupyter-widgets/controls",
1392
  "model_name": "HBoxModel",
1393
  "model_module_version": "1.5.0",
 
1402
  "_view_name": "HBoxView",
1403
  "box_style": "",
1404
  "children": [
1405
+ "IPY_MODEL_26da14b2a7d642ef9bbbe8ef15eaf8f5",
1406
+ "IPY_MODEL_75ad91ac5d3143379a808487fdffd264",
1407
+ "IPY_MODEL_a8ca808287bd4a6585186f9e9d49f4a3"
1408
  ],
1409
+ "layout": "IPY_MODEL_78a66c7278dc4f27b949715a3dff75b9"
1410
  }
1411
  },
1412
+ "26da14b2a7d642ef9bbbe8ef15eaf8f5": {
1413
  "model_module": "@jupyter-widgets/controls",
1414
  "model_name": "HTMLModel",
1415
  "model_module_version": "1.5.0",
 
1424
  "_view_name": "HTMLView",
1425
  "description": "",
1426
  "description_tooltip": null,
1427
+ "layout": "IPY_MODEL_3233901ab9aa474b9696a43707daa7cb",
1428
  "placeholder": "​",
1429
+ "style": "IPY_MODEL_0e36ef86c40c4c3fb7893c9ee788772f",
1430
+ "value": "Loading pipeline components...: 100%"
1431
  }
1432
  },
1433
+ "75ad91ac5d3143379a808487fdffd264": {
1434
  "model_module": "@jupyter-widgets/controls",
1435
  "model_name": "FloatProgressModel",
1436
  "model_module_version": "1.5.0",
 
1446
  "bar_style": "success",
1447
  "description": "",
1448
  "description_tooltip": null,
1449
+ "layout": "IPY_MODEL_2fd194e0e12045aab0d91c73a399b2ce",
1450
+ "max": 5,
1451
  "min": 0,
1452
  "orientation": "horizontal",
1453
+ "style": "IPY_MODEL_adc12d3c20e74011a45127609dcb1639",
1454
+ "value": 5
1455
  }
1456
  },
1457
+ "a8ca808287bd4a6585186f9e9d49f4a3": {
1458
  "model_module": "@jupyter-widgets/controls",
1459
  "model_name": "HTMLModel",
1460
  "model_module_version": "1.5.0",
 
1469
  "_view_name": "HTMLView",
1470
  "description": "",
1471
  "description_tooltip": null,
1472
+ "layout": "IPY_MODEL_38c495f402a942f88f1121c2b5c21c3c",
1473
  "placeholder": "​",
1474
+ "style": "IPY_MODEL_26de88ff85364c44b8df7b9061f7e1e4",
1475
+ "value": " 5/5 [00:25&lt;00:00,  4.77s/it]"
1476
  }
1477
  },
1478
+ "78a66c7278dc4f27b949715a3dff75b9": {
1479
  "model_module": "@jupyter-widgets/base",
1480
  "model_name": "LayoutModel",
1481
  "model_module_version": "1.2.0",
 
1527
  "width": null
1528
  }
1529
  },
1530
+ "3233901ab9aa474b9696a43707daa7cb": {
1531
  "model_module": "@jupyter-widgets/base",
1532
  "model_name": "LayoutModel",
1533
  "model_module_version": "1.2.0",
 
1579
  "width": null
1580
  }
1581
  },
1582
+ "0e36ef86c40c4c3fb7893c9ee788772f": {
1583
  "model_module": "@jupyter-widgets/controls",
1584
  "model_name": "DescriptionStyleModel",
1585
  "model_module_version": "1.5.0",
 
1594
  "description_width": ""
1595
  }
1596
  },
1597
+ "2fd194e0e12045aab0d91c73a399b2ce": {
1598
  "model_module": "@jupyter-widgets/base",
1599
  "model_name": "LayoutModel",
1600
  "model_module_version": "1.2.0",
 
1646
  "width": null
1647
  }
1648
  },
1649
+ "adc12d3c20e74011a45127609dcb1639": {
1650
  "model_module": "@jupyter-widgets/controls",
1651
  "model_name": "ProgressStyleModel",
1652
  "model_module_version": "1.5.0",
 
1662
  "description_width": ""
1663
  }
1664
  },
1665
+ "38c495f402a942f88f1121c2b5c21c3c": {
1666
  "model_module": "@jupyter-widgets/base",
1667
  "model_name": "LayoutModel",
1668
  "model_module_version": "1.2.0",
 
1714
  "width": null
1715
  }
1716
  },
1717
+ "26de88ff85364c44b8df7b9061f7e1e4": {
1718
  "model_module": "@jupyter-widgets/controls",
1719
  "model_name": "DescriptionStyleModel",
1720
  "model_module_version": "1.5.0",
 
1729
  "description_width": ""
1730
  }
1731
  },
1732
+ "e06ac5a2b11f4e409eeb7e7cc19ae434": {
1733
  "model_module": "@jupyter-widgets/controls",
1734
  "model_name": "HBoxModel",
1735
  "model_module_version": "1.5.0",
 
1744
  "_view_name": "HBoxView",
1745
  "box_style": "",
1746
  "children": [
1747
+ "IPY_MODEL_ac55b36af4644c84a81a19d70cc1335e",
1748
+ "IPY_MODEL_5772d2b30bf1470fbe7f9f5e9f25372b",
1749
+ "IPY_MODEL_1c243e051a8b4278b28c9c59677a0112"
1750
  ],
1751
+ "layout": "IPY_MODEL_f3467296dd0140c2a84df2a037135795"
1752
  }
1753
  },
1754
+ "ac55b36af4644c84a81a19d70cc1335e": {
1755
  "model_module": "@jupyter-widgets/controls",
1756
  "model_name": "HTMLModel",
1757
  "model_module_version": "1.5.0",
 
1766
  "_view_name": "HTMLView",
1767
  "description": "",
1768
  "description_tooltip": null,
1769
+ "layout": "IPY_MODEL_ee48d14ef87b4c11adf44bf3daf76197",
1770
  "placeholder": "​",
1771
+ "style": "IPY_MODEL_1e3e3d2a22e847698af5ee2f8f6ce22d",
1772
+ "value": "Loading weights: 100%"
1773
  }
1774
  },
1775
+ "5772d2b30bf1470fbe7f9f5e9f25372b": {
1776
  "model_module": "@jupyter-widgets/controls",
1777
  "model_name": "FloatProgressModel",
1778
  "model_module_version": "1.5.0",
 
1785
  "_view_module": "@jupyter-widgets/controls",
1786
  "_view_module_version": "1.5.0",
1787
  "_view_name": "ProgressView",
1788
+ "bar_style": "success",
1789
  "description": "",
1790
  "description_tooltip": null,
1791
+ "layout": "IPY_MODEL_fb6380258dca43f691d06b4d30459ca4",
1792
+ "max": 902,
1793
  "min": 0,
1794
  "orientation": "horizontal",
1795
+ "style": "IPY_MODEL_379712892eba4a9d845520060b163a7b",
1796
+ "value": 902
1797
  }
1798
  },
1799
+ "1c243e051a8b4278b28c9c59677a0112": {
1800
  "model_module": "@jupyter-widgets/controls",
1801
  "model_name": "HTMLModel",
1802
  "model_module_version": "1.5.0",
 
1811
  "_view_name": "HTMLView",
1812
  "description": "",
1813
  "description_tooltip": null,
1814
+ "layout": "IPY_MODEL_0f515e64cbff4c19be9ca26e3ceb48df",
1815
  "placeholder": "​",
1816
+ "style": "IPY_MODEL_c143b49f768c496181029f9be37dc492",
1817
+ "value": " 902/902 [00:05&lt;00:00, 595.56it/s, Materializing param=model.norm.weight]"
1818
  }
1819
  },
1820
+ "f3467296dd0140c2a84df2a037135795": {
1821
  "model_module": "@jupyter-widgets/base",
1822
  "model_name": "LayoutModel",
1823
  "model_module_version": "1.2.0",
 
1869
  "width": null
1870
  }
1871
  },
1872
+ "ee48d14ef87b4c11adf44bf3daf76197": {
1873
  "model_module": "@jupyter-widgets/base",
1874
  "model_name": "LayoutModel",
1875
  "model_module_version": "1.2.0",
 
1921
  "width": null
1922
  }
1923
  },
1924
+ "1e3e3d2a22e847698af5ee2f8f6ce22d": {
1925
  "model_module": "@jupyter-widgets/controls",
1926
  "model_name": "DescriptionStyleModel",
1927
  "model_module_version": "1.5.0",
 
1936
  "description_width": ""
1937
  }
1938
  },
1939
+ "fb6380258dca43f691d06b4d30459ca4": {
1940
  "model_module": "@jupyter-widgets/base",
1941
  "model_name": "LayoutModel",
1942
  "model_module_version": "1.2.0",
 
1988
  "width": null
1989
  }
1990
  },
1991
+ "379712892eba4a9d845520060b163a7b": {
1992
  "model_module": "@jupyter-widgets/controls",
1993
  "model_name": "ProgressStyleModel",
1994
  "model_module_version": "1.5.0",
 
2004
  "description_width": ""
2005
  }
2006
  },
2007
+ "0f515e64cbff4c19be9ca26e3ceb48df": {
2008
  "model_module": "@jupyter-widgets/base",
2009
  "model_name": "LayoutModel",
2010
  "model_module_version": "1.2.0",
 
2056
  "width": null
2057
  }
2058
  },
2059
+ "c143b49f768c496181029f9be37dc492": {
2060
  "model_module": "@jupyter-widgets/controls",
2061
  "model_name": "DescriptionStyleModel",
2062
  "model_module_version": "1.5.0",
 
2070
  "_view_name": "StyleView",
2071
  "description_width": ""
2072
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2073
  },
2074
+ "a2a88573b3d3449a94b3366aace406a5": {
2075
+ "model_module": "@jupyter-widgets/controls",
2076
+ "model_name": "HBoxModel",
2077
+ "model_module_version": "1.5.0",
2078
+ "state": {
2079
+ "_dom_classes": [],
2080
+ "_model_module": "@jupyter-widgets/controls",
2081
+ "_model_module_version": "1.5.0",
2082
+ "_model_name": "HBoxModel",
2083
+ "_view_count": null,
2084
+ "_view_module": "@jupyter-widgets/controls",
2085
+ "_view_module_version": "1.5.0",
2086
+ "_view_name": "HBoxView",
2087
+ "box_style": "",
2088
+ "children": [
2089
+ "IPY_MODEL_6733ac1df676444cbccdd67bb13fe3c8",
2090
+ "IPY_MODEL_c37c5c2c5c384471a15319bb64b8edfe",
2091
+ "IPY_MODEL_d6e383d9c49742cba46fe1509c9e2983"
2092
  ],
2093
+ "layout": "IPY_MODEL_fd8214ff18c44963bb180222d97aaa04"
2094
+ }
 
 
 
 
 
2095
  },
2096
+ "6733ac1df676444cbccdd67bb13fe3c8": {
2097
+ "model_module": "@jupyter-widgets/controls",
2098
+ "model_name": "HTMLModel",
2099
+ "model_module_version": "1.5.0",
2100
+ "state": {
2101
+ "_dom_classes": [],
2102
+ "_model_module": "@jupyter-widgets/controls",
2103
+ "_model_module_version": "1.5.0",
2104
+ "_model_name": "HTMLModel",
2105
+ "_view_count": null,
2106
+ "_view_module": "@jupyter-widgets/controls",
2107
+ "_view_module_version": "1.5.0",
2108
+ "_view_name": "HTMLView",
2109
+ "description": "",
2110
+ "description_tooltip": null,
2111
+ "layout": "IPY_MODEL_eedc0de0634b4e1eacb4b5922b7c31cd",
2112
+ "placeholder": "​",
2113
+ "style": "IPY_MODEL_912a18039ccb42a2bc27ef256f4d85c3",
2114
+ "value": "  0%"
2115
+ }
2116
  },
2117
+ "c37c5c2c5c384471a15319bb64b8edfe": {
2118
+ "model_module": "@jupyter-widgets/controls",
2119
+ "model_name": "FloatProgressModel",
2120
+ "model_module_version": "1.5.0",
2121
+ "state": {
2122
+ "_dom_classes": [],
2123
+ "_model_module": "@jupyter-widgets/controls",
2124
+ "_model_module_version": "1.5.0",
2125
+ "_model_name": "FloatProgressModel",
2126
+ "_view_count": null,
2127
+ "_view_module": "@jupyter-widgets/controls",
2128
+ "_view_module_version": "1.5.0",
2129
+ "_view_name": "ProgressView",
2130
+ "bar_style": "danger",
2131
+ "description": "",
2132
+ "description_tooltip": null,
2133
+ "layout": "IPY_MODEL_443f1bc17a6f438c8fb184420dadcd36",
2134
+ "max": 2,
2135
+ "min": 0,
2136
+ "orientation": "horizontal",
2137
+ "style": "IPY_MODEL_b7cff5bb7aac40ea94a15a3a1e1abcfe",
2138
+ "value": 0
2139
+ }
2140
  },
2141
+ "d6e383d9c49742cba46fe1509c9e2983": {
2142
+ "model_module": "@jupyter-widgets/controls",
2143
+ "model_name": "HTMLModel",
2144
+ "model_module_version": "1.5.0",
2145
+ "state": {
2146
+ "_dom_classes": [],
2147
+ "_model_module": "@jupyter-widgets/controls",
2148
+ "_model_module_version": "1.5.0",
2149
+ "_model_name": "HTMLModel",
2150
+ "_view_count": null,
2151
+ "_view_module": "@jupyter-widgets/controls",
2152
+ "_view_module_version": "1.5.0",
2153
+ "_view_name": "HTMLView",
2154
+ "description": "",
2155
+ "description_tooltip": null,
2156
+ "layout": "IPY_MODEL_d214361c6fba487e89b1f9c839a9616d",
2157
+ "placeholder": "​",
2158
+ "style": "IPY_MODEL_6cb69a3ff71a4ec4b618be04b5da3632",
2159
+ "value": " 0/2 [00:00&lt;?, ?it/s]"
2160
+ }
2161
  },
2162
+ "fd8214ff18c44963bb180222d97aaa04": {
2163
+ "model_module": "@jupyter-widgets/base",
2164
+ "model_name": "LayoutModel",
2165
+ "model_module_version": "1.2.0",
2166
+ "state": {
2167
+ "_model_module": "@jupyter-widgets/base",
2168
+ "_model_module_version": "1.2.0",
2169
+ "_model_name": "LayoutModel",
2170
+ "_view_count": null,
2171
+ "_view_module": "@jupyter-widgets/base",
2172
+ "_view_module_version": "1.2.0",
2173
+ "_view_name": "LayoutView",
2174
+ "align_content": null,
2175
+ "align_items": null,
2176
+ "align_self": null,
2177
+ "border": null,
2178
+ "bottom": null,
2179
+ "display": null,
2180
+ "flex": null,
2181
+ "flex_flow": null,
2182
+ "grid_area": null,
2183
+ "grid_auto_columns": null,
2184
+ "grid_auto_flow": null,
2185
+ "grid_auto_rows": null,
2186
+ "grid_column": null,
2187
+ "grid_gap": null,
2188
+ "grid_row": null,
2189
+ "grid_template_areas": null,
2190
+ "grid_template_columns": null,
2191
+ "grid_template_rows": null,
2192
+ "height": null,
2193
+ "justify_content": null,
2194
+ "justify_items": null,
2195
+ "left": null,
2196
+ "margin": null,
2197
+ "max_height": null,
2198
+ "max_width": null,
2199
+ "min_height": null,
2200
+ "min_width": null,
2201
+ "object_fit": null,
2202
+ "object_position": null,
2203
+ "order": null,
2204
+ "overflow": null,
2205
+ "overflow_x": null,
2206
+ "overflow_y": null,
2207
+ "padding": null,
2208
+ "right": null,
2209
+ "top": null,
2210
+ "visibility": null,
2211
+ "width": null
2212
+ }
2213
+ },
2214
+ "eedc0de0634b4e1eacb4b5922b7c31cd": {
2215
+ "model_module": "@jupyter-widgets/base",
2216
+ "model_name": "LayoutModel",
2217
+ "model_module_version": "1.2.0",
2218
+ "state": {
2219
+ "_model_module": "@jupyter-widgets/base",
2220
+ "_model_module_version": "1.2.0",
2221
+ "_model_name": "LayoutModel",
2222
+ "_view_count": null,
2223
+ "_view_module": "@jupyter-widgets/base",
2224
+ "_view_module_version": "1.2.0",
2225
+ "_view_name": "LayoutView",
2226
+ "align_content": null,
2227
+ "align_items": null,
2228
+ "align_self": null,
2229
+ "border": null,
2230
+ "bottom": null,
2231
+ "display": null,
2232
+ "flex": null,
2233
+ "flex_flow": null,
2234
+ "grid_area": null,
2235
+ "grid_auto_columns": null,
2236
+ "grid_auto_flow": null,
2237
+ "grid_auto_rows": null,
2238
+ "grid_column": null,
2239
+ "grid_gap": null,
2240
+ "grid_row": null,
2241
+ "grid_template_areas": null,
2242
+ "grid_template_columns": null,
2243
+ "grid_template_rows": null,
2244
+ "height": null,
2245
+ "justify_content": null,
2246
+ "justify_items": null,
2247
+ "left": null,
2248
+ "margin": null,
2249
+ "max_height": null,
2250
+ "max_width": null,
2251
+ "min_height": null,
2252
+ "min_width": null,
2253
+ "object_fit": null,
2254
+ "object_position": null,
2255
+ "order": null,
2256
+ "overflow": null,
2257
+ "overflow_x": null,
2258
+ "overflow_y": null,
2259
+ "padding": null,
2260
+ "right": null,
2261
+ "top": null,
2262
+ "visibility": null,
2263
+ "width": null
2264
+ }
2265
+ },
2266
+ "912a18039ccb42a2bc27ef256f4d85c3": {
2267
+ "model_module": "@jupyter-widgets/controls",
2268
+ "model_name": "DescriptionStyleModel",
2269
+ "model_module_version": "1.5.0",
2270
+ "state": {
2271
+ "_model_module": "@jupyter-widgets/controls",
2272
+ "_model_module_version": "1.5.0",
2273
+ "_model_name": "DescriptionStyleModel",
2274
+ "_view_count": null,
2275
+ "_view_module": "@jupyter-widgets/base",
2276
+ "_view_module_version": "1.2.0",
2277
+ "_view_name": "StyleView",
2278
+ "description_width": ""
2279
+ }
2280
+ },
2281
+ "443f1bc17a6f438c8fb184420dadcd36": {
2282
+ "model_module": "@jupyter-widgets/base",
2283
+ "model_name": "LayoutModel",
2284
+ "model_module_version": "1.2.0",
2285
+ "state": {
2286
+ "_model_module": "@jupyter-widgets/base",
2287
+ "_model_module_version": "1.2.0",
2288
+ "_model_name": "LayoutModel",
2289
+ "_view_count": null,
2290
+ "_view_module": "@jupyter-widgets/base",
2291
+ "_view_module_version": "1.2.0",
2292
+ "_view_name": "LayoutView",
2293
+ "align_content": null,
2294
+ "align_items": null,
2295
+ "align_self": null,
2296
+ "border": null,
2297
+ "bottom": null,
2298
+ "display": null,
2299
+ "flex": null,
2300
+ "flex_flow": null,
2301
+ "grid_area": null,
2302
+ "grid_auto_columns": null,
2303
+ "grid_auto_flow": null,
2304
+ "grid_auto_rows": null,
2305
+ "grid_column": null,
2306
+ "grid_gap": null,
2307
+ "grid_row": null,
2308
+ "grid_template_areas": null,
2309
+ "grid_template_columns": null,
2310
+ "grid_template_rows": null,
2311
+ "height": null,
2312
+ "justify_content": null,
2313
+ "justify_items": null,
2314
+ "left": null,
2315
+ "margin": null,
2316
+ "max_height": null,
2317
+ "max_width": null,
2318
+ "min_height": null,
2319
+ "min_width": null,
2320
+ "object_fit": null,
2321
+ "object_position": null,
2322
+ "order": null,
2323
+ "overflow": null,
2324
+ "overflow_x": null,
2325
+ "overflow_y": null,
2326
+ "padding": null,
2327
+ "right": null,
2328
+ "top": null,
2329
+ "visibility": null,
2330
+ "width": null
2331
+ }
2332
+ },
2333
+ "b7cff5bb7aac40ea94a15a3a1e1abcfe": {
2334
+ "model_module": "@jupyter-widgets/controls",
2335
+ "model_name": "ProgressStyleModel",
2336
+ "model_module_version": "1.5.0",
2337
+ "state": {
2338
+ "_model_module": "@jupyter-widgets/controls",
2339
+ "_model_module_version": "1.5.0",
2340
+ "_model_name": "ProgressStyleModel",
2341
+ "_view_count": null,
2342
+ "_view_module": "@jupyter-widgets/base",
2343
+ "_view_module_version": "1.2.0",
2344
+ "_view_name": "StyleView",
2345
+ "bar_color": null,
2346
+ "description_width": ""
2347
+ }
2348
+ },
2349
+ "d214361c6fba487e89b1f9c839a9616d": {
2350
+ "model_module": "@jupyter-widgets/base",
2351
+ "model_name": "LayoutModel",
2352
+ "model_module_version": "1.2.0",
2353
+ "state": {
2354
+ "_model_module": "@jupyter-widgets/base",
2355
+ "_model_module_version": "1.2.0",
2356
+ "_model_name": "LayoutModel",
2357
+ "_view_count": null,
2358
+ "_view_module": "@jupyter-widgets/base",
2359
+ "_view_module_version": "1.2.0",
2360
+ "_view_name": "LayoutView",
2361
+ "align_content": null,
2362
+ "align_items": null,
2363
+ "align_self": null,
2364
+ "border": null,
2365
+ "bottom": null,
2366
+ "display": null,
2367
+ "flex": null,
2368
+ "flex_flow": null,
2369
+ "grid_area": null,
2370
+ "grid_auto_columns": null,
2371
+ "grid_auto_flow": null,
2372
+ "grid_auto_rows": null,
2373
+ "grid_column": null,
2374
+ "grid_gap": null,
2375
+ "grid_row": null,
2376
+ "grid_template_areas": null,
2377
+ "grid_template_columns": null,
2378
+ "grid_template_rows": null,
2379
+ "height": null,
2380
+ "justify_content": null,
2381
+ "justify_items": null,
2382
+ "left": null,
2383
+ "margin": null,
2384
+ "max_height": null,
2385
+ "max_width": null,
2386
+ "min_height": null,
2387
+ "min_width": null,
2388
+ "object_fit": null,
2389
+ "object_position": null,
2390
+ "order": null,
2391
+ "overflow": null,
2392
+ "overflow_x": null,
2393
+ "overflow_y": null,
2394
+ "padding": null,
2395
+ "right": null,
2396
+ "top": null,
2397
+ "visibility": null,
2398
+ "width": null
2399
+ }
2400
+ },
2401
+ "6cb69a3ff71a4ec4b618be04b5da3632": {
2402
+ "model_module": "@jupyter-widgets/controls",
2403
+ "model_name": "DescriptionStyleModel",
2404
+ "model_module_version": "1.5.0",
2405
+ "state": {
2406
+ "_model_module": "@jupyter-widgets/controls",
2407
+ "_model_module_version": "1.5.0",
2408
+ "_model_name": "DescriptionStyleModel",
2409
+ "_view_count": null,
2410
+ "_view_module": "@jupyter-widgets/base",
2411
+ "_view_module_version": "1.2.0",
2412
+ "_view_name": "StyleView",
2413
+ "description_width": ""
2414
+ }
2415
+ }
2416
+ }
2417
+ }
2418
+ },
2419
+ "cells": [
2420
+ {
2421
+ "cell_type": "code",
2422
+ "execution_count": 1,
2423
+ "metadata": {
2424
+ "colab": {
2425
+ "base_uri": "https://localhost:8080/"
2426
+ },
2427
+ "id": "9ul9xNLYEzTj",
2428
+ "outputId": "eab2f146-2576-4a03-966b-078b112bebe8"
2429
+ },
2430
+ "outputs": [
2431
+ {
2432
+ "output_type": "stream",
2433
+ "name": "stdout",
2434
+ "text": [
2435
+ "Mounted at /content/drive\n",
2436
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.2/3.2 MB\u001b[0m \u001b[31m57.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
2437
+ "\u001b[?25h"
2438
+ ]
2439
+ },
2440
+ {
2441
+ "output_type": "stream",
2442
+ "name": "stderr",
2443
+ "text": [
2444
+ "WARNING:torchao:Skipping import of cpp extensions due to incompatible torch version. Please upgrade to torch >= 2.11.0 (found 2.10.0+cu128).\n"
2445
+ ]
2446
+ },
2447
+ {
2448
+ "output_type": "stream",
2449
+ "name": "stdout",
2450
+ "text": [
2451
+ "✅ torchao updated to version: 0.17.0\n",
2452
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m113.2/113.2 kB\u001b[0m \u001b[31m5.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
2453
+ "\u001b[?25h✅ Dependencies installed\n",
2454
+ "✅ Logged into Hugging Face\n"
2455
+ ]
2456
+ },
2457
+ {
2458
+ "output_type": "stream",
2459
+ "name": "stderr",
2460
+ "text": [
2461
+ "Unable to import `torchao` Tensor objects. This may affect loading checkpoints serialized with `torchao`\n",
2462
+ "Flax classes are deprecated and will be removed in Diffusers v1.0.0. We recommend migrating to PyTorch classes or pinning your version of Diffusers.\n",
2463
+ "Flax classes are deprecated and will be removed in Diffusers v1.0.0. We recommend migrating to PyTorch classes or pinning your version of Diffusers.\n"
2464
+ ]
2465
+ }
2466
+ ],
2467
+ "source": [
2468
+ "#@markdown # CELL 1 — Setup environment + login\n",
2469
+ "\n",
2470
+ "from google.colab import drive, userdata\n",
2471
+ "from huggingface_hub import login\n",
2472
+ "import torch, os, gc\n",
2473
+ "\n",
2474
+ "drive.mount(\"/content/drive\")\n",
2475
+ "\n",
2476
+ "hf_token = userdata.get(\"HF_TOKEN\")\n",
2477
+ "if hf_token:\n",
2478
+ " login(token=hf_token)\n",
2479
+ "else:\n",
2480
+ " raise ValueError(\"HF_TOKEN not found in Google Colab secrets\")\n",
2481
+ "#----#\n",
2482
+ "\n",
2483
+ "!pip uninstall -q torchao -y\n",
2484
+ "!pip install -q torchao==0.17.0 --no-deps\n",
2485
+ "\n",
2486
+ "import torchao\n",
2487
+ "print(f\"✅ torchao updated to version: {torchao.__version__}\")\n",
2488
+ "\n",
2489
+ "!pip install -q safetensors huggingface_hub diffusers transformers accelerate sdnq\n",
2490
+ "\n",
2491
+ "#images for testing\n",
2492
+ "# Resize so longest side is no greater than 1024px prior to\n",
2493
+ "#prior to encoding into VAE\n",
2494
+ "image1_path = '/content/drive/MyDrive/image1.jpg'\n",
2495
+ "image2_path = '/content/drive/MyDrive/image2.jpg'\n",
2496
+ "\n",
2497
+ "# Test prompts\n",
2498
+ "prompt1= 'a cute dog on grass'\n",
2499
+ "prompt2 = 'a golden retriever on a road'\n",
2500
+ "#-----#\n",
2501
+ "\n",
2502
+ "print(\"✅ Dependencies installed\")\n",
2503
+ "\n",
2504
+ "print(\"✅ Logged into Hugging Face\")\n",
2505
+ "\n",
2506
+ "import gc\n",
2507
+ "import torch\n",
2508
+ "from diffusers import Flux2KleinPipeline\n",
2509
+ "#----#\n",
2510
+ "from sdnq import SDNQConfig\n",
2511
+ "from sdnq.common import use_torch_compile as triton_is_available\n",
2512
+ "from sdnq.training import convert_sdnq_model_to_training\n",
2513
+ "from sdnq.training import sdnq_training_post_load_quant\n",
2514
+ "from sdnq.loader import apply_sdnq_options_to_model\n",
2515
+ "#----#\n",
2516
+ "from functools import partial\n",
2517
+ "from safetensors.torch import load_file, save_file\n",
2518
+ "from huggingface_hub import hf_hub_download\n",
2519
+ "import hashlib\n",
2520
+ "from pathlib import Path\n",
2521
+ "\n",
2522
+ "import torch\n",
2523
+ "from transformers import BitsAndBytesConfig\n",
2524
+ "\n",
2525
+ "\n",
2526
+ "# Patch function\n",
2527
+ "def patch_encode_prompt(pipe, cached_prompt_embeds, cached_text_ids, gpu_id):\n",
2528
+ " def patched(self, prompt=None, device=None, num_images_per_prompt=1, prompt_embeds=None, **kwargs):\n",
2529
+ " device = device or torch.device(f\"cuda:{gpu_id}\")\n",
2530
+ " if prompt_embeds is None:\n",
2531
+ " emb = cached_prompt_embeds.to(device)\n",
2532
+ " emb = emb.repeat(1, num_images_per_prompt, 1)\n",
2533
+ " emb = emb.view(emb.shape[0] * num_images_per_prompt, emb.shape[1], -1)\n",
2534
+ " tids = cached_text_ids.to(device)\n",
2535
+ " return emb, tids\n",
2536
+ " return self._original_encode_prompt(prompt, device, num_images_per_prompt, prompt_embeds, **kwargs)\n",
2537
+ "\n",
2538
+ " if not hasattr(pipe, '_original_encode_prompt'):\n",
2539
+ " pipe._original_encode_prompt = pipe.encode_prompt\n",
2540
+ " pipe.encode_prompt = partial(patched, pipe)\n",
2541
+ " return pipe\n",
2542
+ "\n",
2543
+ "\n",
2544
+ "# Load single pipe\n",
2545
+ "def load_klein_pipe(gpu_id: int, pipe_id: int):\n",
2546
+ " torch.cuda.set_device(gpu_id)\n",
2547
+ "\n",
2548
+ " print(f\" [GPU {gpu_id} - Pipe {pipe_id}] Loading...\")\n",
2549
+ "\n",
2550
+ " MODEL_ID = 'codeShare/Flux.2-Klein-4B-SDNQ-4bit'\n",
2551
+ "\n",
2552
+ " edit_prompt = 'this is a test'\n",
2553
+ " pipe = Flux2KleinPipeline.from_pretrained(\n",
2554
+ " MODEL_ID,\n",
2555
+ " torch_dtype=torch.float16,\n",
2556
+ " low_cpu_mem_usage=True,\n",
2557
+ " device_map=\"cpu\",\n",
2558
+ " )\n",
2559
+ "\n",
2560
+ " # SDNQ + Prompt cache\n",
2561
+ " pipe.transformer = apply_sdnq_options_to_model(pipe.transformer, use_quantized_matmul=False)\n",
2562
+ "\n",
2563
+ " # Prepare text_encoder\n",
2564
+ " pipe.text_encoder = pipe.text_encoder.to(f\"cuda:{gpu_id}\")\n",
2565
+ "\n",
2566
+ " #if False:\n",
2567
+ " #with torch.inference_mode():\n",
2568
+ " # prompt_embeds, text_ids = pipe.encode_prompt(edit_prompt, device=f\"cuda:{gpu_id}\", num_images_per_prompt=1)\n",
2569
+ "\n",
2570
+ " #pipe.edit_prompt_embeds = prompt_embeds.cpu()\n",
2571
+ " #pipe.edit_text_ids = text_ids.cpu()\n",
2572
+ " #pipe = patch_encode_prompt(pipe, pipe.edit_prompt_embeds, pipe.edit_text_ids, gpu_id)\n",
2573
+ " #del pipe.text_encoder\n",
2574
+ " #del pipe.tokenizer\n",
2575
+ " #-----#\n",
2576
+ " gc.collect()\n",
2577
+ " torch.cuda.empty_cache()\n",
2578
+ "\n",
2579
+ " pipe.transformer.to(f\"cuda:{gpu_id}\")\n",
2580
+ " # pipe.enable_model_cpu_offload(gpu_id=gpu_id) # Removed: This can interfere with VAE device placement during training\n",
2581
+ "\n",
2582
+ " # VAE stuffs\n",
2583
+ " pipe.vae = pipe.vae.to(f\"cuda:{gpu_id}\")\n",
2584
+ " #pipe.vae.enable_slicing()\n",
2585
+ " #pipe.vae.enable_tiling()\n",
2586
+ " #pipe.enable_attention_slicing(1)\n",
2587
+ "\n",
2588
+ " print(f\" [GPU {gpu_id} - Pipe {pipe_id}] Ready | VRAM: {torch.cuda.memory_allocated(gpu_id)/1e9:.2f} GB\")\n",
2589
+ " return pipe\n",
2590
+ "#----#\n"
2591
+ ]
2592
+ },
2593
+ {
2594
+ "cell_type": "code",
2595
+ "source": [
2596
+ "gc.collect()\n",
2597
+ "torch.cuda.empty_cache()\n",
2598
+ "NUM_GPUS = torch.cuda.device_count()\n",
2599
+ "PIPE_NUM = 1\n",
2600
+ "for gpu in range(NUM_GPUS):\n",
2601
+ " pipe = load_klein_pipe(gpu , PIPE_NUM)\n",
2602
+ " print(f'loaded pipe to {pipe.device}')"
2603
+ ],
2604
+ "metadata": {
2605
+ "colab": {
2606
+ "base_uri": "https://localhost:8080/",
2607
+ "height": 266,
2608
+ "referenced_widgets": [
2609
+ "16577fe1698040568ea4dba67a1fa7d0",
2610
+ "b85487705df34c2e867fcbb7024b4b5b",
2611
+ "c0ab2e603303426f879e8f0abf4b7393",
2612
+ "fd28a908626645819424f1afe289375d",
2613
+ "475e1827136247a6b58d353ea694bd19",
2614
+ "4d7f3b4f3fee49ac9092af94f2b2be1f",
2615
+ "1a9301da3ba34b7fbd3c18f826b058fd",
2616
+ "15999cdf364c48aaba6bc3d99dad3a63",
2617
+ "e953a19bb91b4ed5aa4e4244e3c91405",
2618
+ "9261c32d28854c9eb50a2e5581de4caf",
2619
+ "f1083e6575824427be954bc52a119423",
2620
+ "f3d3ac18dc9c4ddeb1ed19f0fdfffe46",
2621
+ "2cb257c3b846484c90e27e38571252d0",
2622
+ "7c93c8bd0be445c68254272da976888f",
2623
+ "7d2113f0421f4880a12d5bb0308fef49",
2624
+ "b91eefa3c4e84d73bcaab6f0d8bd93bc",
2625
+ "37ffe4997f1647eb81e7a7d78107fdf1",
2626
+ "1f19f094677e4e97ba4998adad062b69",
2627
+ "a6457a01fe5d47ff804d0d78a3fadd1e",
2628
+ "8f8355073ff140f38077ab6a29c0ae0d",
2629
+ "3dd5809a6c0c4c43b1d5166496a9fab6",
2630
+ "23d0690c63194efa8d77311d9812eb96",
2631
+ "fa76c5a087f34b53956918bea856e80b",
2632
+ "b7101eaa248c48a6ac29a28d44efdfdd",
2633
+ "fde9d91e04b24c04b27e6a9da56aeb61",
2634
+ "66a0f92f4bff492c937a9d32f60d0cb5",
2635
+ "295e8356948745e28fe33dd29b690aab",
2636
+ "9173730e1275476e8de4c9a7da30ae24",
2637
+ "8c5932aebc2e4968bee9bf47eec8057a",
2638
+ "66e49d85a7014dacbc318467ebf45be8",
2639
+ "8d929c0f97504fb6af4c503d333e4512",
2640
+ "ac114e56e12b410f83cbaca782ea72f1",
2641
+ "69c8a7fdc49145eca068262d61f37775",
2642
+ "ea7307ba2daa475ca4e55214b16239a4",
2643
+ "26da14b2a7d642ef9bbbe8ef15eaf8f5",
2644
+ "75ad91ac5d3143379a808487fdffd264",
2645
+ "a8ca808287bd4a6585186f9e9d49f4a3",
2646
+ "78a66c7278dc4f27b949715a3dff75b9",
2647
+ "3233901ab9aa474b9696a43707daa7cb",
2648
+ "0e36ef86c40c4c3fb7893c9ee788772f",
2649
+ "2fd194e0e12045aab0d91c73a399b2ce",
2650
+ "adc12d3c20e74011a45127609dcb1639",
2651
+ "38c495f402a942f88f1121c2b5c21c3c",
2652
+ "26de88ff85364c44b8df7b9061f7e1e4",
2653
+ "e06ac5a2b11f4e409eeb7e7cc19ae434",
2654
+ "ac55b36af4644c84a81a19d70cc1335e",
2655
+ "5772d2b30bf1470fbe7f9f5e9f25372b",
2656
+ "1c243e051a8b4278b28c9c59677a0112",
2657
+ "f3467296dd0140c2a84df2a037135795",
2658
+ "ee48d14ef87b4c11adf44bf3daf76197",
2659
+ "1e3e3d2a22e847698af5ee2f8f6ce22d",
2660
+ "fb6380258dca43f691d06b4d30459ca4",
2661
+ "379712892eba4a9d845520060b163a7b",
2662
+ "0f515e64cbff4c19be9ca26e3ceb48df",
2663
+ "c143b49f768c496181029f9be37dc492"
2664
+ ]
2665
+ },
2666
+ "id": "hI4jZjB3ywqi",
2667
+ "outputId": "ec31f0f2-af05-4e3e-ca2c-29657e937928"
2668
+ },
2669
+ "execution_count": 2,
2670
+ "outputs": [
2671
+ {
2672
+ "output_type": "stream",
2673
+ "name": "stdout",
2674
+ "text": [
2675
+ " [GPU 0 - Pipe 1] Loading...\n"
2676
+ ]
2677
+ },
2678
+ {
2679
+ "output_type": "display_data",
2680
+ "data": {
2681
+ "text/plain": [
2682
+ "model_index.json: 0%| | 0.00/446 [00:00<?, ?B/s]"
2683
+ ],
2684
+ "application/vnd.jupyter.widget-view+json": {
2685
+ "version_major": 2,
2686
+ "version_minor": 0,
2687
+ "model_id": "16577fe1698040568ea4dba67a1fa7d0"
2688
+ }
2689
+ },
2690
+ "metadata": {}
2691
+ },
2692
+ {
2693
+ "output_type": "display_data",
2694
+ "data": {
2695
+ "text/plain": [
2696
+ "Downloading (incomplete total...): 0.00B [00:00, ?B/s]"
2697
+ ],
2698
+ "application/vnd.jupyter.widget-view+json": {
2699
+ "version_major": 2,
2700
+ "version_minor": 0,
2701
+ "model_id": "f3d3ac18dc9c4ddeb1ed19f0fdfffe46"
2702
+ }
2703
+ },
2704
+ "metadata": {}
2705
+ },
2706
+ {
2707
+ "output_type": "display_data",
2708
+ "data": {
2709
+ "text/plain": [
2710
+ "Fetching 11 files: 0%| | 0/11 [00:00<?, ?it/s]"
2711
+ ],
2712
+ "application/vnd.jupyter.widget-view+json": {
2713
+ "version_major": 2,
2714
+ "version_minor": 0,
2715
+ "model_id": "fa76c5a087f34b53956918bea856e80b"
2716
+ }
2717
+ },
2718
+ "metadata": {}
2719
+ },
2720
+ {
2721
+ "output_type": "display_data",
2722
+ "data": {
2723
+ "text/plain": [
2724
+ "Loading pipeline components...: 0%| | 0/5 [00:00<?, ?it/s]"
2725
+ ],
2726
+ "application/vnd.jupyter.widget-view+json": {
2727
+ "version_major": 2,
2728
+ "version_minor": 0,
2729
+ "model_id": "ea7307ba2daa475ca4e55214b16239a4"
2730
+ }
2731
+ },
2732
+ "metadata": {}
2733
+ },
2734
+ {
2735
+ "output_type": "stream",
2736
+ "name": "stderr",
2737
+ "text": [
2738
+ "The config attributes {'decoder_block_out_channels': None} were passed to AutoencoderKLFlux2, but are not expected and will be ignored. Please verify your config.json configuration file.\n"
2739
+ ]
2740
+ },
2741
+ {
2742
+ "output_type": "display_data",
2743
+ "data": {
2744
+ "text/plain": [
2745
+ "Loading weights: 0%| | 0/902 [00:00<?, ?it/s]"
2746
+ ],
2747
+ "application/vnd.jupyter.widget-view+json": {
2748
+ "version_major": 2,
2749
+ "version_minor": 0,
2750
+ "model_id": "e06ac5a2b11f4e409eeb7e7cc19ae434"
2751
+ }
2752
+ },
2753
+ "metadata": {}
2754
+ },
2755
+ {
2756
+ "output_type": "stream",
2757
+ "name": "stdout",
2758
+ "text": [
2759
+ " [GPU 0 - Pipe 1] Ready | VRAM: 5.95 GB\n",
2760
+ "loaded pipe to cuda:0\n"
2761
+ ]
2762
+ }
2763
+ ]
2764
+ },
2765
+ {
2766
+ "cell_type": "code",
2767
  "source": [
2768
+ "pipe.transformer = pipe.transformer.to('cuda')\n",
2769
+ "gc.collect()\n",
2770
+ "torch.cuda.empty_cache()\n",
2771
+ "from peft import prepare_model_for_kbit_training\n",
2772
+ "pipe.transformer = prepare_model_for_kbit_training(pipe.transformer)"
2773
+ ],
2774
+ "metadata": {
2775
+ "id": "sEhh282dy1Ls"
2776
+ },
2777
+ "execution_count": 3,
2778
+ "outputs": []
2779
+ },
2780
+ {
2781
+ "cell_type": "code",
2782
+ "source": [
2783
+ "from peft import LoraConfig\n",
2784
  "\n",
2785
+ "config = LoraConfig(\n",
2786
+ " r=16,\n",
2787
+ " lora_alpha=8,\n",
2788
+ " target_modules=[\n",
2789
+ " \"attn.to_q\", \"attn.to_k\", \"attn.to_v\",\n",
2790
+ " \"ff.linear_in\", \"ff.linear_out\",\n",
2791
+ " \"ff_context.linear_in\", \"ff_context.linear_out\",\n",
2792
+ " \"attn.to_qkv_mlp_proj\",\n",
2793
+ "],\n",
2794
+ " lora_dropout=0.05,\n",
2795
+ " bias=\"none\",\n",
2796
+ ")"
2797
+ ],
2798
+ "metadata": {
2799
+ "id": "7w3yiYzhuo0A"
2800
+ },
2801
+ "execution_count": 4,
2802
+ "outputs": []
2803
+ },
2804
+ {
2805
+ "cell_type": "code",
2806
+ "source": [
2807
+ "from peft import get_peft_model\n",
2808
  "\n",
2809
+ "pipe.transformer = get_peft_model(pipe.transformer, config)"
2810
+ ],
2811
+ "metadata": {
2812
+ "id": "qTSuLZU7uzTk"
2813
+ },
2814
+ "execution_count": 5,
2815
+ "outputs": []
2816
+ },
2817
+ {
2818
+ "cell_type": "code",
2819
+ "source": [
2820
+ "pipe.transformer.print_trainable_parameters()"
2821
+ ],
2822
+ "metadata": {
2823
+ "colab": {
2824
+ "base_uri": "https://localhost:8080/"
2825
+ },
2826
+ "id": "_6k8-Z0twPn-",
2827
+ "outputId": "3f3cc893-1e91-4b77-8121-7a741ae177dd"
2828
+ },
2829
+ "execution_count": 6,
2830
+ "outputs": [
2831
+ {
2832
+ "output_type": "stream",
2833
+ "name": "stdout",
2834
+ "text": [
2835
+ "trainable params: 16,711,680 || all params: 2,167,021,056 || trainable%: 0.7712\n"
2836
+ ]
2837
+ }
2838
+ ]
2839
+ },
2840
+ {
2841
+ "cell_type": "code",
2842
+ "source": [
2843
+ "import torch\n",
2844
+ "import torch.nn.functional as F\n",
2845
+ "from torch.utils.data import Dataset, DataLoader\n",
2846
+ "import numpy as np\n",
2847
+ "from PIL import Image\n",
2848
+ "import torchvision.transforms as T\n",
2849
+ "from tqdm.auto import tqdm\n",
2850
+ "import gc\n",
2851
  "\n",
2852
+ "# ====================== YOUR DATA ======================\n",
 
 
2853
  "image1_path = '/content/drive/MyDrive/image1.jpg'\n",
2854
  "image2_path = '/content/drive/MyDrive/image2.jpg'\n",
2855
  "\n",
2856
+ "prompt1 = 'a cute dog on grass'\n",
 
2857
  "prompt2 = 'a golden retriever on a road'\n",
 
2858
  "\n",
2859
+ "image_paths = [image1_path, image2_path]\n",
2860
+ "instance_prompts = [prompt1, prompt2]\n",
2861
  "\n",
2862
+ "# ====================== DATASET ======================\n",
2863
+ "class Flux2KleinDataset(Dataset):\n",
2864
+ " def __init__(self, image_paths, prompts, resolution=512):\n",
2865
+ " self.images = [Image.open(p).convert(\"RGB\") for p in image_paths]\n",
2866
+ " self.prompts = prompts\n",
2867
+ " self.transform = T.Compose([\n",
2868
+ " T.Resize(resolution, interpolation=T.InterpolationMode.BILINEAR),\n",
2869
+ " T.CenterCrop(resolution),\n",
2870
+ " T.ToTensor(), # [0,1]\n",
2871
+ " ])\n",
2872
  "\n",
2873
+ " def __len__(self):\n",
2874
+ " return len(self.images)\n",
2875
+ "\n",
2876
+ " def __getitem__(self, idx):\n",
2877
+ " image = self.transform(self.images[idx])\n",
2878
+ " return image, self.prompts[idx]\n",
 
 
 
 
 
 
 
 
 
2879
  "\n",
2880
+ "dataset = Flux2KleinDataset(image_paths, instance_prompts, resolution=512)\n",
2881
+ "dataloader = DataLoader(dataset, batch_size=1, shuffle=True)\n",
2882
  "\n",
2883
+ "# ====================== TRAINING SETUP ======================\n",
2884
+ "device = pipe.device\n",
2885
+ "dtype = torch.float16 # or bfloat16 if supported\n",
2886
+ "\n",
2887
+ "pipe.vae.to(device, dtype=dtype)\n",
2888
+ "pipe.transformer.train()\n",
2889
+ "\n",
2890
+ "# Optional: Enable gradient checkpointing for memory savings\n",
2891
+ "#pipe.transformer.gradient_checkpointing_enable()\n",
2892
+ "\n",
2893
+ "optimizer = torch.optim.AdamW(pipe.transformer.parameters(), lr=1e-4, weight_decay=0.01)\n",
2894
+ "num_epochs = 5\n",
2895
+ "accumulation_steps = 2\n",
2896
+ "\n",
2897
+ "print(\"Starting training...\")\n",
2898
+ "\n",
2899
+ "for epoch in range(num_epochs):\n",
2900
+ " epoch_loss = 0.0\n",
2901
+ " optimizer.zero_grad()\n",
2902
+ "\n",
2903
+ " for step, (image, prompt) in enumerate(tqdm(dataloader)):\n",
2904
+ " # image: [B, C, H, W] in [0,1]\n",
2905
+ " image = image.to(device, dtype=dtype)\n",
2906
+ "\n",
2907
+ " # ====================== VAE ENCODE ======================\n",
2908
+ " with torch.no_grad():\n",
2909
+ " # FLUX VAE expects [-1, 1]\n",
2910
+ " latents = pipe.vae.encode(image * 2 - 1).latent_dist.sample()\n",
2911
+ " # No scaling factor as per your note\n",
2912
+ "\n",
2913
+ " # ====================== TEXT ENCODING ======================\n",
2914
+ " with torch.no_grad():\n",
2915
+ " # prompt is a tuple from DataLoader → convert to list\n",
2916
+ " text_inputs = pipe.tokenizer(\n",
2917
+ " list(prompt), padding=True, truncation=True,\n",
2918
+ " max_length=512, return_tensors=\"pt\"\n",
2919
+ " ).to(device)\n",
2920
+ "\n",
2921
+ " text_embeds = pipe.text_encoder(text_inputs.input_ids)\n",
2922
+ "\n",
2923
+ " # ====================== RECTIFIED FLOW NOISE ======================\n",
2924
+ " noise = torch.randn_like(latents)\n",
2925
+ " # Uniform timestep in [0,1]\n",
2926
+ " t = torch.rand((latents.shape[0],), device=device, dtype=dtype)\n",
2927
+ "\n",
2928
+ " # z_t = (1-t) * z0 + t * noise\n",
2929
+ " noisy_latents = (1.0 - t.view(-1, 1, 1, 1)) * latents + \\\n",
2930
+ " t.view(-1, 1, 1, 1) * noise\n",
2931
+ "\n",
2932
+ " # ====================== PACKING (Flux requirement) ======================\n",
2933
+ " # 2x2 packing\n",
2934
+ " b, c, h, w = noisy_latents.shape\n",
2935
+ " noisy_latents = noisy_latents.view(b, c, h//2, 2, w//2, 2)\n",
2936
+ " noisy_latents = noisy_latents.permute(0, 2, 4, 1, 3, 5).contiguous()\n",
2937
+ " noisy_latents = noisy_latents.view(b, (h//2)*(w//2), c*4)\n",
2938
+ "\n",
2939
+ " # ====================== POSITION IDS ======================\n",
2940
+ " def get_img_ids(h, w, device):\n",
2941
+ " h = h // 2\n",
2942
+ " w = w // 2\n",
2943
+ " img_ids = torch.zeros((h, w, 3), device=device)\n",
2944
+ " img_ids[..., 1] = torch.arange(h, device=device)[:, None]\n",
2945
+ " img_ids[..., 2] = torch.arange(w, device=device)[None, :]\n",
2946
+ " img_ids = img_ids.view(-1, 3)\n",
2947
+ " return img_ids\n",
2948
+ "\n",
2949
+ " img_ids = get_img_ids(h, w, device)\n",
2950
+ "\n",
2951
+ " # ====================== FORWARD PASS ======================\n",
2952
+ " noise_pred = pipe.transformer(\n",
2953
+ " hidden_states=noisy_latents,\n",
2954
+ " timestep=t, # [0,1] range\n",
2955
+ " encoder_hidden_states=text_embeds.to(device=device),\n",
2956
+ " pooled_projections=pooled_embeds, # Pooled_embeds are not defined!\n",
2957
+ " txt_ids=txt_ids,\n",
2958
+ " img_ids=img_ids,\n",
2959
+ " guidance=torch.tensor([1.0], device=device, dtype=dtype).expand(latents.shape[0]),\n",
2960
+ " return_dict=False,\n",
2961
+ " )[0]\n",
2962
+ "\n",
2963
+ " # ====================== UNPACK ======================\n",
2964
+ " noise_pred = noise_pred.view(b, h//2, w//2, c, 2, 2)\n",
2965
+ " noise_pred = noise_pred.permute(0, 3, 1, 4, 2, 5).contiguous()\n",
2966
+ " noise_pred = noise_pred.view(b, c, h, w)\n",
2967
+ "\n",
2968
+ " # ====================== LOSS ======================\n",
2969
+ " # Target is velocity / noise direction\n",
2970
+ " target = noise - latents\n",
2971
+ " loss = F.mse_loss(noise_pred, target)\n",
2972
+ " loss = loss / accumulation_steps\n",
2973
+ " loss.backward()\n",
2974
+ "\n",
2975
+ " epoch_loss += loss.item() * accumulation_steps\n",
2976
+ "\n",
2977
+ " if (step + 1) % accumulation_steps == 0:\n",
2978
+ " optimizer.step()\n",
2979
+ " optimizer.zero_grad()\n",
2980
+ " gc.collect()\n",
2981
+ " torch.cuda.empty_cache()\n",
2982
+ "\n",
2983
+ " print(f\"Epoch {epoch+1}/{num_epochs} - Loss: {epoch_loss / len(dataloader):.6f}\")\n",
2984
+ "\n",
2985
+ "# ====================== SAVE LoRA ======================\n",
2986
+ "pipe.transformer.save_pretrained(\"/content/flux_klein_lora\")\n",
2987
+ "print(\"✅ Training finished! LoRA saved to /content/flux_klein_lora\")"
2988
+ ],
2989
+ "metadata": {
2990
+ "colab": {
2991
+ "base_uri": "https://localhost:8080/",
2992
+ "height": 260,
2993
+ "referenced_widgets": [
2994
+ "a2a88573b3d3449a94b3366aace406a5",
2995
+ "6733ac1df676444cbccdd67bb13fe3c8",
2996
+ "c37c5c2c5c384471a15319bb64b8edfe",
2997
+ "d6e383d9c49742cba46fe1509c9e2983",
2998
+ "fd8214ff18c44963bb180222d97aaa04",
2999
+ "eedc0de0634b4e1eacb4b5922b7c31cd",
3000
+ "912a18039ccb42a2bc27ef256f4d85c3",
3001
+ "443f1bc17a6f438c8fb184420dadcd36",
3002
+ "b7cff5bb7aac40ea94a15a3a1e1abcfe",
3003
+ "d214361c6fba487e89b1f9c839a9616d",
3004
+ "6cb69a3ff71a4ec4b618be04b5da3632"
3005
+ ]
3006
+ },
3007
+ "id": "x-HYFzLdwj0x",
3008
+ "outputId": "4dde2b42-89af-4cfa-9d54-bc94c3546aa4"
3009
+ },
3010
+ "execution_count": 11,
3011
+ "outputs": [
3012
+ {
3013
+ "output_type": "stream",
3014
+ "name": "stdout",
3015
+ "text": [
3016
+ "Starting training...\n"
3017
+ ]
3018
+ },
3019
+ {
3020
+ "output_type": "display_data",
3021
+ "data": {
3022
+ "text/plain": [
3023
+ " 0%| | 0/2 [00:00<?, ?it/s]"
3024
+ ],
3025
+ "application/vnd.jupyter.widget-view+json": {
3026
+ "version_major": 2,
3027
+ "version_minor": 0,
3028
+ "model_id": "a2a88573b3d3449a94b3366aace406a5"
3029
+ }
3030
+ },
3031
+ "metadata": {}
3032
+ },
3033
+ {
3034
+ "output_type": "error",
3035
+ "ename": "AttributeError",
3036
+ "evalue": "'CausalLMOutputWithPast' object has no attribute 'to'",
3037
+ "traceback": [
3038
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
3039
+ "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
3040
+ "\u001b[0;32m/tmp/ipykernel_1188/1446239539.py\u001b[0m in \u001b[0;36m<cell line: 0>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 111\u001b[0m \u001b[0mhidden_states\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mnoisy_latents\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 112\u001b[0m \u001b[0mtimestep\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mt\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;31m# [0,1] range\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 113\u001b[0;31m \u001b[0mencoder_hidden_states\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtext_embeds\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 114\u001b[0m \u001b[0mpooled_projections\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mpooled_embeds\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;31m# Pooled_embeds are not defined!\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 115\u001b[0m \u001b[0mtxt_ids\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtxt_ids\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
3041
+ "\u001b[0;31mAttributeError\u001b[0m: 'CausalLMOutputWithPast' object has no attribute 'to'"
3042
+ ]
3043
+ }
3044
  ]
3045
  },
3046
+ {
3047
+ "cell_type": "markdown",
3048
+ "source": [
3049
+ "# OLD CODE"
3050
+ ],
3051
+ "metadata": {
3052
+ "id": "u6BXluFgu5Rl"
3053
+ }
3054
+ },
3055
  {
3056
  "cell_type": "code",
3057
  "source": [
 
3102
  "id": "sQamMz50JoXM",
3103
  "outputId": "fe17c7f2-6a9c-4c34-ab26-215c3cfe8f04"
3104
  },
3105
+ "execution_count": null,
3106
  "outputs": [
3107
  {
3108
  "output_type": "stream",
 
3162
  "id": "FNma-jSihzrP",
3163
  "outputId": "79dbfbee-948f-4f98-f385-913934996ee0"
3164
  },
3165
+ "execution_count": null,
3166
  "outputs": [
3167
  {
3168
  "output_type": "stream",
 
3205
  },
3206
  {
3207
  "cell_type": "code",
3208
+ "source": [],
 
 
 
 
 
 
 
 
3209
  "metadata": {
3210
  "colab": {
3211
  "base_uri": "https://localhost:8080/"
 
3213
  "id": "_fmTXBufjVLz",
3214
  "outputId": "69164b6a-9ea7-4c56-d2c8-078812c4e6ad"
3215
  },
3216
+ "execution_count": null,
3217
  "outputs": [
3218
  {
3219
  "output_type": "stream",
 
3263
  "id": "jTb-ifqeh5OC",
3264
  "outputId": "61e228c3-85e7-40f8-c2f6-52bc68080f5d"
3265
  },
3266
+ "execution_count": null,
3267
  "outputs": [
3268
  {
3269
  "output_type": "stream",
 
3402
  "id": "7p26uoeIjAe4",
3403
  "outputId": "cd9488cc-ab59-4ed6-e58c-92fba3aee489"
3404
  },
3405
+ "execution_count": null,
3406
  "outputs": [
3407
  {
3408
  "output_type": "stream",
 
3535
  },
3536
  {
3537
  "cell_type": "markdown",
3538
+ "source": [],
 
 
3539
  "metadata": {
3540
  "id": "4MRDxrA5hZus"
3541
  }
 
3589
  "id": "Gz6zaIR9GPY-",
3590
  "outputId": "74cea392-32ce-4cf9-b07f-e14a9a53453e"
3591
  },
3592
+ "execution_count": null,
3593
  "outputs": [
3594
  {
3595
  "output_type": "stream",
 
3651
  "id": "O76DmAIFL_rL",
3652
  "outputId": "81655137-8cd0-41f6-a1dc-cf3ae9eb2bfd"
3653
  },
3654
+ "execution_count": null,
3655
  "outputs": [
3656
  {
3657
  "output_type": "stream",
 
3675
  "metadata": {
3676
  "id": "xy9HRVAqMJBf"
3677
  },
3678
+ "execution_count": null,
3679
  "outputs": []
3680
  },
3681
  {
 
3755
  "id": "gXdtTyDqMIN_",
3756
  "outputId": "7f181167-269e-46e7-bdf5-616debd658ff"
3757
  },
3758
+ "execution_count": null,
3759
  "outputs": [
3760
  {
3761
  "output_type": "stream",