{"metadata":{"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.11.11","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"colab":{"provenance":[],"gpuType":"T4","authorship_tag":"ABX9TyP4fYqMWrrRH3ePQROSrDTr"},"widgets":{"application/vnd.jupyter.widget-state+json":{"3edb71371fbc4961a065fbd7a6ba4c31":{"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_b0952aa9ee794efc84ba7fd692d54773","IPY_MODEL_128929b8e6ab48f6a0b2d9b475ddcca3","IPY_MODEL_89cc3c8a21014322ba575b64938628cc"],"layout":"IPY_MODEL_1e03c33076ef4eae839a4b2617415b9c"}},"b0952aa9ee794efc84ba7fd692d54773":{"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_7d6cbf6b52d9426099ac86747336b523","placeholder":"​","style":"IPY_MODEL_2f23fc43a2164d87839d1c97bcbf7647","value":"tokenizer_config.json: 100%"}},"128929b8e6ab48f6a0b2d9b475ddcca3":{"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_c2f0d5c6f9bf46bfbc42dae60279e0ce","max":26,"min":0,"orientation":"horizontal","style":"IPY_MODEL_8ff61244694d4d7bade8391e636f75e9","value":26}},"89cc3c8a21014322ba575b64938628cc":{"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_795be25d17664863a884477e26d35be1","placeholder":"​","style":"IPY_MODEL_b37c39a1522342cabed3b8c233b9e262","value":" 26.0/26.0 [00:00<00:00, 1.22kB/s]"}},"1e03c33076ef4eae839a4b2617415b9c":{"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}},"7d6cbf6b52d9426099ac86747336b523":{"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}},"2f23fc43a2164d87839d1c97bcbf7647":{"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":""}},"c2f0d5c6f9bf46bfbc42dae60279e0ce":{"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}},"8ff61244694d4d7bade8391e636f75e9":{"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":""}},"795be25d17664863a884477e26d35be1":{"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}},"b37c39a1522342cabed3b8c233b9e262":{"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":""}},"35af28baf6b84b569c3532884bf77bde":{"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_5123b8c6a98c47aea6fd644143689c1d","IPY_MODEL_ee102f3e62d44a7ca2c6786f1c203e54","IPY_MODEL_8b96a2f3a0fc44a3b2dee32b9a612528"],"layout":"IPY_MODEL_31d129822f6b4db78311426a0d0639da"}},"5123b8c6a98c47aea6fd644143689c1d":{"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_c00ba1f0724e4123b49051d5ddcba5d1","placeholder":"​","style":"IPY_MODEL_94f51288845c43118232ab566151e760","value":"vocab.json: 100%"}},"ee102f3e62d44a7ca2c6786f1c203e54":{"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_a62adf22c8e3452a8dc24e8bfe346318","max":1042301,"min":0,"orientation":"horizontal","style":"IPY_MODEL_f4b4419668164259aca7735b30acdf65","value":1042301}},"8b96a2f3a0fc44a3b2dee32b9a612528":{"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_79f2dd9928204262af7877b1f83d1a3a","placeholder":"​","style":"IPY_MODEL_08cc2beee8d146e4bd5d9938ac651e20","value":" 1.04M/1.04M [00:00<00:00, 4.19MB/s]"}},"31d129822f6b4db78311426a0d0639da":{"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}},"c00ba1f0724e4123b49051d5ddcba5d1":{"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}},"94f51288845c43118232ab566151e760":{"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":""}},"a62adf22c8e3452a8dc24e8bfe346318":{"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}},"f4b4419668164259aca7735b30acdf65":{"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":""}},"79f2dd9928204262af7877b1f83d1a3a":{"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}},"08cc2beee8d146e4bd5d9938ac651e20":{"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":""}},"217caa874a0243e89888539104bf4100":{"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_b85d5e1ac305434f8bd72b3e55f37bac","IPY_MODEL_706db436f3014e9688daff99c3da5494","IPY_MODEL_f19e26cabee2458ba2d3efcce07a4b1d"],"layout":"IPY_MODEL_e3cda482650344e291b663fd3cf6726d"}},"b85d5e1ac305434f8bd72b3e55f37bac":{"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_836500ca746d4b708c18ebef3a1aa664","placeholder":"​","style":"IPY_MODEL_2a611fb1b5594ec1bf7d3d1a6c93d41e","value":"merges.txt: 100%"}},"706db436f3014e9688daff99c3da5494":{"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_12a10424de354b0c8d9062ab0c887584","max":456318,"min":0,"orientation":"horizontal","style":"IPY_MODEL_422bcbe8a57a4b6e951348508397b46a","value":456318}},"f19e26cabee2458ba2d3efcce07a4b1d":{"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_d6a3f836b0874352826c7b2d3a741902","placeholder":"​","style":"IPY_MODEL_70faa1b775d84dbcb30c7c3ee9625c0b","value":" 456k/456k [00:00<00:00, 2.77MB/s]"}},"e3cda482650344e291b663fd3cf6726d":{"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}},"836500ca746d4b708c18ebef3a1aa664":{"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}},"2a611fb1b5594ec1bf7d3d1a6c93d41e":{"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":""}},"12a10424de354b0c8d9062ab0c887584":{"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}},"422bcbe8a57a4b6e951348508397b46a":{"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":""}},"d6a3f836b0874352826c7b2d3a741902":{"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}},"70faa1b775d84dbcb30c7c3ee9625c0b":{"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":""}},"59f4c2a2c01d4a4d8a5d1c241547bc7e":{"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_23efb9dc5ab643cea126046c75efb8ba","IPY_MODEL_305cc1a3ed624cc0b0e9b42f2b62036d","IPY_MODEL_c8eebe4ac32b4a0ea3cf043215275bb5"],"layout":"IPY_MODEL_48c58a5a80e34b8485f24fc311f4a2b4"}},"23efb9dc5ab643cea126046c75efb8ba":{"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_ec95ccefff344f4ca3cbf8e6927273b6","placeholder":"​","style":"IPY_MODEL_a064cabdd0124fcab6793f977951ee89","value":"tokenizer.json: 100%"}},"305cc1a3ed624cc0b0e9b42f2b62036d":{"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_543ff91d929a4db787ef2edadccbcbbd","max":1355256,"min":0,"orientation":"horizontal","style":"IPY_MODEL_074b4627d3d445c0b76debdcc3e907eb","value":1355256}},"c8eebe4ac32b4a0ea3cf043215275bb5":{"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_d37f50a5dfa64c809f8f5cc5d6c9ff39","placeholder":"​","style":"IPY_MODEL_ff7fdec6eeeb463a9805ac28d446a616","value":" 1.36M/1.36M [00:00<00:00, 15.1MB/s]"}},"48c58a5a80e34b8485f24fc311f4a2b4":{"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}},"ec95ccefff344f4ca3cbf8e6927273b6":{"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}},"a064cabdd0124fcab6793f977951ee89":{"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":""}},"543ff91d929a4db787ef2edadccbcbbd":{"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}},"074b4627d3d445c0b76debdcc3e907eb":{"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":""}},"d37f50a5dfa64c809f8f5cc5d6c9ff39":{"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}},"ff7fdec6eeeb463a9805ac28d446a616":{"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":""}},"40481f50d77b461c840460a1f2713479":{"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_0d4ca03469d74906a50663677abee325","IPY_MODEL_c92bc6a00e1b427aaca69cc25b6ae091","IPY_MODEL_cb425b590c7c4cc88a701f3ab952347c"],"layout":"IPY_MODEL_b3a5ba34b303416fb7e938bd889d1107"}},"0d4ca03469d74906a50663677abee325":{"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_bef4caf86fe74dcf953a7692aecba8a8","placeholder":"​","style":"IPY_MODEL_2458bfa38c3f4e5e87cd087f9c40b432","value":"config.json: 100%"}},"c92bc6a00e1b427aaca69cc25b6ae091":{"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_16e48d1794f74e68a80ef22bca814eb1","max":665,"min":0,"orientation":"horizontal","style":"IPY_MODEL_c44bec565ef04c34a650fe6b63506407","value":665}},"cb425b590c7c4cc88a701f3ab952347c":{"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_6e5346a67df14f7f80847985371d8636","placeholder":"​","style":"IPY_MODEL_a32e47f2d5664a7cb3b94d09bcdbbbc8","value":" 665/665 [00:00<00:00, 51.1kB/s]"}},"b3a5ba34b303416fb7e938bd889d1107":{"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}},"bef4caf86fe74dcf953a7692aecba8a8":{"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}},"2458bfa38c3f4e5e87cd087f9c40b432":{"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":""}},"16e48d1794f74e68a80ef22bca814eb1":{"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}},"c44bec565ef04c34a650fe6b63506407":{"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":""}},"6e5346a67df14f7f80847985371d8636":{"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}},"a32e47f2d5664a7cb3b94d09bcdbbbc8":{"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":""}},"95613ecf14a648979356ebea2f4c3419":{"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_a111fc2b6a4e49fe8bc27f0c23253d34","IPY_MODEL_487472e2fb634c649a0b3e7e04fd0b72","IPY_MODEL_2854f5021fa94fc79ce453871a4c8e01"],"layout":"IPY_MODEL_b43a0f35919e400893f0c5e784218cf5"}},"a111fc2b6a4e49fe8bc27f0c23253d34":{"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_a3242099c0ec44d79f6424de8c539a2a","placeholder":"​","style":"IPY_MODEL_08e1e5899ae84c988d7a98d2dfc265fd","value":"model.safetensors: 100%"}},"487472e2fb634c649a0b3e7e04fd0b72":{"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_c3a0c042331a4f96b5f2e0232c7a416a","max":548105171,"min":0,"orientation":"horizontal","style":"IPY_MODEL_c37cb2bab90c47f8affdf430a9077a1d","value":548105171}},"2854f5021fa94fc79ce453871a4c8e01":{"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_8ac435763ced4f0a8acee7f5af7c7fa2","placeholder":"​","style":"IPY_MODEL_808852998e4349bab5daa40baa5fc0ea","value":" 548M/548M [00:07<00:00, 109MB/s]"}},"b43a0f35919e400893f0c5e784218cf5":{"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}},"a3242099c0ec44d79f6424de8c539a2a":{"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}},"08e1e5899ae84c988d7a98d2dfc265fd":{"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":""}},"c3a0c042331a4f96b5f2e0232c7a416a":{"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}},"c37cb2bab90c47f8affdf430a9077a1d":{"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":""}},"8ac435763ced4f0a8acee7f5af7c7fa2":{"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}},"808852998e4349bab5daa40baa5fc0ea":{"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":""}},"16ce5ef1a36440859494c7848155d093":{"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_21a8159eae2f415b93d5367d3b0b39fa","IPY_MODEL_7a49807f7f884a28afac0219d137af5e","IPY_MODEL_f06dc77326e34340b5b5ab713bf7f912"],"layout":"IPY_MODEL_00e8d83e465e4044b1a8eedab5524e01"}},"21a8159eae2f415b93d5367d3b0b39fa":{"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_7b676cb270684e0d81a06ed056d5386c","placeholder":"​","style":"IPY_MODEL_330b79cef7934aebb5dcf9876ae44afa","value":"generation_config.json: 100%"}},"7a49807f7f884a28afac0219d137af5e":{"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_d783f07b9dc34bfebe06be25ac7ceaf2","max":124,"min":0,"orientation":"horizontal","style":"IPY_MODEL_9510ab2b76694a43984c61fc252a09a9","value":124}},"f06dc77326e34340b5b5ab713bf7f912":{"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_aff3b96310c94656b43e023789f99a8c","placeholder":"​","style":"IPY_MODEL_4c720a44baa44ec49fef3f443529976f","value":" 124/124 [00:00<00:00, 10.7kB/s]"}},"00e8d83e465e4044b1a8eedab5524e01":{"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}},"7b676cb270684e0d81a06ed056d5386c":{"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}},"330b79cef7934aebb5dcf9876ae44afa":{"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":""}},"d783f07b9dc34bfebe06be25ac7ceaf2":{"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}},"9510ab2b76694a43984c61fc252a09a9":{"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":""}},"aff3b96310c94656b43e023789f99a8c":{"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}},"4c720a44baa44ec49fef3f443529976f":{"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":""}}}},"accelerator":"GPU","kaggle":{"accelerator":"nvidiaTeslaT4","dataSources":[{"sourceId":1462296,"sourceType":"datasetVersion","datasetId":857191}],"dockerImageVersionId":31041,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"!pip install pillow","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"hY9Kpn3qs0wH","executionInfo":{"status":"ok","timestamp":1751328237660,"user_tz":-330,"elapsed":12375,"user":{"displayName":"Prabhat Krishna","userId":"16271013469838049178"}},"outputId":"21d94ca9-4f34-4a2b-95e7-9c0a8c86bb0d","trusted":true,"execution":{"iopub.status.busy":"2025-07-01T11:35:45.024960Z","iopub.execute_input":"2025-07-01T11:35:45.025151Z","iopub.status.idle":"2025-07-01T11:35:50.936796Z","shell.execute_reply.started":"2025-07-01T11:35:45.025135Z","shell.execute_reply":"2025-07-01T11:35:50.935885Z"}},"outputs":[{"name":"stdout","text":"Requirement already satisfied: pillow in /usr/local/lib/python3.11/dist-packages (11.1.0)\n","output_type":"stream"}],"execution_count":1},{"cell_type":"code","source":"#colab \n# import kagglehub\n\n# # Download latest version\n# path = kagglehub.dataset_download(\"awsaf49/coco-2017-dataset\")\n\n# print(\"Path to dataset files:\", path)","metadata":{"id":"ZbZ7JDu_s9Un","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1751329198485,"user_tz":-330,"elapsed":960829,"user":{"displayName":"Prabhat Krishna","userId":"16271013469838049178"}},"outputId":"da412b2d-edae-4ea7-c6ab-ccd2f38d0575","trusted":true,"execution":{"iopub.status.busy":"2025-07-01T11:35:50.938761Z","iopub.execute_input":"2025-07-01T11:35:50.939008Z","iopub.status.idle":"2025-07-01T11:35:50.943012Z","shell.execute_reply.started":"2025-07-01T11:35:50.938986Z","shell.execute_reply":"2025-07-01T11:35:50.942240Z"}},"outputs":[],"execution_count":2},{"cell_type":"code","source":"#kaggle\npath = '/kaggle/input/coco-2017-dataset'","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"ad052cc6","executionInfo":{"status":"ok","timestamp":1751329198665,"user_tz":-330,"elapsed":218,"user":{"displayName":"Prabhat Krishna","userId":"16271013469838049178"}},"outputId":"4b19efd1-656e-4562-d2c2-be28cfd8240e","trusted":true,"execution":{"iopub.status.busy":"2025-07-01T11:35:50.943910Z","iopub.execute_input":"2025-07-01T11:35:50.944152Z","iopub.status.idle":"2025-07-01T11:35:50.972748Z","shell.execute_reply.started":"2025-07-01T11:35:50.944131Z","shell.execute_reply":"2025-07-01T11:35:50.972100Z"}},"outputs":[],"execution_count":3},{"cell_type":"code","source":"from torchvision.datasets import CocoCaptions","metadata":{"id":"NNZc58J1KVKz","executionInfo":{"status":"ok","timestamp":1751329210327,"user_tz":-330,"elapsed":11656,"user":{"displayName":"Prabhat Krishna","userId":"16271013469838049178"}},"trusted":true,"execution":{"iopub.status.busy":"2025-07-01T11:35:50.973432Z","iopub.execute_input":"2025-07-01T11:35:50.973765Z","iopub.status.idle":"2025-07-01T11:36:03.489675Z","shell.execute_reply.started":"2025-07-01T11:35:50.973742Z","shell.execute_reply":"2025-07-01T11:36:03.488965Z"}},"outputs":[],"execution_count":4},{"cell_type":"code","source":"import torch\nimport torch.nn as nn\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import transforms\nfrom torchvision.models import resnet152, ResNet152_Weights\nfrom transformers import GPT2Tokenizer, GPT2LMHeadModel\nfrom PIL import Image\nimport json\nimport os\n\n\nCFG = {\n \"image_size\": 224,\n \"max_seq_len\": 64,\n \"embed_size\": 768,\n \"prefix_length\": 10,\n \"batch_size\": 32,\n \"num_epochs\": 40,\n \"learning_rate\": 1e-4\n}\n\ntokenizer = GPT2Tokenizer.from_pretrained('gpt2')\ntokenizer.pad_token = tokenizer.eos_token","metadata":{"id":"grR58mY6Jk03","executionInfo":{"status":"ok","timestamp":1751329225168,"user_tz":-330,"elapsed":14834,"user":{"displayName":"Prabhat Krishna","userId":"16271013469838049178"}},"colab":{"base_uri":"https://localhost:8080/","height":177,"referenced_widgets":["3edb71371fbc4961a065fbd7a6ba4c31","b0952aa9ee794efc84ba7fd692d54773","128929b8e6ab48f6a0b2d9b475ddcca3","89cc3c8a21014322ba575b64938628cc","1e03c33076ef4eae839a4b2617415b9c","7d6cbf6b52d9426099ac86747336b523","2f23fc43a2164d87839d1c97bcbf7647","c2f0d5c6f9bf46bfbc42dae60279e0ce","8ff61244694d4d7bade8391e636f75e9","795be25d17664863a884477e26d35be1","b37c39a1522342cabed3b8c233b9e262","35af28baf6b84b569c3532884bf77bde","5123b8c6a98c47aea6fd644143689c1d","ee102f3e62d44a7ca2c6786f1c203e54","8b96a2f3a0fc44a3b2dee32b9a612528","31d129822f6b4db78311426a0d0639da","c00ba1f0724e4123b49051d5ddcba5d1","94f51288845c43118232ab566151e760","a62adf22c8e3452a8dc24e8bfe346318","f4b4419668164259aca7735b30acdf65","79f2dd9928204262af7877b1f83d1a3a","08cc2beee8d146e4bd5d9938ac651e20","217caa874a0243e89888539104bf4100","b85d5e1ac305434f8bd72b3e55f37bac","706db436f3014e9688daff99c3da5494","f19e26cabee2458ba2d3efcce07a4b1d","e3cda482650344e291b663fd3cf6726d","836500ca746d4b708c18ebef3a1aa664","2a611fb1b5594ec1bf7d3d1a6c93d41e","12a10424de354b0c8d9062ab0c887584","422bcbe8a57a4b6e951348508397b46a","d6a3f836b0874352826c7b2d3a741902","70faa1b775d84dbcb30c7c3ee9625c0b","59f4c2a2c01d4a4d8a5d1c241547bc7e","23efb9dc5ab643cea126046c75efb8ba","305cc1a3ed624cc0b0e9b42f2b62036d","c8eebe4ac32b4a0ea3cf043215275bb5","48c58a5a80e34b8485f24fc311f4a2b4","ec95ccefff344f4ca3cbf8e6927273b6","a064cabdd0124fcab6793f977951ee89","543ff91d929a4db787ef2edadccbcbbd","074b4627d3d445c0b76debdcc3e907eb","d37f50a5dfa64c809f8f5cc5d6c9ff39","ff7fdec6eeeb463a9805ac28d446a616","40481f50d77b461c840460a1f2713479","0d4ca03469d74906a50663677abee325","c92bc6a00e1b427aaca69cc25b6ae091","cb425b590c7c4cc88a701f3ab952347c","b3a5ba34b303416fb7e938bd889d1107","bef4caf86fe74dcf953a7692aecba8a8","2458bfa38c3f4e5e87cd087f9c40b432","16e48d1794f74e68a80ef22bca814eb1","c44bec565ef04c34a650fe6b63506407","6e5346a67df14f7f80847985371d8636","a32e47f2d5664a7cb3b94d09bcdbbbc8"]},"outputId":"a154d800-8c91-4fb8-8857-91a485940414","trusted":true,"execution":{"iopub.status.busy":"2025-07-01T14:05:08.949182Z","iopub.execute_input":"2025-07-01T14:05:08.949646Z","iopub.status.idle":"2025-07-01T14:05:09.126653Z","shell.execute_reply.started":"2025-07-01T14:05:08.949621Z","shell.execute_reply":"2025-07-01T14:05:09.125830Z"}},"outputs":[],"execution_count":67},{"cell_type":"code","source":"# Dataset Class\nclass CocoDataset(Dataset):\n def __init__(self, image_dir, ann_path, tokenizer, transform=None, subset_size=None):\n with open(ann_path) as f:\n annotations = json.load(f)['annotations']\n # Load a subset of annotations if subset_size is specified\n if subset_size is not None:\n self.annotations = annotations[:subset_size]\n else:\n self.annotations = annotations\n\n self.image_dir = image_dir\n self.tokenizer = tokenizer\n self.transform = transform\n\n def __len__(self):\n return len(self.annotations)\n\n def __getitem__(self, idx):\n ann = self.annotations[idx]\n image_id_str = str(ann['image_id']).zfill(12)\n image_path = os.path.join(self.image_dir, image_id_str + '.jpg')\n image = Image.open(image_path).convert('RGB')\n\n if self.transform:\n image = self.transform(image)\n\n caption = ann['caption']\n inputs = self.tokenizer(\n caption,\n max_length=CFG['max_seq_len'],\n padding='max_length',\n truncation=True,\n return_tensors='pt'\n )\n\n return image, inputs.input_ids.squeeze(0), inputs.attention_mask.squeeze(0)","metadata":{"id":"zAoGWeraJlHF","executionInfo":{"status":"ok","timestamp":1751329225192,"user_tz":-330,"elapsed":21,"user":{"displayName":"Prabhat Krishna","userId":"16271013469838049178"}},"trusted":true,"execution":{"iopub.status.busy":"2025-07-01T14:05:09.127841Z","iopub.execute_input":"2025-07-01T14:05:09.128101Z","iopub.status.idle":"2025-07-01T14:05:09.134484Z","shell.execute_reply.started":"2025-07-01T14:05:09.128084Z","shell.execute_reply":"2025-07-01T14:05:09.133808Z"}},"outputs":[],"execution_count":68},{"cell_type":"code","source":"class ImageCaptionModel(nn.Module):\n def __init__(self, prefix_length=10):\n super().__init__()\n self.prefix_length = prefix_length\n self.cnn = nn.Sequential(*list(resnet152(weights=ResNet152_Weights.IMAGENET1K_V2).children())[:-1])\n for param in self.cnn.parameters():\n param.requires_grad = False\n\n # Project 2048-d image features to a sequence of embeddings\n self.projection = nn.Sequential(\n nn.Linear(2048, 768 * prefix_length),\n nn.ReLU(),\n )\n\n self.llm = GPT2LMHeadModel.from_pretrained('gpt2')\n self.llm.resize_token_embeddings(len(tokenizer))\n\n def forward(self, images, input_ids, attention_mask):\n with torch.no_grad():\n features = self.cnn(images).view(images.size(0), -1)\n\n # Project to sequence of embeddings\n img_seq = self.projection(features) # (B, 768 * prefix_len)\n img_seq = img_seq.view(-1, self.prefix_length, 768) # (B, prefix_len, 768)\n\n # Text embeddings (excluding last token for training)\n txt_embeds = self.llm.transformer.wte(input_ids[:, :-1]) # (B, T-1, 768)\n\n # Concatenate: [image embeddings | text embeddings]\n inputs_embeds = torch.cat([img_seq, txt_embeds], dim=1)\n\n # Adjust attention mask\n prefix_mask = torch.ones(input_ids.size(0), self.prefix_length).to(images.device)\n attention_mask = torch.cat([prefix_mask, attention_mask[:, :-1]], dim=1)\n\n # Forward\n outputs = self.llm(\n inputs_embeds=inputs_embeds,\n attention_mask=attention_mask\n )\n\n return outputs.logits\n","metadata":{"id":"emzjWXyDs5u-","executionInfo":{"status":"ok","timestamp":1751329225240,"user_tz":-330,"elapsed":46,"user":{"displayName":"Prabhat Krishna","userId":"16271013469838049178"}},"trusted":true,"execution":{"iopub.status.busy":"2025-07-01T14:05:09.239344Z","iopub.execute_input":"2025-07-01T14:05:09.240077Z","iopub.status.idle":"2025-07-01T14:05:09.246863Z","shell.execute_reply.started":"2025-07-01T14:05:09.240051Z","shell.execute_reply":"2025-07-01T14:05:09.246161Z"}},"outputs":[],"execution_count":69},{"cell_type":"code","source":"\n# Training Setup\ndef train():\n # Transforms\n transform = transforms.Compose([\n transforms.Resize((CFG['image_size'], CFG['image_size'])),\n transforms.ToTensor(),\n transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])\n ])\n\n # Tokenizer\n tokenizer = GPT2Tokenizer.from_pretrained('gpt2')\n tokenizer.pad_token = tokenizer.eos_token\n\n # Dataset & Loader\n # Using CocoDataset with a subset size of 8000\n dataset = CocoDataset(\n image_dir=f'{path}/coco2017/train2017',\n ann_path=f'{path}/coco2017/annotations/captions_train2017.json',\n tokenizer=tokenizer,\n transform=transform,\n subset_size=8000 # Load only 8000 entries\n )\n loader = DataLoader(dataset, batch_size=CFG['batch_size'], shuffle=True)\n\n # Model\n model = ImageCaptionModel().cuda()\n optimizer = torch.optim.Adam(model.parameters(), lr=CFG['learning_rate'])\n criterion = nn.CrossEntropyLoss(ignore_index=tokenizer.pad_token_id)\n \n for epoch in range(CFG['num_epochs']):\n model.train()\n for images, input_ids, attn_mask in loader:\n images = images.cuda()\n input_ids = input_ids.cuda()\n attn_mask = attn_mask.cuda()\n \n optimizer.zero_grad()\n logits = model(images, input_ids, attn_mask)\n \n # Shift logits and labels\n logits = logits[:, model.prefix_length:, :] # Ignore prefix outputs\n labels = input_ids[:, 1:] # Shift labels for teacher forcing\n \n loss = criterion(logits.reshape(-1, logits.size(-1)), labels.reshape(-1))\n loss.backward()\n optimizer.step()\n \n \n\n print(f\"Epoch: {epoch+1}, Loss: {loss.item():.4f}\")\n save_path = \"/kaggle/working/clip_caption_model.pth\"\n torch.save(model.state_dict(), save_path)\n print(f\"Model saved to {save_path}\")\n ","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-07-01T14:05:09.367611Z","iopub.execute_input":"2025-07-01T14:05:09.367804Z","iopub.status.idle":"2025-07-01T14:05:09.374635Z","shell.execute_reply.started":"2025-07-01T14:05:09.367774Z","shell.execute_reply":"2025-07-01T14:05:09.373930Z"}},"outputs":[],"execution_count":70},{"cell_type":"code","source":"\n# Usage\nif __name__ == \"__main__\":\n # Train the model\n train()\n","metadata":{"id":"wx4VQcvDs7BH","executionInfo":{"status":"error","timestamp":1751329239297,"user_tz":-330,"elapsed":14055,"user":{"displayName":"Prabhat Krishna","userId":"16271013469838049178"}},"outputId":"bed242f4-95b3-4462-8b07-8863a5b8cd6b","colab":{"base_uri":"https://localhost:8080/","height":472,"referenced_widgets":["95613ecf14a648979356ebea2f4c3419","a111fc2b6a4e49fe8bc27f0c23253d34","487472e2fb634c649a0b3e7e04fd0b72","2854f5021fa94fc79ce453871a4c8e01","b43a0f35919e400893f0c5e784218cf5","a3242099c0ec44d79f6424de8c539a2a","08e1e5899ae84c988d7a98d2dfc265fd","c3a0c042331a4f96b5f2e0232c7a416a","c37cb2bab90c47f8affdf430a9077a1d","8ac435763ced4f0a8acee7f5af7c7fa2","808852998e4349bab5daa40baa5fc0ea","16ce5ef1a36440859494c7848155d093","21a8159eae2f415b93d5367d3b0b39fa","7a49807f7f884a28afac0219d137af5e","f06dc77326e34340b5b5ab713bf7f912","00e8d83e465e4044b1a8eedab5524e01","7b676cb270684e0d81a06ed056d5386c","330b79cef7934aebb5dcf9876ae44afa","d783f07b9dc34bfebe06be25ac7ceaf2","9510ab2b76694a43984c61fc252a09a9","aff3b96310c94656b43e023789f99a8c","4c720a44baa44ec49fef3f443529976f"]},"trusted":true,"execution":{"iopub.status.busy":"2025-07-01T14:05:09.528231Z","iopub.execute_input":"2025-07-01T14:05:09.528425Z","iopub.status.idle":"2025-07-01T16:37:11.225228Z","shell.execute_reply.started":"2025-07-01T14:05:09.528411Z","shell.execute_reply":"2025-07-01T16:37:11.224549Z"}},"outputs":[{"name":"stdout","text":"Epoch: 1, Loss: 2.7203\nEpoch: 2, Loss: 2.5815\nEpoch: 3, Loss: 2.1797\nEpoch: 4, Loss: 2.2764\nEpoch: 5, Loss: 1.8374\nEpoch: 6, Loss: 1.5654\nEpoch: 7, Loss: 1.4040\nEpoch: 8, Loss: 1.3104\nEpoch: 9, Loss: 1.0020\nEpoch: 10, Loss: 0.9107\nEpoch: 11, Loss: 0.7906\nEpoch: 12, Loss: 0.7477\nEpoch: 13, Loss: 0.6430\nEpoch: 14, Loss: 0.5511\nEpoch: 15, Loss: 0.5291\nEpoch: 16, Loss: 0.6169\nEpoch: 17, Loss: 0.6268\nEpoch: 18, Loss: 0.5461\nEpoch: 19, Loss: 0.4207\nEpoch: 20, Loss: 0.3933\nEpoch: 21, Loss: 0.3791\nEpoch: 22, Loss: 0.3602\nEpoch: 23, Loss: 0.3226\nEpoch: 24, Loss: 0.2650\nEpoch: 25, Loss: 0.3203\nEpoch: 26, Loss: 0.3200\nEpoch: 27, Loss: 0.3070\nEpoch: 28, Loss: 0.2853\nEpoch: 29, Loss: 0.2931\nEpoch: 30, Loss: 0.3709\nEpoch: 31, Loss: 0.2857\nEpoch: 32, Loss: 0.2847\nEpoch: 33, Loss: 0.3104\nEpoch: 34, Loss: 0.2917\nEpoch: 35, Loss: 0.2460\nEpoch: 36, Loss: 0.2131\nEpoch: 37, Loss: 0.2229\nEpoch: 38, Loss: 0.2643\nEpoch: 39, Loss: 0.2817\nEpoch: 40, Loss: 0.2538\nModel saved to /kaggle/working/clip_caption_model.pth\n","output_type":"stream"}],"execution_count":71},{"cell_type":"code","source":"\n# Inference\ndef generate_caption(image_path, model, tokenizer, device='cuda'):\n transform = transforms.Compose([\n transforms.Resize((CFG['image_size'], CFG['image_size'])),\n transforms.ToTensor(),\n transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])\n ])\n\n image = Image.open(image_path).convert('RGB')\n image = transform(image).unsqueeze(0).to(device)\n\n with torch.no_grad():\n features = model.cnn(image)\n features = features.view(features.size(0), -1)\n img_embed = model.projection(features).unsqueeze(1)\n\n generated = model.llm.generate(\n inputs_embeds=img_embed,\n max_length=CFG['max_seq_len'],\n num_beams=5,\n early_stopping=True,\n pad_token_id=tokenizer.pad_token_id\n )\n\n return tokenizer.decode(generated[0], skip_special_tokens=True)\n","metadata":{"id":"q44sG8LdkoMg","executionInfo":{"status":"aborted","timestamp":1751329239379,"user_tz":-330,"elapsed":69,"user":{"displayName":"Prabhat Krishna","userId":"16271013469838049178"}},"trusted":true,"execution":{"iopub.status.busy":"2025-07-01T16:37:11.226678Z","iopub.execute_input":"2025-07-01T16:37:11.226923Z","iopub.status.idle":"2025-07-01T16:37:11.232539Z","shell.execute_reply.started":"2025-07-01T16:37:11.226906Z","shell.execute_reply":"2025-07-01T16:37:11.231859Z"}},"outputs":[],"execution_count":72},{"cell_type":"code","source":"import requests\n\n# URL of the image\nurl = \"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRQrNtVwHLPW2MKg7qW4mkom5RN9HdfHgCgMw&s\"\n# Path to save the image\nsave_path = \"/kaggle/working/downloaded_image.jpg\"\n\n# Download and save the image\nresponse = requests.get(url)\nif response.status_code == 200:\n with open(save_path, \"wb\") as f:\n f.write(response.content)\n print(f\"Image saved to {save_path}\")\nelse:\n print(f\"Failed to download image. Status code: {response.status_code}\")\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-07-01T16:37:11.233268Z","iopub.execute_input":"2025-07-01T16:37:11.233500Z","iopub.status.idle":"2025-07-01T16:37:11.286545Z","shell.execute_reply.started":"2025-07-01T16:37:11.233481Z","shell.execute_reply":"2025-07-01T16:37:11.286028Z"}},"outputs":[{"name":"stdout","text":"Image saved to /kaggle/working/downloaded_image.jpg\n","output_type":"stream"}],"execution_count":73},{"cell_type":"code","source":"def generate_caption(image_path, model, tokenizer, device='cuda'):\n transform = transforms.Compose([\n transforms.Resize((CFG['image_size'], CFG['image_size'])),\n transforms.ToTensor(),\n transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])\n ])\n\n image = Image.open(image_path).convert('RGB')\n image = transform(image).unsqueeze(0).to(device)\n\n with torch.no_grad():\n features = model.cnn(image)\n features = features.view(features.size(0), -1)\n img_embed = model.projection(features).unsqueeze(1)\n\n # Add prompt tokens\n prompt = \"A photo of\"\n prompt_ids = tokenizer(prompt, return_tensors='pt').input_ids.to(device)\n prompt_embeds = model.llm.transformer.wte(prompt_ids)\n\n inputs_embeds = torch.cat([img_embed, prompt_embeds], dim=1)\n attention_mask = torch.ones(inputs_embeds.shape[:-1], dtype=torch.long).to(device)\n\n # Sampling-based generation\n generated = model.llm.generate(\n inputs_embeds=inputs_embeds,\n attention_mask=attention_mask,\n max_length=CFG['max_seq_len'],\n do_sample=True,\n top_k=50,\n top_p=0.95,\n temperature=1.0,\n pad_token_id=tokenizer.pad_token_id\n )\n\n return tokenizer.decode(generated[0], skip_special_tokens=True)\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-07-01T13:59:55.011149Z","iopub.execute_input":"2025-07-01T13:59:55.011430Z","iopub.status.idle":"2025-07-01T13:59:55.019286Z","shell.execute_reply.started":"2025-07-01T13:59:55.011410Z","shell.execute_reply":"2025-07-01T13:59:55.018345Z"}},"outputs":[],"execution_count":60},{"cell_type":"code","source":"\n # Example inference\n tokenizer = GPT2Tokenizer.from_pretrained('gpt2')\n model = ImageCaptionModel().cuda().eval()\n caption = generate_caption(save_path, model, tokenizer)\n print(f\"Generated Caption: {caption}\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-07-01T16:49:56.085807Z","iopub.execute_input":"2025-07-01T16:49:56.086520Z","iopub.status.idle":"2025-07-01T16:49:58.355463Z","shell.execute_reply.started":"2025-07-01T16:49:56.086498Z","shell.execute_reply":"2025-07-01T16:49:58.354869Z"}},"outputs":[{"name":"stderr","text":"Setting `pad_token_id` to `eos_token_id`:50256 for open-end generation.\n","output_type":"stream"},{"name":"stdout","text":"Generated Caption: \n\nI, the man, the man, the man, the man, the man, the man, the man, the man, the man, the man, the man, the man, the man, the man, the man, the man, the man\n","output_type":"stream"}],"execution_count":80},{"cell_type":"code","source":"from transformers import BlipProcessor, BlipForConditionalGeneration\nfrom PIL import Image\nimport requests\nimport torch\n\n# Load model\nprocessor = BlipProcessor.from_pretrained(\"Salesforce/blip-image-captioning-base\")\nmodel = BlipForConditionalGeneration.from_pretrained(\"Salesforce/blip-image-captioning-base\").to(\"cuda\")\n\n# Load image\nimg = Image.open(\"/kaggle/working/downloaded_image.jpg\").convert('RGB')\n\n# Preprocess\ninputs = processor(img, return_tensors=\"pt\").to(\"cuda\")\n\n# Generate caption\nout = model.generate(**inputs, max_new_tokens=64)\ncaption = processor.decode(out[0], skip_special_tokens=True)\nprint(\"BLIP Caption:\", caption)\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-07-01T16:50:01.378301Z","iopub.execute_input":"2025-07-01T16:50:01.378562Z","iopub.status.idle":"2025-07-01T16:50:03.084710Z","shell.execute_reply.started":"2025-07-01T16:50:01.378543Z","shell.execute_reply":"2025-07-01T16:50:03.084108Z"}},"outputs":[{"name":"stdout","text":"BLIP Caption: a small dog wearing a red sweater running through the grass\n","output_type":"stream"}],"execution_count":81},{"cell_type":"code","source":"def generate_caption(image_path, model, tokenizer, device='cuda'):\n transform = transforms.Compose([\n transforms.Resize((CFG['image_size'], CFG['image_size'])),\n transforms.ToTensor(),\n transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])\n ])\n\n image = Image.open(image_path).convert('RGB')\n image = transform(image).unsqueeze(0).to(device)\n\n with torch.no_grad():\n features = model.cnn(image).view(1, -1)\n img_seq = model.projection(features).view(1, model.prefix_length, 768)\n\n # Generate from image embeddings only\n attention_mask = torch.ones((1, model.prefix_length), device=device)\n\n generated = model.llm.generate(\n inputs_embeds=img_seq,\n attention_mask=attention_mask,\n max_length=CFG['max_seq_len'],\n do_sample=True,\n top_k=50,\n top_p=0.95,\n temperature=1.0,\n pad_token_id=tokenizer.pad_token_id\n )\n\n return tokenizer.decode(generated[0], skip_special_tokens=True)\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-07-01T16:49:27.197224Z","iopub.execute_input":"2025-07-01T16:49:27.197506Z","iopub.status.idle":"2025-07-01T16:49:27.203748Z","shell.execute_reply.started":"2025-07-01T16:49:27.197486Z","shell.execute_reply":"2025-07-01T16:49:27.203054Z"}},"outputs":[],"execution_count":74},{"cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}