diff --git "a/Untitled0.ipynb" "b/Untitled0.ipynb"
new file mode 100644--- /dev/null
+++ "b/Untitled0.ipynb"
@@ -0,0 +1 @@
+{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"gpuType":"T4","mount_file_id":"1ueUid54-UhaxvANIGXjCuWOTFr3oSvHr","authorship_tag":"ABX9TyN6BTBBPASBcxtolSPkPo+7"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"},"accelerator":"GPU","widgets":{"application/vnd.jupyter.widget-state+json":{"4c1db77f7131490c9b7913a0e657c061":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_77ee6ab4b31f47789cb9f1df7dcc1dc9","IPY_MODEL_343f349617cb40bdbce950f5e0c39e7c","IPY_MODEL_12dea7a6f5c5453f90df11a068a0eb21"],"layout":"IPY_MODEL_d745b639f7a2417e9162b8755daf46c4"}},"77ee6ab4b31f47789cb9f1df7dcc1dc9":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_4e9e03501e1f4852acd6cf6c25a63a38","placeholder":"","style":"IPY_MODEL_c64b5aa4b012456aa8ee272097f59770","value":"tokenizer_config.json: 100%"}},"343f349617cb40bdbce950f5e0c39e7c":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_d194cd9ab7134e43b19b1c4dfb013b54","max":252,"min":0,"orientation":"horizontal","style":"IPY_MODEL_50262a51f70245bf85dae103f13f8b0c","value":252}},"12dea7a6f5c5453f90df11a068a0eb21":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_10805c2321a743b393a589b849d24ab4","placeholder":"","style":"IPY_MODEL_d502d3b63e954ef2a1db0f6c80eeaf22","value":" 252/252 [00:00<00:00, 6.12kB/s]"}},"d745b639f7a2417e9162b8755daf46c4":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"4e9e03501e1f4852acd6cf6c25a63a38":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"c64b5aa4b012456aa8ee272097f59770":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"d194cd9ab7134e43b19b1c4dfb013b54":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"50262a51f70245bf85dae103f13f8b0c":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"10805c2321a743b393a589b849d24ab4":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"d502d3b63e954ef2a1db0f6c80eeaf22":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"2dc61c5fe0fe47a28851b1a89a3fd81b":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_9c43569ede994d23bbfed687b2ba0a9e","IPY_MODEL_5d9f334c833a4eb290954f1fe138fef9","IPY_MODEL_f6883b2a67b849aaba998ac86543447a"],"layout":"IPY_MODEL_d957b82a5cf34bf09cf3246cfdb977c0"}},"9c43569ede994d23bbfed687b2ba0a9e":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_2d6cdb4acfcf44da85040b15f26f8663","placeholder":"","style":"IPY_MODEL_350aab0911694f0bb0d25a189b5597da","value":"vocab.txt: 100%"}},"5d9f334c833a4eb290954f1fe138fef9":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_e7f11a9bb67c47db8dfcd075abfa680d","max":231508,"min":0,"orientation":"horizontal","style":"IPY_MODEL_758ae67c24204729853e96ae7d6d198f","value":231508}},"f6883b2a67b849aaba998ac86543447a":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_3c7d7ede820b4f36a5a82380dc0418cb","placeholder":"","style":"IPY_MODEL_94a1ab82e3ef4ce1b23b7c19eba4522e","value":" 232k/232k [00:00<00:00, 3.70MB/s]"}},"d957b82a5cf34bf09cf3246cfdb977c0":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"2d6cdb4acfcf44da85040b15f26f8663":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"350aab0911694f0bb0d25a189b5597da":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"e7f11a9bb67c47db8dfcd075abfa680d":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"758ae67c24204729853e96ae7d6d198f":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"3c7d7ede820b4f36a5a82380dc0418cb":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"94a1ab82e3ef4ce1b23b7c19eba4522e":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"c52bd193e16b4a46bd9448919848b1ba":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_dbb0b4dc9b06410eb470c3a0f816a1d6","IPY_MODEL_f8041547dbd44b1296ea2a9dfd116b27","IPY_MODEL_31f416302aa64a0fb809fa2750c7a68b"],"layout":"IPY_MODEL_2bf239b1c803422dbaf1146074a909d6"}},"dbb0b4dc9b06410eb470c3a0f816a1d6":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_308e4b8a771c4149b54f9920c3054c65","placeholder":"","style":"IPY_MODEL_8cfd0ff385f44fe68c7e7905d90fde77","value":"special_tokens_map.json: 100%"}},"f8041547dbd44b1296ea2a9dfd116b27":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_0fbbc4bc74054caf864aca2141ccb81e","max":112,"min":0,"orientation":"horizontal","style":"IPY_MODEL_d157dffa311f42dc8050cf49a65d5af3","value":112}},"31f416302aa64a0fb809fa2750c7a68b":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_42f5e9c8f503468f970b66bbdff7ba59","placeholder":"","style":"IPY_MODEL_50200764bb584526a72cdb3c83a91a1d","value":" 112/112 [00:00<00:00, 4.86kB/s]"}},"2bf239b1c803422dbaf1146074a909d6":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"308e4b8a771c4149b54f9920c3054c65":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"8cfd0ff385f44fe68c7e7905d90fde77":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"0fbbc4bc74054caf864aca2141ccb81e":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"d157dffa311f42dc8050cf49a65d5af3":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"42f5e9c8f503468f970b66bbdff7ba59":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"50200764bb584526a72cdb3c83a91a1d":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"e7b3556f30ed499283cb50e1e6e99077":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_7b0f65c69b7746da8fc05b83f2c82a5d","IPY_MODEL_92b4291ad78d4a2e872b2066cb33bb27","IPY_MODEL_ce04528401cc4b64ab55f3292839e824"],"layout":"IPY_MODEL_a3a8b14b44be4ee0a896209d2cac3ed6"}},"7b0f65c69b7746da8fc05b83f2c82a5d":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_9039bf753f65475c82190c17943f80eb","placeholder":"","style":"IPY_MODEL_cc539086ade141838b077de8c7a74d3e","value":"config.json: 100%"}},"92b4291ad78d4a2e872b2066cb33bb27":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_1b962e27eac04d35a8a517fd719e4845","max":758,"min":0,"orientation":"horizontal","style":"IPY_MODEL_f31d0c35190b41f8b1e8658bf652fd90","value":758}},"ce04528401cc4b64ab55f3292839e824":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_94b2178d06914cc29a309b21807006ef","placeholder":"","style":"IPY_MODEL_639833706e064d50a735a161894f5f6f","value":" 758/758 [00:00<00:00, 23.7kB/s]"}},"a3a8b14b44be4ee0a896209d2cac3ed6":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"9039bf753f65475c82190c17943f80eb":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"cc539086ade141838b077de8c7a74d3e":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"1b962e27eac04d35a8a517fd719e4845":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"f31d0c35190b41f8b1e8658bf652fd90":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"94b2178d06914cc29a309b21807006ef":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"639833706e064d50a735a161894f5f6f":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"f120eab4b3f14e69b4f89b39f148dbd5":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_0e9daf41077a41a5aff590a09f5b5dd8","IPY_MODEL_443374200c584bcab07055f3b808dad6","IPY_MODEL_07917e3a063b49fa9c4bae32bcc51a59"],"layout":"IPY_MODEL_063a9adac27d4999ae8f36a21d9e008e"}},"0e9daf41077a41a5aff590a09f5b5dd8":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_a67408aaca384dc589fe5dea995c16ce","placeholder":"","style":"IPY_MODEL_10255410a4464cebaaf79bb6ba749a07","value":"pytorch_model.bin: 100%"}},"443374200c584bcab07055f3b808dad6":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_d53d8d9178cf43459292a48ab5b9a251","max":437992753,"min":0,"orientation":"horizontal","style":"IPY_MODEL_42b5efe09cf3498cbb11d4303f81d55d","value":437992753}},"07917e3a063b49fa9c4bae32bcc51a59":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_6754bfbea6ed4e1297a30cfaaeaaf274","placeholder":"","style":"IPY_MODEL_aa34bdc0a29943c49b6bcd2297a0dd75","value":" 438M/438M [00:05<00:00, 142MB/s]"}},"063a9adac27d4999ae8f36a21d9e008e":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"a67408aaca384dc589fe5dea995c16ce":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"10255410a4464cebaaf79bb6ba749a07":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"d53d8d9178cf43459292a48ab5b9a251":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"42b5efe09cf3498cbb11d4303f81d55d":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"6754bfbea6ed4e1297a30cfaaeaaf274":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"aa34bdc0a29943c49b6bcd2297a0dd75":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"43ef02e4c5824941ae796527195503e7":{"model_module":"@jupyter-widgets/controls","model_name":"VBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"VBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"VBoxView","box_style":"","children":["IPY_MODEL_dba8d2229d214f3391543129a0079524","IPY_MODEL_0f40195548de431e8ba6f3c48492f989","IPY_MODEL_bf43032f96f94da0bd75340c24f45efe","IPY_MODEL_aaa3fea5323f450b8f2e9c2eff13171e"],"layout":"IPY_MODEL_8019a8bcd72e426da6b5e7dde18f64a5"}},"2d6fc956181d4397b037095e895a9842":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_8a4ff0c0605144398c48d4f0976e80ac","placeholder":"","style":"IPY_MODEL_0c72beb97efa460b946a43cd2aac9fb4","value":"
Copy a token from your Hugging Face\ntokens page and paste it below.
Immediately click login after copying\nyour token or it might be stored in plain text in this notebook file. "}},"9cab8b07473d4aca8cfb0fce36fb85fd":{"model_module":"@jupyter-widgets/controls","model_name":"PasswordModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"PasswordModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"PasswordView","continuous_update":true,"description":"Token:","description_tooltip":null,"disabled":false,"layout":"IPY_MODEL_ec2088bc6a4d47bbb554d9456f53b02c","placeholder":"","style":"IPY_MODEL_acb077846ef842d38c1ee27b67dde520","value":""}},"f43cd597a1f54144bc947c2d1b7cf46d":{"model_module":"@jupyter-widgets/controls","model_name":"CheckboxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"CheckboxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"CheckboxView","description":"Add token as git credential?","description_tooltip":null,"disabled":false,"indent":true,"layout":"IPY_MODEL_d758fe9080184797afff5e4c5e5bb175","style":"IPY_MODEL_10fa32a81e52484e9e5891e866ce0741","value":true}},"9279fee1e7684dd497595cb43fd1e34c":{"model_module":"@jupyter-widgets/controls","model_name":"ButtonModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ButtonModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ButtonView","button_style":"","description":"Login","disabled":false,"icon":"","layout":"IPY_MODEL_0a7374ae6c8e4186bf062788c35ad091","style":"IPY_MODEL_e22bee69bc08452a90d5306f2bd78537","tooltip":""}},"6f76d4fd234d4090b7ab1cbe16a30ea1":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_e463923780264f019c3dbdd7d18b7851","placeholder":"","style":"IPY_MODEL_6fe7eefa8c0e4580b638ddf4de9fadab","value":"\nPro Tip: If you don't already have one, you can create a dedicated\n'notebooks' token with 'write' access, that you can then easily reuse for all\nnotebooks. "}},"8019a8bcd72e426da6b5e7dde18f64a5":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":"center","align_self":null,"border":null,"bottom":null,"display":"flex","flex":null,"flex_flow":"column","grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":"50%"}},"8a4ff0c0605144398c48d4f0976e80ac":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"0c72beb97efa460b946a43cd2aac9fb4":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"ec2088bc6a4d47bbb554d9456f53b02c":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"acb077846ef842d38c1ee27b67dde520":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"d758fe9080184797afff5e4c5e5bb175":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"10fa32a81e52484e9e5891e866ce0741":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"0a7374ae6c8e4186bf062788c35ad091":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"e22bee69bc08452a90d5306f2bd78537":{"model_module":"@jupyter-widgets/controls","model_name":"ButtonStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ButtonStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","button_color":null,"font_weight":""}},"e463923780264f019c3dbdd7d18b7851":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"6fe7eefa8c0e4580b638ddf4de9fadab":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"7b8a6c9bd828456c8d7c84823bf16051":{"model_module":"@jupyter-widgets/controls","model_name":"LabelModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"LabelModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"LabelView","description":"","description_tooltip":null,"layout":"IPY_MODEL_e6df1520898f48bda994bde1e84382ec","placeholder":"","style":"IPY_MODEL_5736707c4a56455c96055674820c637d","value":"Connecting..."}},"e6df1520898f48bda994bde1e84382ec":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"5736707c4a56455c96055674820c637d":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"dba8d2229d214f3391543129a0079524":{"model_module":"@jupyter-widgets/controls","model_name":"LabelModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"LabelModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"LabelView","description":"","description_tooltip":null,"layout":"IPY_MODEL_d0556f7ada3b4ff193a621fcd905f892","placeholder":"","style":"IPY_MODEL_af64eaea213740f6b0bc29dd5d837a5d","value":"Token is valid (permission: write)."}},"0f40195548de431e8ba6f3c48492f989":{"model_module":"@jupyter-widgets/controls","model_name":"LabelModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"LabelModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"LabelView","description":"","description_tooltip":null,"layout":"IPY_MODEL_7bc5f5f41aec45e7b4f65f3d318b913b","placeholder":"","style":"IPY_MODEL_f3e50a935b2d40fa9b94407238cc338e","value":"Your token has been saved in your configured git credential helpers (store)."}},"bf43032f96f94da0bd75340c24f45efe":{"model_module":"@jupyter-widgets/controls","model_name":"LabelModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"LabelModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"LabelView","description":"","description_tooltip":null,"layout":"IPY_MODEL_9b96c6c3afbe4494b612d760ad54be91","placeholder":"","style":"IPY_MODEL_624e4718b028427db1444f0886c60627","value":"Your token has been saved to /root/.cache/huggingface/token"}},"aaa3fea5323f450b8f2e9c2eff13171e":{"model_module":"@jupyter-widgets/controls","model_name":"LabelModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"LabelModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"LabelView","description":"","description_tooltip":null,"layout":"IPY_MODEL_dc3adb376d5d484eb50e1b33c06a9825","placeholder":"","style":"IPY_MODEL_fa6dc2f01abf433787cea9386d38bc2a","value":"Login successful"}},"d0556f7ada3b4ff193a621fcd905f892":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"af64eaea213740f6b0bc29dd5d837a5d":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"7bc5f5f41aec45e7b4f65f3d318b913b":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"f3e50a935b2d40fa9b94407238cc338e":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"9b96c6c3afbe4494b612d760ad54be91":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"624e4718b028427db1444f0886c60627":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"dc3adb376d5d484eb50e1b33c06a9825":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"fa6dc2f01abf433787cea9386d38bc2a":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}}}}},"cells":[{"cell_type":"code","execution_count":1,"metadata":{"id":"QcJKvVB3Pj8r","executionInfo":{"status":"ok","timestamp":1721280115119,"user_tz":-420,"elapsed":22058,"user":{"displayName":"Le Le","userId":"02258782812217274557"}}},"outputs":[],"source":["import re\n","import string\n","import numpy as np\n","import random\n","import pandas as pd\n","import matplotlib.pyplot as plt\n","import seaborn as sns\n","%matplotlib inline\n","from plotly import graph_objs as go\n","import plotly.express as px\n","import plotly.figure_factory as ff\n","from collections import Counter\n","\n","from PIL import Image\n","from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator\n","\n","\n","import nltk\n","from nltk.corpus import stopwords\n","from nltk.tokenize import word_tokenize\n","\n","from tqdm import tqdm\n","import os\n","import nltk\n","import spacy\n","import random\n","from spacy.util import compounding\n","from spacy.util import minibatch\n","\n","from collections import defaultdict\n","from collections import Counter\n","\n","import keras\n","from keras.models import Sequential\n","from keras.initializers import Constant\n","from keras.layers import (LSTM,\n"," Embedding,\n"," BatchNormalization,\n"," Dense,\n"," TimeDistributed,\n"," Dropout,\n"," Bidirectional,\n"," Flatten,\n"," GlobalMaxPool1D)\n","from keras.preprocessing.text import Tokenizer\n","from keras.preprocessing.sequence import pad_sequences\n","# from keras.layers.embeddings import Embedding\n","from keras.callbacks import ModelCheckpoint, ReduceLROnPlateau\n","from keras.optimizers import Adam\n","\n","from sklearn.metrics import (\n"," precision_score,\n"," recall_score,\n"," f1_score,\n"," classification_report,\n"," accuracy_score\n",")\n","import torch, os\n","import pandas as pd\n","from transformers import pipeline, BertForSequenceClassification, BertTokenizerFast\n","from torch.utils.data import Dataset"]},{"cell_type":"code","source":["!pip install accelerate -U"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"te4T8LBfQU2v","executionInfo":{"status":"ok","timestamp":1721280039419,"user_tz":-420,"elapsed":71504,"user":{"displayName":"Le Le","userId":"02258782812217274557"}},"outputId":"d5f487ec-917c-4a78-9b99-066995f812d7"},"execution_count":8,"outputs":[{"output_type":"stream","name":"stdout","text":["Collecting accelerate\n"," Downloading accelerate-0.32.1-py3-none-any.whl (314 kB)\n","\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/314.1 kB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r\u001b[2K \u001b[91m━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[90m╺\u001b[0m\u001b[90m━━━━━━━━━━━━━\u001b[0m \u001b[32m204.8/314.1 kB\u001b[0m \u001b[31m6.3 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\r\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m314.1/314.1 kB\u001b[0m \u001b[31m6.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hRequirement already satisfied: numpy<2.0.0,>=1.17 in /usr/local/lib/python3.10/dist-packages (from accelerate) (1.25.2)\n","Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from accelerate) (24.1)\n","Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from accelerate) (5.9.5)\n","Requirement already satisfied: pyyaml in /usr/local/lib/python3.10/dist-packages (from accelerate) (6.0.1)\n","Requirement already satisfied: torch>=1.10.0 in /usr/local/lib/python3.10/dist-packages (from accelerate) (2.3.1+cu121)\n","Requirement already satisfied: huggingface-hub in /usr/local/lib/python3.10/dist-packages (from accelerate) (0.23.4)\n","Requirement already satisfied: safetensors>=0.3.1 in /usr/local/lib/python3.10/dist-packages (from accelerate) (0.4.3)\n","Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from torch>=1.10.0->accelerate) (3.15.4)\n","Requirement already satisfied: typing-extensions>=4.8.0 in /usr/local/lib/python3.10/dist-packages (from torch>=1.10.0->accelerate) (4.12.2)\n","Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch>=1.10.0->accelerate) (1.13.0)\n","Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch>=1.10.0->accelerate) (3.3)\n","Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch>=1.10.0->accelerate) (3.1.4)\n","Requirement already satisfied: fsspec in /usr/local/lib/python3.10/dist-packages (from torch>=1.10.0->accelerate) (2023.6.0)\n","Collecting nvidia-cuda-nvrtc-cu12==12.1.105 (from torch>=1.10.0->accelerate)\n"," Using cached nvidia_cuda_nvrtc_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (23.7 MB)\n","Collecting nvidia-cuda-runtime-cu12==12.1.105 (from torch>=1.10.0->accelerate)\n"," Using cached nvidia_cuda_runtime_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (823 kB)\n","Collecting nvidia-cuda-cupti-cu12==12.1.105 (from torch>=1.10.0->accelerate)\n"," Using cached nvidia_cuda_cupti_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (14.1 MB)\n","Collecting nvidia-cudnn-cu12==8.9.2.26 (from torch>=1.10.0->accelerate)\n"," Using cached nvidia_cudnn_cu12-8.9.2.26-py3-none-manylinux1_x86_64.whl (731.7 MB)\n","Collecting nvidia-cublas-cu12==12.1.3.1 (from torch>=1.10.0->accelerate)\n"," Using cached nvidia_cublas_cu12-12.1.3.1-py3-none-manylinux1_x86_64.whl (410.6 MB)\n","Collecting nvidia-cufft-cu12==11.0.2.54 (from torch>=1.10.0->accelerate)\n"," Using cached nvidia_cufft_cu12-11.0.2.54-py3-none-manylinux1_x86_64.whl (121.6 MB)\n","Collecting nvidia-curand-cu12==10.3.2.106 (from torch>=1.10.0->accelerate)\n"," Using cached nvidia_curand_cu12-10.3.2.106-py3-none-manylinux1_x86_64.whl (56.5 MB)\n","Collecting nvidia-cusolver-cu12==11.4.5.107 (from torch>=1.10.0->accelerate)\n"," Using cached nvidia_cusolver_cu12-11.4.5.107-py3-none-manylinux1_x86_64.whl (124.2 MB)\n","Collecting nvidia-cusparse-cu12==12.1.0.106 (from torch>=1.10.0->accelerate)\n"," Using cached nvidia_cusparse_cu12-12.1.0.106-py3-none-manylinux1_x86_64.whl (196.0 MB)\n","Collecting nvidia-nccl-cu12==2.20.5 (from torch>=1.10.0->accelerate)\n"," Using cached nvidia_nccl_cu12-2.20.5-py3-none-manylinux2014_x86_64.whl (176.2 MB)\n","Collecting nvidia-nvtx-cu12==12.1.105 (from torch>=1.10.0->accelerate)\n"," Using cached nvidia_nvtx_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (99 kB)\n","Requirement already satisfied: triton==2.3.1 in /usr/local/lib/python3.10/dist-packages (from torch>=1.10.0->accelerate) (2.3.1)\n","Collecting nvidia-nvjitlink-cu12 (from nvidia-cusolver-cu12==11.4.5.107->torch>=1.10.0->accelerate)\n"," Downloading nvidia_nvjitlink_cu12-12.5.82-py3-none-manylinux2014_x86_64.whl (21.3 MB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m21.3/21.3 MB\u001b[0m \u001b[31m20.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hRequirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from huggingface-hub->accelerate) (2.31.0)\n","Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub->accelerate) (4.66.4)\n","Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->torch>=1.10.0->accelerate) (2.1.5)\n","Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->huggingface-hub->accelerate) (3.3.2)\n","Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->huggingface-hub->accelerate) (3.7)\n","Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->huggingface-hub->accelerate) (2.0.7)\n","Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->huggingface-hub->accelerate) (2024.7.4)\n","Requirement already satisfied: mpmath<1.4,>=1.1.0 in /usr/local/lib/python3.10/dist-packages (from sympy->torch>=1.10.0->accelerate) (1.3.0)\n","Installing collected packages: nvidia-nvtx-cu12, nvidia-nvjitlink-cu12, nvidia-nccl-cu12, nvidia-curand-cu12, nvidia-cufft-cu12, nvidia-cuda-runtime-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-cupti-cu12, nvidia-cublas-cu12, nvidia-cusparse-cu12, nvidia-cudnn-cu12, nvidia-cusolver-cu12, accelerate\n","Successfully installed accelerate-0.32.1 nvidia-cublas-cu12-12.1.3.1 nvidia-cuda-cupti-cu12-12.1.105 nvidia-cuda-nvrtc-cu12-12.1.105 nvidia-cuda-runtime-cu12-12.1.105 nvidia-cudnn-cu12-8.9.2.26 nvidia-cufft-cu12-11.0.2.54 nvidia-curand-cu12-10.3.2.106 nvidia-cusolver-cu12-11.4.5.107 nvidia-cusparse-cu12-12.1.0.106 nvidia-nccl-cu12-2.20.5 nvidia-nvjitlink-cu12-12.5.82 nvidia-nvtx-cu12-12.1.105\n"]}]},{"cell_type":"code","source":["dataset = pd.read_csv(\"/content/drive/MyDrive/ThaiLand/Data/finetuned/afterProcessing.csv\")"],"metadata":{"id":"-ILANLavQXm_","executionInfo":{"status":"ok","timestamp":1721280115790,"user_tz":-420,"elapsed":673,"user":{"displayName":"Le Le","userId":"02258782812217274557"}}},"execution_count":2,"outputs":[]},{"cell_type":"code","source":["from torch import cuda\n","device = 'cuda' if cuda.is_available() else 'cpu'\n","device"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":36},"id":"iAf1Ub1rQoaV","executionInfo":{"status":"ok","timestamp":1721280115791,"user_tz":-420,"elapsed":18,"user":{"displayName":"Le Le","userId":"02258782812217274557"}},"outputId":"d5425a20-66c9-46a9-824e-ed8463b3c5f5"},"execution_count":3,"outputs":[{"output_type":"execute_result","data":{"text/plain":["'cuda'"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"string"}},"metadata":{},"execution_count":3}]},{"cell_type":"code","source":["dataset = dataset.sample(frac=1.0, random_state=42)"],"metadata":{"id":"3l45jG65Q7QL","executionInfo":{"status":"ok","timestamp":1721280115791,"user_tz":-420,"elapsed":16,"user":{"displayName":"Le Le","userId":"02258782812217274557"}}},"execution_count":4,"outputs":[]},{"cell_type":"code","source":["labels = dataset['sentiment'].unique().tolist()\n","labels = [s.strip() for s in labels ]\n","labels"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"cDmG_mWWQ9Zh","executionInfo":{"status":"ok","timestamp":1721280115791,"user_tz":-420,"elapsed":16,"user":{"displayName":"Le Le","userId":"02258782812217274557"}},"outputId":"b4132e30-5414-457c-9185-a5f629a0bd6d"},"execution_count":5,"outputs":[{"output_type":"execute_result","data":{"text/plain":["['Positive', 'Neutral', 'Negative']"]},"metadata":{},"execution_count":5}]},{"cell_type":"code","source":["for key, value in enumerate(labels):\n"," print(value)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"-gPsU9_iRAnS","executionInfo":{"status":"ok","timestamp":1721280115791,"user_tz":-420,"elapsed":15,"user":{"displayName":"Le Le","userId":"02258782812217274557"}},"outputId":"f732f5b8-52f2-47d5-9998-a7e11a3b7658"},"execution_count":6,"outputs":[{"output_type":"stream","name":"stdout","text":["Positive\n","Neutral\n","Negative\n"]}]},{"cell_type":"code","source":["NUM_LABELS= len(labels)\n","\n","id2label={id:label for id,label in enumerate(labels)}\n","\n","label2id={label:id for id,label in enumerate(labels)}"],"metadata":{"id":"ZD4qISrFRBoI","executionInfo":{"status":"ok","timestamp":1721280115791,"user_tz":-420,"elapsed":14,"user":{"displayName":"Le Le","userId":"02258782812217274557"}}},"execution_count":7,"outputs":[]},{"cell_type":"code","source":["dataset[\"labels\"]=dataset.sentiment.map(lambda x: label2id[x.strip()])"],"metadata":{"id":"3ZXKRXtrREns","executionInfo":{"status":"ok","timestamp":1721280115792,"user_tz":-420,"elapsed":15,"user":{"displayName":"Le Le","userId":"02258782812217274557"}}},"execution_count":8,"outputs":[]},{"cell_type":"code","source":["tokenizer = BertTokenizerFast.from_pretrained(\"ProsusAI/finbert\", max_length=512)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":249,"referenced_widgets":["4c1db77f7131490c9b7913a0e657c061","77ee6ab4b31f47789cb9f1df7dcc1dc9","343f349617cb40bdbce950f5e0c39e7c","12dea7a6f5c5453f90df11a068a0eb21","d745b639f7a2417e9162b8755daf46c4","4e9e03501e1f4852acd6cf6c25a63a38","c64b5aa4b012456aa8ee272097f59770","d194cd9ab7134e43b19b1c4dfb013b54","50262a51f70245bf85dae103f13f8b0c","10805c2321a743b393a589b849d24ab4","d502d3b63e954ef2a1db0f6c80eeaf22","2dc61c5fe0fe47a28851b1a89a3fd81b","9c43569ede994d23bbfed687b2ba0a9e","5d9f334c833a4eb290954f1fe138fef9","f6883b2a67b849aaba998ac86543447a","d957b82a5cf34bf09cf3246cfdb977c0","2d6cdb4acfcf44da85040b15f26f8663","350aab0911694f0bb0d25a189b5597da","e7f11a9bb67c47db8dfcd075abfa680d","758ae67c24204729853e96ae7d6d198f","3c7d7ede820b4f36a5a82380dc0418cb","94a1ab82e3ef4ce1b23b7c19eba4522e","c52bd193e16b4a46bd9448919848b1ba","dbb0b4dc9b06410eb470c3a0f816a1d6","f8041547dbd44b1296ea2a9dfd116b27","31f416302aa64a0fb809fa2750c7a68b","2bf239b1c803422dbaf1146074a909d6","308e4b8a771c4149b54f9920c3054c65","8cfd0ff385f44fe68c7e7905d90fde77","0fbbc4bc74054caf864aca2141ccb81e","d157dffa311f42dc8050cf49a65d5af3","42f5e9c8f503468f970b66bbdff7ba59","50200764bb584526a72cdb3c83a91a1d","e7b3556f30ed499283cb50e1e6e99077","7b0f65c69b7746da8fc05b83f2c82a5d","92b4291ad78d4a2e872b2066cb33bb27","ce04528401cc4b64ab55f3292839e824","a3a8b14b44be4ee0a896209d2cac3ed6","9039bf753f65475c82190c17943f80eb","cc539086ade141838b077de8c7a74d3e","1b962e27eac04d35a8a517fd719e4845","f31d0c35190b41f8b1e8658bf652fd90","94b2178d06914cc29a309b21807006ef","639833706e064d50a735a161894f5f6f"]},"id":"5a23ZfEGRG8D","executionInfo":{"status":"ok","timestamp":1721280118966,"user_tz":-420,"elapsed":3188,"user":{"displayName":"Le Le","userId":"02258782812217274557"}},"outputId":"ff0540ad-975d-4229-b432-b13212b3781b"},"execution_count":9,"outputs":[{"output_type":"stream","name":"stderr","text":["/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_token.py:89: UserWarning: \n","The secret `HF_TOKEN` does not exist in your Colab secrets.\n","To authenticate with the Hugging Face Hub, create a token in your settings tab (https://huggingface.co./settings/tokens), set it as secret in your Google Colab and restart your session.\n","You will be able to reuse this secret in all of your notebooks.\n","Please note that authentication is recommended but still optional to access public models or datasets.\n"," warnings.warn(\n"]},{"output_type":"display_data","data":{"text/plain":["tokenizer_config.json: 0%| | 0.00/252 [00:00, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"4c1db77f7131490c9b7913a0e657c061"}},"metadata":{}},{"output_type":"display_data","data":{"text/plain":["vocab.txt: 0%| | 0.00/232k [00:00, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"2dc61c5fe0fe47a28851b1a89a3fd81b"}},"metadata":{}},{"output_type":"display_data","data":{"text/plain":["special_tokens_map.json: 0%| | 0.00/112 [00:00, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"c52bd193e16b4a46bd9448919848b1ba"}},"metadata":{}},{"output_type":"display_data","data":{"text/plain":["config.json: 0%| | 0.00/758 [00:00, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"e7b3556f30ed499283cb50e1e6e99077"}},"metadata":{}}]},{"cell_type":"code","source":["model = BertForSequenceClassification.from_pretrained(\"ProsusAI/finbert\", num_labels=NUM_LABELS, id2label=id2label, label2id=label2id)\n","model.to(device)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":830,"referenced_widgets":["f120eab4b3f14e69b4f89b39f148dbd5","0e9daf41077a41a5aff590a09f5b5dd8","443374200c584bcab07055f3b808dad6","07917e3a063b49fa9c4bae32bcc51a59","063a9adac27d4999ae8f36a21d9e008e","a67408aaca384dc589fe5dea995c16ce","10255410a4464cebaaf79bb6ba749a07","d53d8d9178cf43459292a48ab5b9a251","42b5efe09cf3498cbb11d4303f81d55d","6754bfbea6ed4e1297a30cfaaeaaf274","aa34bdc0a29943c49b6bcd2297a0dd75"]},"id":"YoBBpG39RVcH","executionInfo":{"status":"ok","timestamp":1721280127571,"user_tz":-420,"elapsed":8608,"user":{"displayName":"Le Le","userId":"02258782812217274557"}},"outputId":"014dd7f3-42fe-46d1-b959-7c278767ee12"},"execution_count":10,"outputs":[{"output_type":"display_data","data":{"text/plain":["pytorch_model.bin: 0%| | 0.00/438M [00:00, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"f120eab4b3f14e69b4f89b39f148dbd5"}},"metadata":{}},{"output_type":"execute_result","data":{"text/plain":["BertForSequenceClassification(\n"," (bert): BertModel(\n"," (embeddings): BertEmbeddings(\n"," (word_embeddings): Embedding(30522, 768, padding_idx=0)\n"," (position_embeddings): Embedding(512, 768)\n"," (token_type_embeddings): Embedding(2, 768)\n"," (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)\n"," (dropout): Dropout(p=0.1, inplace=False)\n"," )\n"," (encoder): BertEncoder(\n"," (layer): ModuleList(\n"," (0-11): 12 x BertLayer(\n"," (attention): BertAttention(\n"," (self): BertSdpaSelfAttention(\n"," (query): Linear(in_features=768, out_features=768, bias=True)\n"," (key): Linear(in_features=768, out_features=768, bias=True)\n"," (value): Linear(in_features=768, out_features=768, bias=True)\n"," (dropout): Dropout(p=0.1, inplace=False)\n"," )\n"," (output): BertSelfOutput(\n"," (dense): Linear(in_features=768, out_features=768, bias=True)\n"," (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)\n"," (dropout): Dropout(p=0.1, inplace=False)\n"," )\n"," )\n"," (intermediate): BertIntermediate(\n"," (dense): Linear(in_features=768, out_features=3072, bias=True)\n"," (intermediate_act_fn): GELUActivation()\n"," )\n"," (output): BertOutput(\n"," (dense): Linear(in_features=3072, out_features=768, bias=True)\n"," (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)\n"," (dropout): Dropout(p=0.1, inplace=False)\n"," )\n"," )\n"," )\n"," )\n"," (pooler): BertPooler(\n"," (dense): Linear(in_features=768, out_features=768, bias=True)\n"," (activation): Tanh()\n"," )\n"," )\n"," (dropout): Dropout(p=0.1, inplace=False)\n"," (classifier): Linear(in_features=768, out_features=3, bias=True)\n",")"]},"metadata":{},"execution_count":10}]},{"cell_type":"code","source":["SIZE= dataset.shape[0]\n","\n","train_texts= list(dataset.reviewText[:SIZE//2])\n","\n","val_texts= list(dataset.reviewText[SIZE//2:(3*SIZE)//4 ])\n","\n","test_texts= list(dataset.reviewText[(3*SIZE)//4:])\n","\n","train_labels= list(dataset.labels[:SIZE//2])\n","\n","val_labels= list(dataset.labels[SIZE//2:(3*SIZE)//4])\n","\n","test_labels= list(dataset.labels[(3*SIZE)//4:])"],"metadata":{"id":"O-v65aDGRXSM","executionInfo":{"status":"ok","timestamp":1721280127571,"user_tz":-420,"elapsed":10,"user":{"displayName":"Le Le","userId":"02258782812217274557"}}},"execution_count":11,"outputs":[]},{"cell_type":"code","source":["train_encodings = tokenizer(train_texts, truncation=True, padding=True)\n","val_encodings = tokenizer(val_texts, truncation=True, padding=True)\n","test_encodings = tokenizer(test_texts, truncation=True, padding=True)"],"metadata":{"id":"ja-CiNG8RZOP","executionInfo":{"status":"ok","timestamp":1721280145185,"user_tz":-420,"elapsed":17623,"user":{"displayName":"Le Le","userId":"02258782812217274557"}}},"execution_count":12,"outputs":[]},{"cell_type":"code","source":["class DataLoader(Dataset):\n"," \"\"\"\n"," Custom Dataset class for handling tokenized text data and corresponding labels.\n"," Inherits from torch.utils.data.Dataset.\n"," \"\"\"\n"," def __init__(self, encodings, labels):\n"," \"\"\"\n"," Initializes the DataLoader class with encodings and labels.\n","\n"," Args:\n"," encodings (dict): A dictionary containing tokenized input text data\n"," (e.g., 'input_ids', 'token_type_ids', 'attention_mask').\n"," labels (list): A list of integer labels for the input text data.\n"," \"\"\"\n"," self.encodings = encodings\n"," self.labels = labels\n","\n"," def __getitem__(self, idx):\n"," \"\"\"\n"," Returns a dictionary containing tokenized data and the corresponding label for a given index.\n","\n"," Args:\n"," idx (int): The index of the data item to retrieve.\n","\n"," Returns:\n"," item (dict): A dictionary containing the tokenized data and the corresponding label.\n"," \"\"\"\n"," # Retrieve tokenized data for the given index\n"," item = {key: torch.tensor(val[idx]) for key, val in self.encodings.items()}\n"," # Add the label for the given index to the item dictionary\n"," item['labels'] = torch.tensor(self.labels[idx])\n"," return item\n","\n"," def __len__(self):\n"," \"\"\"\n"," Returns the number of data items in the dataset.\n","\n"," Returns:\n"," (int): The number of data items in the dataset.\n"," \"\"\"\n"," return len(self.labels)"],"metadata":{"id":"WuJIe7vSRa0l","executionInfo":{"status":"ok","timestamp":1721280145185,"user_tz":-420,"elapsed":10,"user":{"displayName":"Le Le","userId":"02258782812217274557"}}},"execution_count":13,"outputs":[]},{"cell_type":"code","source":["train_dataloader = DataLoader(train_encodings, train_labels)\n","\n","val_dataloader = DataLoader(val_encodings, val_labels)\n","\n","test_dataset = DataLoader(test_encodings, test_labels)"],"metadata":{"id":"PwBYUbdpRdPK","executionInfo":{"status":"ok","timestamp":1721280145186,"user_tz":-420,"elapsed":11,"user":{"displayName":"Le Le","userId":"02258782812217274557"}}},"execution_count":14,"outputs":[]},{"cell_type":"code","source":[],"metadata":{"id":"IK-dS2RMRe2o","executionInfo":{"status":"ok","timestamp":1721280145186,"user_tz":-420,"elapsed":10,"user":{"displayName":"Le Le","userId":"02258782812217274557"}}},"execution_count":14,"outputs":[]},{"cell_type":"code","source":["from transformers import TrainingArguments, Trainer"],"metadata":{"id":"maFkC1zqRew7","executionInfo":{"status":"ok","timestamp":1721280145772,"user_tz":-420,"elapsed":596,"user":{"displayName":"Le Le","userId":"02258782812217274557"}}},"execution_count":15,"outputs":[]},{"cell_type":"code","source":["from sklearn.metrics import accuracy_score, precision_recall_fscore_support\n","\n","def compute_metrics(pred):\n"," \"\"\"\n"," Computes accuracy, F1, precision, and recall for a given set of predictions.\n","\n"," Args:\n"," pred (obj): An object containing label_ids and predictions attributes.\n"," - label_ids (array-like): A 1D array of true class labels.\n"," - predictions (array-like): A 2D array where each row represents\n"," an observation, and each column represents the probability of\n"," that observation belonging to a certain class.\n","\n"," Returns:\n"," dict: A dictionary containing the following metrics:\n"," - Accuracy (float): The proportion of correctly classified instances.\n"," - F1 (float): The macro F1 score, which is the harmonic mean of precision\n"," and recall. Macro averaging calculates the metric independently for\n"," each class and then takes the average.\n"," - Precision (float): The macro precision, which is the number of true\n"," positives divided by the sum of true positives and false positives.\n"," - Recall (float): The macro recall, which is the number of true positives\n"," divided by the sum of true positives and false negatives.\n"," \"\"\"\n"," # Extract true labels from the input object\n"," labels = pred.label_ids\n","\n"," # Obtain predicted class labels by finding the column index with the maximum probability\n"," preds = pred.predictions.argmax(-1)\n","\n"," # Compute macro precision, recall, and F1 score using sklearn's precision_recall_fscore_support function\n"," precision, recall, f1, _ = precision_recall_fscore_support(labels, preds, average='macro')\n","\n"," # Calculate the accuracy score using sklearn's accuracy_score function\n"," acc = accuracy_score(labels, preds)\n","\n"," # Return the computed metrics as a dictionary\n"," return {\n"," 'Accuracy': acc,\n"," 'F1': f1,\n"," 'Precision': precision,\n"," 'Recall': recall\n"," }"],"metadata":{"id":"v4UANqI_RhBo","executionInfo":{"status":"ok","timestamp":1721280145772,"user_tz":-420,"elapsed":5,"user":{"displayName":"Le Le","userId":"02258782812217274557"}}},"execution_count":16,"outputs":[]},{"cell_type":"code","source":["training_args = TrainingArguments(\n"," # The output directory where the model predictions and checkpoints will be written\n"," output_dir='/content/drive/MyDrive/ThaiLand/model/finetuned/finBert',\n"," do_train=True,\n"," do_eval=True,\n"," # The number of epochs, defaults to 3.0\n"," num_train_epochs=3,\n"," per_device_train_batch_size=32,\n"," per_device_eval_batch_size=32,\n"," # Number of steps used for a linear warmup\n"," warmup_steps=100,\n"," weight_decay=0.01,\n"," logging_strategy='steps',\n"," # TensorBoard log directory\n"," logging_dir='/content/drive/MyDrive/ThaiLand/model/finetuned/finBert/multi-class-logs',\n"," logging_steps=50,\n"," evaluation_strategy=\"steps\",\n"," eval_steps=50,\n"," save_strategy=\"steps\",\n"," fp16=True,\n"," load_best_model_at_end=True\n",")"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"FnPF3omzRjPS","executionInfo":{"status":"ok","timestamp":1721280145772,"user_tz":-420,"elapsed":4,"user":{"displayName":"Le Le","userId":"02258782812217274557"}},"outputId":"0357a899-f8d3-4e40-e114-a3632fb442e4"},"execution_count":17,"outputs":[{"output_type":"stream","name":"stderr","text":["/usr/local/lib/python3.10/dist-packages/transformers/training_args.py:1494: FutureWarning: `evaluation_strategy` is deprecated and will be removed in version 4.46 of 🤗 Transformers. Use `eval_strategy` instead\n"," warnings.warn(\n"]}]},{"cell_type":"code","source":["trainer = Trainer(\n"," # the pre-trained model that will be fine-tuned\n"," model=model,\n"," # training arguments that we defined above\n"," args=training_args,\n"," train_dataset=train_dataloader,\n"," eval_dataset=val_dataloader,\n"," compute_metrics= compute_metrics\n","\n",")"],"metadata":{"id":"ZUP4E17zRlaq","executionInfo":{"status":"ok","timestamp":1721280145772,"user_tz":-420,"elapsed":2,"user":{"displayName":"Le Le","userId":"02258782812217274557"}}},"execution_count":18,"outputs":[]},{"cell_type":"code","source":["trainer.train()"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":1000},"id":"im4XwWC4Rra-","executionInfo":{"status":"ok","timestamp":1721283943570,"user_tz":-420,"elapsed":3797800,"user":{"displayName":"Le Le","userId":"02258782812217274557"}},"outputId":"aec7565b-5dee-464d-8219-ae9190b38036"},"execution_count":19,"outputs":[{"output_type":"display_data","data":{"text/plain":[""],"text/html":["\n"," \n"," \n","
\n"," [1830/1830 1:03:13, Epoch 3/3]\n","
\n"," \n"," \n"," \n"," Step | \n"," Training Loss | \n"," Validation Loss | \n"," Accuracy | \n"," F1 | \n"," Precision | \n"," Recall | \n","
\n"," \n"," \n"," \n"," 50 | \n"," 1.215200 | \n"," 0.614000 | \n"," 0.700410 | \n"," 0.654520 | \n"," 0.733853 | \n"," 0.702028 | \n","
\n"," \n"," 100 | \n"," 0.535700 | \n"," 0.473581 | \n"," 0.826462 | \n"," 0.821550 | \n"," 0.826996 | \n"," 0.826804 | \n","
\n"," \n"," 150 | \n"," 0.442100 | \n"," 0.418947 | \n"," 0.850051 | \n"," 0.846622 | \n"," 0.849416 | \n"," 0.850491 | \n","
\n"," \n"," 200 | \n"," 0.459100 | \n"," 0.417725 | \n"," 0.838974 | \n"," 0.833642 | \n"," 0.841746 | \n"," 0.839463 | \n","
\n"," \n"," 250 | \n"," 0.438200 | \n"," 0.387644 | \n"," 0.854872 | \n"," 0.853693 | \n"," 0.853832 | \n"," 0.855017 | \n","
\n"," \n"," 300 | \n"," 0.400200 | \n"," 0.406291 | \n"," 0.843385 | \n"," 0.845370 | \n"," 0.850290 | \n"," 0.843340 | \n","
\n"," \n"," 350 | \n"," 0.408500 | \n"," 0.381836 | \n"," 0.857641 | \n"," 0.857365 | \n"," 0.857235 | \n"," 0.857941 | \n","
\n"," \n"," 400 | \n"," 0.369200 | \n"," 0.370010 | \n"," 0.860821 | \n"," 0.859204 | \n"," 0.859768 | \n"," 0.861085 | \n","
\n"," \n"," 450 | \n"," 0.368600 | \n"," 0.372971 | \n"," 0.861026 | \n"," 0.860391 | \n"," 0.860033 | \n"," 0.861260 | \n","
\n"," \n"," 500 | \n"," 0.396600 | \n"," 0.376049 | \n"," 0.856615 | \n"," 0.857340 | \n"," 0.858361 | \n"," 0.856850 | \n","
\n"," \n"," 550 | \n"," 0.372900 | \n"," 0.353303 | \n"," 0.867282 | \n"," 0.866727 | \n"," 0.866365 | \n"," 0.867522 | \n","
\n"," \n"," 600 | \n"," 0.360500 | \n"," 0.358157 | \n"," 0.863179 | \n"," 0.863681 | \n"," 0.864476 | \n"," 0.863239 | \n","
\n"," \n"," 650 | \n"," 0.347100 | \n"," 0.367144 | \n"," 0.864410 | \n"," 0.864313 | \n"," 0.864586 | \n"," 0.864471 | \n","
\n"," \n"," 700 | \n"," 0.339700 | \n"," 0.363200 | \n"," 0.865846 | \n"," 0.865801 | \n"," 0.865614 | \n"," 0.866027 | \n","
\n"," \n"," 750 | \n"," 0.297700 | \n"," 0.373714 | \n"," 0.863077 | \n"," 0.861932 | \n"," 0.861959 | \n"," 0.863432 | \n","
\n"," \n"," 800 | \n"," 0.304700 | \n"," 0.360875 | \n"," 0.865641 | \n"," 0.866366 | \n"," 0.867339 | \n"," 0.865733 | \n","
\n"," \n"," 850 | \n"," 0.281700 | \n"," 0.381632 | \n"," 0.868205 | \n"," 0.866136 | \n"," 0.867533 | \n"," 0.868517 | \n","
\n"," \n"," 900 | \n"," 0.266700 | \n"," 0.373397 | \n"," 0.869026 | \n"," 0.868028 | \n"," 0.868553 | \n"," 0.869162 | \n","
\n"," \n"," 950 | \n"," 0.280900 | \n"," 0.352265 | \n"," 0.870154 | \n"," 0.870576 | \n"," 0.870962 | \n"," 0.870274 | \n","
\n"," \n"," 1000 | \n"," 0.296400 | \n"," 0.362135 | \n"," 0.870872 | \n"," 0.869292 | \n"," 0.870477 | \n"," 0.871104 | \n","
\n"," \n"," 1050 | \n"," 0.299300 | \n"," 0.350195 | \n"," 0.873128 | \n"," 0.872778 | \n"," 0.872898 | \n"," 0.873227 | \n","
\n"," \n"," 1100 | \n"," 0.315300 | \n"," 0.353175 | \n"," 0.872308 | \n"," 0.870296 | \n"," 0.871765 | \n"," 0.872607 | \n","
\n"," \n"," 1150 | \n"," 0.308900 | \n"," 0.358130 | \n"," 0.872103 | \n"," 0.870992 | \n"," 0.871133 | \n"," 0.872372 | \n","
\n"," \n"," 1200 | \n"," 0.302700 | \n"," 0.351292 | \n"," 0.872513 | \n"," 0.871211 | \n"," 0.871867 | \n"," 0.872669 | \n","
\n"," \n"," 1250 | \n"," 0.229400 | \n"," 0.367332 | \n"," 0.871385 | \n"," 0.871496 | \n"," 0.871498 | \n"," 0.871527 | \n","
\n"," \n"," 1300 | \n"," 0.232100 | \n"," 0.363012 | \n"," 0.871590 | \n"," 0.871842 | \n"," 0.872701 | \n"," 0.871609 | \n","
\n"," \n"," 1350 | \n"," 0.200300 | \n"," 0.395148 | \n"," 0.872000 | \n"," 0.871407 | \n"," 0.871124 | \n"," 0.872225 | \n","
\n"," \n"," 1400 | \n"," 0.194800 | \n"," 0.391207 | \n"," 0.872410 | \n"," 0.872140 | \n"," 0.871925 | \n"," 0.872579 | \n","
\n"," \n"," 1450 | \n"," 0.193900 | \n"," 0.387140 | \n"," 0.873333 | \n"," 0.873423 | \n"," 0.873431 | \n"," 0.873477 | \n","
\n"," \n"," 1500 | \n"," 0.189700 | \n"," 0.393748 | \n"," 0.873846 | \n"," 0.873173 | \n"," 0.872961 | \n"," 0.874070 | \n","
\n"," \n"," 1550 | \n"," 0.195100 | \n"," 0.391498 | \n"," 0.871077 | \n"," 0.870204 | \n"," 0.870351 | \n"," 0.871258 | \n","
\n"," \n"," 1600 | \n"," 0.193000 | \n"," 0.390159 | \n"," 0.873231 | \n"," 0.872859 | \n"," 0.872687 | \n"," 0.873397 | \n","
\n"," \n"," 1650 | \n"," 0.198200 | \n"," 0.390281 | \n"," 0.873436 | \n"," 0.873419 | \n"," 0.873326 | \n"," 0.873591 | \n","
\n"," \n"," 1700 | \n"," 0.183600 | \n"," 0.392936 | \n"," 0.873436 | \n"," 0.873193 | \n"," 0.873116 | \n"," 0.873577 | \n","
\n"," \n"," 1750 | \n"," 0.211200 | \n"," 0.392684 | \n"," 0.874154 | \n"," 0.873830 | \n"," 0.873753 | \n"," 0.874303 | \n","
\n"," \n"," 1800 | \n"," 0.193700 | \n"," 0.389910 | \n"," 0.873846 | \n"," 0.873913 | \n"," 0.874053 | \n"," 0.873958 | \n","
\n"," \n","
"]},"metadata":{}},{"output_type":"execute_result","data":{"text/plain":["TrainOutput(global_step=1830, training_loss=0.3258447571530368, metrics={'train_runtime': 3796.5285, 'train_samples_per_second': 15.409, 'train_steps_per_second': 0.482, 'total_flos': 1.5392134937088e+16, 'train_loss': 0.3258447571530368, 'epoch': 3.0})"]},"metadata":{},"execution_count":19}]},{"cell_type":"code","source":["q=[trainer.evaluate(eval_dataset=df) for df in [train_dataloader, val_dataloader, test_dataset]]\n","\n","pd.DataFrame(q, index=[\"train\",\"val\",\"test\"]).iloc[:,:5]"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":163},"id":"TM8323vQRtPS","executionInfo":{"status":"ok","timestamp":1721284215256,"user_tz":-420,"elapsed":271699,"user":{"displayName":"Le Le","userId":"02258782812217274557"}},"outputId":"5b1efaf5-9b28-4abe-f712-2b1082441e4a"},"execution_count":20,"outputs":[{"output_type":"display_data","data":{"text/plain":[""],"text/html":["\n"," \n"," \n","
\n"," [610/610 04:31]\n","
\n"," "]},"metadata":{}},{"output_type":"execute_result","data":{"text/plain":[" eval_loss eval_Accuracy eval_F1 eval_Precision eval_Recall\n","train 0.234579 0.920615 0.919718 0.920132 0.920377\n","val 0.362135 0.870872 0.869292 0.870477 0.871104\n","test 0.362268 0.868000 0.866591 0.867133 0.868500"],"text/html":["\n"," \n","
\n","\n","
\n"," \n"," \n"," | \n"," eval_loss | \n"," eval_Accuracy | \n"," eval_F1 | \n"," eval_Precision | \n"," eval_Recall | \n","
\n"," \n"," \n"," \n"," train | \n"," 0.234579 | \n"," 0.920615 | \n"," 0.919718 | \n"," 0.920132 | \n"," 0.920377 | \n","
\n"," \n"," val | \n"," 0.362135 | \n"," 0.870872 | \n"," 0.869292 | \n"," 0.870477 | \n"," 0.871104 | \n","
\n"," \n"," test | \n"," 0.362268 | \n"," 0.868000 | \n"," 0.866591 | \n"," 0.867133 | \n"," 0.868500 | \n","
\n"," \n","
\n","
\n","
\n","
\n"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"dataframe","summary":"{\n \"name\": \"pd\",\n \"rows\": 3,\n \"fields\": [\n {\n \"column\": \"eval_loss\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.07368297509412558,\n \"min\": 0.23457905650138855,\n \"max\": 0.36226826906204224,\n \"num_unique_values\": 3,\n \"samples\": [\n 0.23457905650138855,\n 0.36213505268096924,\n 0.36226826906204224\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"eval_Accuracy\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.02958335856690685,\n \"min\": 0.868,\n \"max\": 0.9206153846153846,\n \"num_unique_values\": 3,\n \"samples\": [\n 0.9206153846153846,\n 0.8708717948717949,\n 0.868\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"eval_F1\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.029923850559777643,\n \"min\": 0.8665908345798069,\n \"max\": 0.9197182310091359,\n \"num_unique_values\": 3,\n \"samples\": [\n 0.9197182310091359,\n 0.8692920034136113,\n 0.8665908345798069\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"eval_Precision\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.02968128935149735,\n \"min\": 0.8671326894340972,\n \"max\": 0.9201324887084367,\n \"num_unique_values\": 3,\n \"samples\": [\n 0.9201324887084367,\n 0.8704765365069432,\n 0.8671326894340972\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"eval_Recall\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.02922855585447433,\n \"min\": 0.8685003092802637,\n \"max\": 0.9203774589344147,\n \"num_unique_values\": 3,\n \"samples\": [\n 0.9203774589344147,\n 0.871104436613666,\n 0.8685003092802637\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"}},"metadata":{},"execution_count":20}]},{"cell_type":"code","source":["from transformers import DistilBertForSequenceClassification, DistilBertTokenizerFast"],"metadata":{"id":"m8U_DM_PRuyq","executionInfo":{"status":"ok","timestamp":1721284215256,"user_tz":-420,"elapsed":4,"user":{"displayName":"Le Le","userId":"02258782812217274557"}}},"execution_count":21,"outputs":[]},{"cell_type":"code","source":["def predict(text):\n"," \"\"\"\n"," Predicts the class label for a given input text\n","\n"," Args:\n"," text (str): The input text for which the class label needs to be predicted.\n","\n"," Returns:\n"," probs (torch.Tensor): Class probabilities for the input text.\n"," pred_label_idx (torch.Tensor): The index of the predicted class label.\n"," pred_label (str): The predicted class label.\n"," \"\"\"\n"," # Tokenize the input text and move tensors to the GPU if available\n"," inputs = tokenizer(text, padding=True, truncation=True, max_length=512, return_tensors=\"pt\").to(\"cuda\")\n","\n"," # Get model output (logits)\n"," outputs = model(**inputs)\n","\n"," probs = outputs[0].softmax(1)\n"," \"\"\" Explanation outputs: The BERT model returns a tuple containing the output logits (and possibly other elements depending on the model configuration). In this case, the output logits are the first element in the tuple, which is why we access it using outputs[0].\n","\n"," outputs[0]: This is a tensor containing the raw output logits for each class. The shape of the tensor is (batch_size, num_classes) where batch_size is the number of input samples (in this case, 1, as we are predicting for a single input text) and num_classes is the number of target classes.\n","\n"," softmax(1): The softmax function is applied along dimension 1 (the class dimension) to convert the raw logits into class probabilities. Softmax normalizes the logits so that they sum to 1, making them interpretable as probabilities. \"\"\"\n","\n"," # Get the index of the class with the highest probability\n"," # argmax() finds the index of the maximum value in the tensor along a specified dimension.\n"," # By default, if no dimension is specified, it returns the index of the maximum value in the flattened tensor.\n"," pred_label_idx = probs.argmax()\n","\n"," # Now map the predicted class index to the actual class label\n"," # Since pred_label_idx is a tensor containing a single value (the predicted class index),\n"," # the .item() method is used to extract the value as a scalar\n"," pred_label = model.config.id2label[pred_label_idx.item()]\n","\n"," return probs, pred_label_idx, pred_label"],"metadata":{"id":"4JnodKOARw4g","executionInfo":{"status":"ok","timestamp":1721284215256,"user_tz":-420,"elapsed":4,"user":{"displayName":"Le Le","userId":"02258782812217274557"}}},"execution_count":22,"outputs":[]},{"cell_type":"code","source":["model_path = \"/content/drive/MyDrive/ThaiLand/model/finetuned/finBert\"\n","trainer.save_model(model_path)\n","tokenizer.save_pretrained(model_path)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"4fk9x28QRy4z","executionInfo":{"status":"ok","timestamp":1721284218049,"user_tz":-420,"elapsed":2796,"user":{"displayName":"Le Le","userId":"02258782812217274557"}},"outputId":"44c1abc1-d2da-4475-c106-d759f36b25e6"},"execution_count":23,"outputs":[{"output_type":"execute_result","data":{"text/plain":["('/content/drive/MyDrive/ThaiLand/model/finetuned/finBert/tokenizer_config.json',\n"," '/content/drive/MyDrive/ThaiLand/model/finetuned/finBert/special_tokens_map.json',\n"," '/content/drive/MyDrive/ThaiLand/model/finetuned/finBert/vocab.txt',\n"," '/content/drive/MyDrive/ThaiLand/model/finetuned/finBert/added_tokens.json',\n"," '/content/drive/MyDrive/ThaiLand/model/finetuned/finBert/tokenizer.json')"]},"metadata":{},"execution_count":23}]},{"cell_type":"code","source":["model_path = \"railwayBangkok-sentiment-analysis\"\n","trainer.save_model(model_path)\n","tokenizer.save_pretrained(model_path)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"UaJkcsa8idXJ","executionInfo":{"status":"ok","timestamp":1721284319502,"user_tz":-420,"elapsed":3096,"user":{"displayName":"Le Le","userId":"02258782812217274557"}},"outputId":"bea5ba39-8dfb-4533-dab4-cd87f80dac2a"},"execution_count":24,"outputs":[{"output_type":"execute_result","data":{"text/plain":["('railwayBangkok-sentiment-analysis/tokenizer_config.json',\n"," 'railwayBangkok-sentiment-analysis/special_tokens_map.json',\n"," 'railwayBangkok-sentiment-analysis/vocab.txt',\n"," 'railwayBangkok-sentiment-analysis/added_tokens.json',\n"," 'railwayBangkok-sentiment-analysis/tokenizer.json')"]},"metadata":{},"execution_count":24}]},{"cell_type":"code","source":["model_path = \"/content/drive/MyDrive/ThaiLand/model/finetuned/finBert\"\n","\n","\n","model = BertForSequenceClassification.from_pretrained(model_path)\n","tokenizer= BertTokenizerFast.from_pretrained(model_path)\n","nlp= pipeline(\"sentiment-analysis\", model=model, tokenizer=tokenizer)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"nFSoOS0AitAJ","executionInfo":{"status":"ok","timestamp":1721284741645,"user_tz":-420,"elapsed":2785,"user":{"displayName":"Le Le","userId":"02258782812217274557"}},"outputId":"d3f2ca41-0321-44de-f047-1296d8490863"},"execution_count":29,"outputs":[{"output_type":"stream","name":"stderr","text":["Hardware accelerator e.g. GPU is available in the environment, but no `device` argument is passed to the `Pipeline` object. Model will be on CPU.\n"]}]},{"cell_type":"code","source":["nlp(\"This bts train is smooth but i think we dont need to use\")"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"-Nl975bzi2Yl","executionInfo":{"status":"ok","timestamp":1721284747093,"user_tz":-420,"elapsed":1012,"user":{"displayName":"Le Le","userId":"02258782812217274557"}},"outputId":"c06d71a0-e743-4d01-e8e5-ac858b8edd57"},"execution_count":30,"outputs":[{"output_type":"execute_result","data":{"text/plain":["[{'label': 'Neutral', 'score': 0.8331486582756042}]"]},"metadata":{},"execution_count":30}]},{"cell_type":"code","source":["import torch\n","from huggingface_hub import notebook_login\n","\n","notebook_login()"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":331,"referenced_widgets":["43ef02e4c5824941ae796527195503e7","2d6fc956181d4397b037095e895a9842","9cab8b07473d4aca8cfb0fce36fb85fd","f43cd597a1f54144bc947c2d1b7cf46d","9279fee1e7684dd497595cb43fd1e34c","6f76d4fd234d4090b7ab1cbe16a30ea1","8019a8bcd72e426da6b5e7dde18f64a5","8a4ff0c0605144398c48d4f0976e80ac","0c72beb97efa460b946a43cd2aac9fb4","ec2088bc6a4d47bbb554d9456f53b02c","acb077846ef842d38c1ee27b67dde520","d758fe9080184797afff5e4c5e5bb175","10fa32a81e52484e9e5891e866ce0741","0a7374ae6c8e4186bf062788c35ad091","e22bee69bc08452a90d5306f2bd78537","e463923780264f019c3dbdd7d18b7851","6fe7eefa8c0e4580b638ddf4de9fadab","7b8a6c9bd828456c8d7c84823bf16051","e6df1520898f48bda994bde1e84382ec","5736707c4a56455c96055674820c637d","dba8d2229d214f3391543129a0079524","0f40195548de431e8ba6f3c48492f989","bf43032f96f94da0bd75340c24f45efe","aaa3fea5323f450b8f2e9c2eff13171e","d0556f7ada3b4ff193a621fcd905f892","af64eaea213740f6b0bc29dd5d837a5d","7bc5f5f41aec45e7b4f65f3d318b913b","f3e50a935b2d40fa9b94407238cc338e","9b96c6c3afbe4494b612d760ad54be91","624e4718b028427db1444f0886c60627","dc3adb376d5d484eb50e1b33c06a9825","fa6dc2f01abf433787cea9386d38bc2a"]},"id":"RoDkFk4yl70X","executionInfo":{"status":"ok","timestamp":1721285603738,"user_tz":-420,"elapsed":420,"user":{"displayName":"Le Le","userId":"02258782812217274557"}},"outputId":"a7f2b32a-f137-4b8c-ece8-48ddd82491df"},"execution_count":34,"outputs":[{"output_type":"display_data","data":{"text/plain":["VBox(children=(HTML(value=' 304\u001b[0;31m \u001b[0mresponse\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mraise_for_status\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 305\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mHTTPError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/requests/models.py\u001b[0m in \u001b[0;36mraise_for_status\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1020\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mhttp_error_msg\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1021\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mHTTPError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mhttp_error_msg\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mresponse\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\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 1022\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;31mHTTPError\u001b[0m: 403 Client Error: Forbidden for url: https://huggingface.co./api/repos/create","\nThe above exception was the direct cause of the following exception:\n","\u001b[0;31mHfHubHTTPError\u001b[0m Traceback (most recent call last)","\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mtrainer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpush_to_hub\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"railwayBK-sentiment-analysis\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/transformers/trainer.py\u001b[0m in \u001b[0;36mpush_to_hub\u001b[0;34m(self, commit_message, blocking, token, **kwargs)\u001b[0m\n\u001b[1;32m 4274\u001b[0m \u001b[0;31m# In case the user calls this method with args.push_to_hub = False\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4275\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhub_model_id\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 4276\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minit_hf_repo\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtoken\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtoken\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 4277\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4278\u001b[0m \u001b[0;31m# Needs to be executed on all processes for TPU training, but will only save on the processed determined by\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/transformers/trainer.py\u001b[0m in \u001b[0;36minit_hf_repo\u001b[0;34m(self, token)\u001b[0m\n\u001b[1;32m 4098\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4099\u001b[0m \u001b[0mtoken\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtoken\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mtoken\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m \u001b[0;32melse\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhub_token\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 4100\u001b[0;31m \u001b[0mrepo_url\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcreate_repo\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrepo_name\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtoken\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtoken\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mprivate\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhub_private_repo\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mexist_ok\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\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 4101\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhub_model_id\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrepo_url\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrepo_id\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4102\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpush_in_progress\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py\u001b[0m in \u001b[0;36m_inner_fn\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 112\u001b[0m \u001b[0mkwargs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msmoothly_deprecate_use_auth_token\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfn_name\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mfn\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__name__\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhas_token\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mhas_token\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 113\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 114\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\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 115\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 116\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0m_inner_fn\u001b[0m \u001b[0;31m# type: ignore\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/huggingface_hub/hf_api.py\u001b[0m in \u001b[0;36mcreate_repo\u001b[0;34m(self, repo_id, token, private, repo_type, exist_ok, space_sdk, space_hardware, space_storage, space_sleep_time, space_secrets, space_variables)\u001b[0m\n\u001b[1;32m 3267\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mRepoUrl\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf\"{self.endpoint}/{repo_type}/{repo_id}\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3268\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mHfHubHTTPError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 3269\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0merr\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 3270\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3271\u001b[0m \u001b[0;32mraise\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/huggingface_hub/hf_api.py\u001b[0m in \u001b[0;36mcreate_repo\u001b[0;34m(self, repo_id, token, private, repo_type, exist_ok, space_sdk, space_hardware, space_storage, space_sleep_time, space_secrets, space_variables)\u001b[0m\n\u001b[1;32m 3254\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3255\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 3256\u001b[0;31m \u001b[0mhf_raise_for_status\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mr\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 3257\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mHTTPError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0merr\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3258\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mexist_ok\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0merr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mresponse\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstatus_code\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m409\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py\u001b[0m in \u001b[0;36mhf_raise_for_status\u001b[0;34m(response, endpoint_name)\u001b[0m\n\u001b[1;32m 365\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m\"make sure you have a token with the `write` role.\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 366\u001b[0m )\n\u001b[0;32m--> 367\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mHfHubHTTPError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmessage\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mresponse\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mresponse\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 368\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 369\u001b[0m \u001b[0;31m# Convert `HTTPError` into a `HfHubHTTPError` to display request information\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;31mHfHubHTTPError\u001b[0m: (Request ID: Root=1-6698bb96-16e8663d3d51591c5b511547;e22595ec-d9ac-4add-9ee5-622f11708499)\n\n403 Forbidden: You don't have the rights to create a model under the namespace \"vinh120203\".\nCannot access content at: https://huggingface.co./api/repos/create.\nIf you are trying to create or update content,make sure you have a token with the `write` role."]}]}]}
\ No newline at end of file
|