Skip to content

Instantly share code, notes, and snippets.

@jiweiqi
Created November 29, 2023 04:26
Show Gist options
  • Save jiweiqi/3b4c11ace0af7fd6c57a5d35157b42de to your computer and use it in GitHub Desktop.
Save jiweiqi/3b4c11ace0af7fd6c57a5d35157b42de to your computer and use it in GitHub Desktop.
fine_tune_phi_1_5_alpaca_gpt4.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"toc_visible": true,
"gpuType": "T4",
"authorship_tag": "ABX9TyOq827eXvLZpeDGaErPYUAV",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"accelerator": "GPU",
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"fd65597127a54aa1a61cabb68c60e644": {
"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_7df6e1b7821944979c4384110a256f66",
"IPY_MODEL_514cc1baf31a4849ae2cfe8a40f0e17e",
"IPY_MODEL_1d3d21e6860c4ffda43597cfb7d66c9e"
],
"layout": "IPY_MODEL_14faacc6dbab40bc9417a5024f0f8773"
}
},
"7df6e1b7821944979c4384110a256f66": {
"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_619ac2c66257494aaef83c545039e7f4",
"placeholder": "​",
"style": "IPY_MODEL_5bf9b4de97c1428a9703abd2727db2cf",
"value": "config.json: 100%"
}
},
"514cc1baf31a4849ae2cfe8a40f0e17e": {
"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_2a8e1ac5e9a64f7da319cbd21acd11d9",
"max": 727,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_59c6ca4638754be587c072b166c08613",
"value": 727
}
},
"1d3d21e6860c4ffda43597cfb7d66c9e": {
"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_870caabe4dd540bfabfb2b49902ba219",
"placeholder": "​",
"style": "IPY_MODEL_5b238a83d5194aa1b36ffc856f564554",
"value": " 727/727 [00:00<00:00, 26.8kB/s]"
}
},
"14faacc6dbab40bc9417a5024f0f8773": {
"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
}
},
"619ac2c66257494aaef83c545039e7f4": {
"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
}
},
"5bf9b4de97c1428a9703abd2727db2cf": {
"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": ""
}
},
"2a8e1ac5e9a64f7da319cbd21acd11d9": {
"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
}
},
"59c6ca4638754be587c072b166c08613": {
"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": ""
}
},
"870caabe4dd540bfabfb2b49902ba219": {
"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
}
},
"5b238a83d5194aa1b36ffc856f564554": {
"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": ""
}
},
"12fcf5aa90844527b58de0cb9a9bf3ba": {
"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_053a2c6920bf4d4f95b60a75d7f2e32b",
"IPY_MODEL_98b52c4709f2486991c566d862407df1",
"IPY_MODEL_9e237fbada2840ab911348bf7178434a"
],
"layout": "IPY_MODEL_9d7e0e8b97d74898816ab920a9113104"
}
},
"053a2c6920bf4d4f95b60a75d7f2e32b": {
"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_a77c9ab7989145c2a62f6765edbd1956",
"placeholder": "​",
"style": "IPY_MODEL_24fef4c7bd764f669a4e24c3356f6b1f",
"value": "configuration_phi.py: 100%"
}
},
"98b52c4709f2486991c566d862407df1": {
"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_627f2e291f4a427e8bba65a89d73e486",
"max": 2027,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_0e076ecbb5db4c53a495c6c453314355",
"value": 2027
}
},
"9e237fbada2840ab911348bf7178434a": {
"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_4cb510baae4541feaa3ec5ec161252de",
"placeholder": "​",
"style": "IPY_MODEL_c346dbacafea474f8cb2199040b2a9c2",
"value": " 2.03k/2.03k [00:00<00:00, 47.0kB/s]"
}
},
"9d7e0e8b97d74898816ab920a9113104": {
"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
}
},
"a77c9ab7989145c2a62f6765edbd1956": {
"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
}
},
"24fef4c7bd764f669a4e24c3356f6b1f": {
"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": ""
}
},
"627f2e291f4a427e8bba65a89d73e486": {
"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
}
},
"0e076ecbb5db4c53a495c6c453314355": {
"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": ""
}
},
"4cb510baae4541feaa3ec5ec161252de": {
"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
}
},
"c346dbacafea474f8cb2199040b2a9c2": {
"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": ""
}
},
"8c416a307b5b4d5e846cb5f4254cbc60": {
"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_102ec7185aaf446580ef44ad7eb677d8",
"IPY_MODEL_cad93156464848a2ba559d0e0e611396",
"IPY_MODEL_08bd0fd8965949e6bee4ac0afbb1bcaf"
],
"layout": "IPY_MODEL_385319a5118444328c7aea36c9316291"
}
},
"102ec7185aaf446580ef44ad7eb677d8": {
"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_0efdb8f99105435b8300a0b226551f0d",
"placeholder": "​",
"style": "IPY_MODEL_d34bad8161f44dae9391eb08dd48f152",
"value": "modeling_phi.py: 100%"
}
},
"cad93156464848a2ba559d0e0e611396": {
"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_c90f010a430e477fbaf6fe90584aa1f0",
"max": 33798,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_db639a2a8bba48d3a5d17e13dc07c983",
"value": 33798
}
},
"08bd0fd8965949e6bee4ac0afbb1bcaf": {
"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_d2e375d2c3484cc5b0c9bb41bb7984d5",
"placeholder": "​",
"style": "IPY_MODEL_1c987c53a2874f5599c70346446ef989",
"value": " 33.8k/33.8k [00:00<00:00, 1.73MB/s]"
}
},
"385319a5118444328c7aea36c9316291": {
"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
}
},
"0efdb8f99105435b8300a0b226551f0d": {
"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
}
},
"d34bad8161f44dae9391eb08dd48f152": {
"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": ""
}
},
"c90f010a430e477fbaf6fe90584aa1f0": {
"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
}
},
"db639a2a8bba48d3a5d17e13dc07c983": {
"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": ""
}
},
"d2e375d2c3484cc5b0c9bb41bb7984d5": {
"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
}
},
"1c987c53a2874f5599c70346446ef989": {
"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": ""
}
},
"14abb96a06164ba5aa958b16cfb893f6": {
"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_967c7fac5d834d538580ebec32e8517c",
"IPY_MODEL_6303e6c56a5540929181a974910baf59",
"IPY_MODEL_bf79a0199cd34a40ae4bb7e09edb93bc"
],
"layout": "IPY_MODEL_c5e7ebecbb0c4d1eb037e92f279a30b0"
}
},
"967c7fac5d834d538580ebec32e8517c": {
"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_39df43337e1546dfa0e78cfaabbe5a1f",
"placeholder": "​",
"style": "IPY_MODEL_01af2d38d72c482687c4731f592149ab",
"value": "pytorch_model.bin: 100%"
}
},
"6303e6c56a5540929181a974910baf59": {
"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_9a507017463b4a89af715d62d5d421ae",
"max": 2836621662,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_dfabf9ece16640fa9e193739323dc631",
"value": 2836621662
}
},
"bf79a0199cd34a40ae4bb7e09edb93bc": {
"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_b5382171e60c46068e3366cab2022255",
"placeholder": "​",
"style": "IPY_MODEL_3d6c776d06164705bb7c153518002ffe",
"value": " 2.84G/2.84G [00:20<00:00, 203MB/s]"
}
},
"c5e7ebecbb0c4d1eb037e92f279a30b0": {
"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
}
},
"39df43337e1546dfa0e78cfaabbe5a1f": {
"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
}
},
"01af2d38d72c482687c4731f592149ab": {
"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": ""
}
},
"9a507017463b4a89af715d62d5d421ae": {
"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
}
},
"dfabf9ece16640fa9e193739323dc631": {
"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": ""
}
},
"b5382171e60c46068e3366cab2022255": {
"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
}
},
"3d6c776d06164705bb7c153518002ffe": {
"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": ""
}
},
"1b778b5c50ce40bdaf81f3818d9af68e": {
"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_5cb4c561239a4dcda9ab990e606a1889",
"IPY_MODEL_cc6c84fa84db4d18b858aca346ec984f",
"IPY_MODEL_62f802ce4305462c9046f29b9c8111b7"
],
"layout": "IPY_MODEL_ad4288c089f043398f0c658b6b82561c"
}
},
"5cb4c561239a4dcda9ab990e606a1889": {
"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_56349ee81e964b11b1ddfc6e3cb5104a",
"placeholder": "​",
"style": "IPY_MODEL_6c8f75e993f54efda954d1954be921cb",
"value": "generation_config.json: 100%"
}
},
"cc6c84fa84db4d18b858aca346ec984f": {
"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_b734711023634337a4356ddb4d2a29a3",
"max": 69,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_d87ac3e4851d461fa3db88c0cb22219b",
"value": 69
}
},
"62f802ce4305462c9046f29b9c8111b7": {
"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_4b00abf8bc5c4bb8ae204af550607b70",
"placeholder": "​",
"style": "IPY_MODEL_b1b60dcefdd64a4b85dfd0047921e137",
"value": " 69.0/69.0 [00:00<00:00, 1.91kB/s]"
}
},
"ad4288c089f043398f0c658b6b82561c": {
"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
}
},
"56349ee81e964b11b1ddfc6e3cb5104a": {
"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
}
},
"6c8f75e993f54efda954d1954be921cb": {
"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": ""
}
},
"b734711023634337a4356ddb4d2a29a3": {
"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
}
},
"d87ac3e4851d461fa3db88c0cb22219b": {
"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": ""
}
},
"4b00abf8bc5c4bb8ae204af550607b70": {
"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
}
},
"b1b60dcefdd64a4b85dfd0047921e137": {
"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": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/jiweiqi/3b4c11ace0af7fd6c57a5d35157b42de/fine_tune_phi_1_5_alpaca_gpt4.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "7_ZvtuoZkFfS",
"outputId": "eec650a3-4b98-48cd-f2d8-7aad37a12819"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Requirement already satisfied: einops in /usr/local/lib/python3.10/dist-packages (0.7.0)\n"
]
}
],
"source": [
"!pip install -q transformers bitsandbytes peft trl accelerate xformers wandb datasets\n",
"!pip install einops"
]
},
{
"cell_type": "code",
"source": [
"#importing library\n",
"import torch, os, wandb\n",
"from datasets import load_dataset, Dataset\n",
"from transformers import AutoModelForCausalLM, AutoTokenizer, TrainingArguments, Trainer, DataCollatorForLanguageModeling, BitsAndBytesConfig, TextStreamer\n",
"from peft import LoraConfig, get_peft_model, PeftModel"
],
"metadata": {
"id": "yPYL3EVSkjF-"
},
"execution_count": 2,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"## Load dataset.\n",
"\n",
"For simplicity, try arount 100 samples"
],
"metadata": {
"id": "sZpKCNlyFuIo"
}
},
{
"cell_type": "code",
"source": [
"train_ds = load_dataset(\"vicgalle/alpaca-gpt4\", split=\"train[:100]\")\n",
"train_ds"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "n9f9-afpkaOA",
"outputId": "38666d4d-eb93-44cd-fa6d-b36bd5402364"
},
"execution_count": 3,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"Dataset({\n",
" features: ['instruction', 'input', 'output', 'text'],\n",
" num_rows: 100\n",
"})"
]
},
"metadata": {},
"execution_count": 3
}
]
},
{
"cell_type": "code",
"source": [
"test_ds = load_dataset(\"vicgalle/alpaca-gpt4\", split=\"train[100:150]\")\n",
"test_ds"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Uq50kKXYvCxq",
"outputId": "77515ee3-ee91-429c-993b-75a0ee0d8710"
},
"execution_count": 4,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"Dataset({\n",
" features: ['instruction', 'input', 'output', 'text'],\n",
" num_rows: 50\n",
"})"
]
},
"metadata": {},
"execution_count": 4
}
]
},
{
"cell_type": "markdown",
"source": [
"## Assess base model\n",
"\n",
"for comparision with finetuned model. Due to GPU memory constraints, the base model will be overrided later.\n",
"\n",
"Observation: the base model tries to response with a python code, as the base model was (fine-tuned) to do code generation."
],
"metadata": {
"id": "oz4d-vqEJBEW"
}
},
{
"cell_type": "code",
"source": [
"#loading the model and tokenizer. Use quantilization due to GPU memory limitation.\n",
"base_model = \"microsoft/phi-1_5\"\n",
"ft_model = \"jiweiqi10/phi-1.5-alpaca-gpt4\""
],
"metadata": {
"id": "0E5wHfepFnig"
},
"execution_count": 5,
"outputs": []
},
{
"cell_type": "code",
"source": [
"#Testing the trained model\n",
"def phi_stream(model, tokenizer, prompt):\n",
" runtimeFlag = \"cuda:0\"\n",
" inputs = tokenizer(f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.\\n\\n### Instruction:\\n{prompt}.\\n\\n### Response:\\n ''', return_tensors=\"pt\", return_attention_mask=False).to(runtimeFlag)\n",
" streamer = TextStreamer(tokenizer, skip_prompt= False)\n",
" _ = model.generate(**inputs, streamer=streamer, max_new_tokens=500)"
],
"metadata": {
"id": "_r97oGFfMVZZ"
},
"execution_count": 15,
"outputs": []
},
{
"cell_type": "code",
"source": [
"#Tokenzing the dataset\n",
"tokenizer = AutoTokenizer.from_pretrained(base_model, trust_remote_code=True)\n",
"tokenizer.pad_token = tokenizer.eos_token"
],
"metadata": {
"id": "a7UCgPzcGnGt"
},
"execution_count": 6,
"outputs": []
},
{
"cell_type": "code",
"source": [
"# first load original model for evaluation, and then quatilized model for finetuning\n",
"model = AutoModelForCausalLM.from_pretrained(\n",
" base_model, device_map={\"\":0},\n",
" # quantization_config= bitsandbytes,\n",
" trust_remote_code= True\n",
")\n",
"# GPU mem usage 8.6 Gb\n",
"model.config.use_cache = True\n",
"model.eval()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 965,
"referenced_widgets": [
"fd65597127a54aa1a61cabb68c60e644",
"7df6e1b7821944979c4384110a256f66",
"514cc1baf31a4849ae2cfe8a40f0e17e",
"1d3d21e6860c4ffda43597cfb7d66c9e",
"14faacc6dbab40bc9417a5024f0f8773",
"619ac2c66257494aaef83c545039e7f4",
"5bf9b4de97c1428a9703abd2727db2cf",
"2a8e1ac5e9a64f7da319cbd21acd11d9",
"59c6ca4638754be587c072b166c08613",
"870caabe4dd540bfabfb2b49902ba219",
"5b238a83d5194aa1b36ffc856f564554",
"12fcf5aa90844527b58de0cb9a9bf3ba",
"053a2c6920bf4d4f95b60a75d7f2e32b",
"98b52c4709f2486991c566d862407df1",
"9e237fbada2840ab911348bf7178434a",
"9d7e0e8b97d74898816ab920a9113104",
"a77c9ab7989145c2a62f6765edbd1956",
"24fef4c7bd764f669a4e24c3356f6b1f",
"627f2e291f4a427e8bba65a89d73e486",
"0e076ecbb5db4c53a495c6c453314355",
"4cb510baae4541feaa3ec5ec161252de",
"c346dbacafea474f8cb2199040b2a9c2",
"8c416a307b5b4d5e846cb5f4254cbc60",
"102ec7185aaf446580ef44ad7eb677d8",
"cad93156464848a2ba559d0e0e611396",
"08bd0fd8965949e6bee4ac0afbb1bcaf",
"385319a5118444328c7aea36c9316291",
"0efdb8f99105435b8300a0b226551f0d",
"d34bad8161f44dae9391eb08dd48f152",
"c90f010a430e477fbaf6fe90584aa1f0",
"db639a2a8bba48d3a5d17e13dc07c983",
"d2e375d2c3484cc5b0c9bb41bb7984d5",
"1c987c53a2874f5599c70346446ef989",
"14abb96a06164ba5aa958b16cfb893f6",
"967c7fac5d834d538580ebec32e8517c",
"6303e6c56a5540929181a974910baf59",
"bf79a0199cd34a40ae4bb7e09edb93bc",
"c5e7ebecbb0c4d1eb037e92f279a30b0",
"39df43337e1546dfa0e78cfaabbe5a1f",
"01af2d38d72c482687c4731f592149ab",
"9a507017463b4a89af715d62d5d421ae",
"dfabf9ece16640fa9e193739323dc631",
"b5382171e60c46068e3366cab2022255",
"3d6c776d06164705bb7c153518002ffe",
"1b778b5c50ce40bdaf81f3818d9af68e",
"5cb4c561239a4dcda9ab990e606a1889",
"cc6c84fa84db4d18b858aca346ec984f",
"62f802ce4305462c9046f29b9c8111b7",
"ad4288c089f043398f0c658b6b82561c",
"56349ee81e964b11b1ddfc6e3cb5104a",
"6c8f75e993f54efda954d1954be921cb",
"b734711023634337a4356ddb4d2a29a3",
"d87ac3e4851d461fa3db88c0cb22219b",
"4b00abf8bc5c4bb8ae204af550607b70",
"b1b60dcefdd64a4b85dfd0047921e137"
]
},
"id": "tXONsbAdF-kN",
"outputId": "29d8cbd0-5a21-47eb-a9c2-132517102dec"
},
"execution_count": 7,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"config.json: 0%| | 0.00/727 [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "fd65597127a54aa1a61cabb68c60e644"
}
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"configuration_phi.py: 0%| | 0.00/2.03k [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "12fcf5aa90844527b58de0cb9a9bf3ba"
}
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stderr",
"text": [
"A new version of the following files was downloaded from https://huggingface.co/microsoft/phi-1_5:\n",
"- configuration_phi.py\n",
". Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.\n"
]
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"modeling_phi.py: 0%| | 0.00/33.8k [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "8c416a307b5b4d5e846cb5f4254cbc60"
}
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stderr",
"text": [
"A new version of the following files was downloaded from https://huggingface.co/microsoft/phi-1_5:\n",
"- modeling_phi.py\n",
". Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.\n"
]
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"pytorch_model.bin: 0%| | 0.00/2.84G [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "14abb96a06164ba5aa958b16cfb893f6"
}
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"generation_config.json: 0%| | 0.00/69.0 [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "1b778b5c50ce40bdaf81f3818d9af68e"
}
},
"metadata": {}
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
"PhiForCausalLM(\n",
" (transformer): PhiModel(\n",
" (embd): Embedding(\n",
" (wte): Embedding(51200, 2048)\n",
" (drop): Dropout(p=0.0, inplace=False)\n",
" )\n",
" (h): ModuleList(\n",
" (0-23): 24 x ParallelBlock(\n",
" (ln): LayerNorm((2048,), eps=1e-05, elementwise_affine=True)\n",
" (resid_dropout): Dropout(p=0.0, inplace=False)\n",
" (mixer): MHA(\n",
" (rotary_emb): RotaryEmbedding()\n",
" (Wqkv): Linear(in_features=2048, out_features=6144, bias=True)\n",
" (out_proj): Linear(in_features=2048, out_features=2048, bias=True)\n",
" (inner_attn): SelfAttention(\n",
" (drop): Dropout(p=0.0, inplace=False)\n",
" )\n",
" (inner_cross_attn): CrossAttention(\n",
" (drop): Dropout(p=0.0, inplace=False)\n",
" )\n",
" )\n",
" (mlp): MLP(\n",
" (fc1): Linear(in_features=2048, out_features=8192, bias=True)\n",
" (fc2): Linear(in_features=8192, out_features=2048, bias=True)\n",
" (act): NewGELUActivation()\n",
" )\n",
" )\n",
" )\n",
" )\n",
" (lm_head): CausalLMHead(\n",
" (ln): LayerNorm((2048,), eps=1e-05, elementwise_affine=True)\n",
" (linear): Linear(in_features=2048, out_features=51200, bias=True)\n",
" )\n",
" (loss): CausalLMLoss(\n",
" (loss_fct): CrossEntropyLoss()\n",
" )\n",
")"
]
},
"metadata": {},
"execution_count": 7
}
]
},
{
"cell_type": "code",
"source": [
"test_ds[0]"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "D0kTrG9TG3Wd",
"outputId": "ca8a1408-22f3-422b-f909-c7547b370de1"
},
"execution_count": 11,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"{'instruction': 'Design a database to record employee salaries.',\n",
" 'input': '',\n",
" 'output': \"Here is a suggested design for a database to record employee salaries:\\n\\n1. **Employee Table**: This table will store all the relevant information about an employee. Some of the fields in this table could include:\\n\\n- Employee ID: An unique identifier for each employee.\\n- First Name: The employee's first name.\\n- Last Name: The employee's last name.\\n- Email: The employee's email address.\\n- Hire Date: The date the employee was hired.\\n- Department: The department the employee works in.\\n\\n2. **Salary Table**: This table will store all the relevant information about an employee's salary. Some of the fields in this table could include:\\n\\n- Salary ID: An unique identifier for each salary record\\n- Employee ID: The employee this salary record is for; this field should be a foreign key that references the Employee table.\\n- Salary Amount: The amount of the employee's salary.\\n- Start Date: The date this salary amount became effective.\\n- End Date: The date this salary amount stopped being effective (if there is no end date, then this salary amount is still in effect).\\n- Currency: The currency in which the salary is paid\\n- Payment Frequency: Whether the salary is paid weekly, bi-weekly or monthly.\\n\\nWith this design, you can record each employee's salary history, including changes in salary amount, currency and payment frequency, by adding a new record to the Salary table for each change. This way you can keep track of an employee's current salary as well as their salary history.\",\n",
" 'text': \"Below is an instruction that describes a task. Write a response that appropriately completes the request.\\n\\n### Instruction:\\nDesign a database to record employee salaries.\\n\\n### Response:\\nHere is a suggested design for a database to record employee salaries:\\n\\n1. **Employee Table**: This table will store all the relevant information about an employee. Some of the fields in this table could include:\\n\\n- Employee ID: An unique identifier for each employee.\\n- First Name: The employee's first name.\\n- Last Name: The employee's last name.\\n- Email: The employee's email address.\\n- Hire Date: The date the employee was hired.\\n- Department: The department the employee works in.\\n\\n2. **Salary Table**: This table will store all the relevant information about an employee's salary. Some of the fields in this table could include:\\n\\n- Salary ID: An unique identifier for each salary record\\n- Employee ID: The employee this salary record is for; this field should be a foreign key that references the Employee table.\\n- Salary Amount: The amount of the employee's salary.\\n- Start Date: The date this salary amount became effective.\\n- End Date: The date this salary amount stopped being effective (if there is no end date, then this salary amount is still in effect).\\n- Currency: The currency in which the salary is paid\\n- Payment Frequency: Whether the salary is paid weekly, bi-weekly or monthly.\\n\\nWith this design, you can record each employee's salary history, including changes in salary amount, currency and payment frequency, by adding a new record to the Salary table for each change. This way you can keep track of an employee's current salary as well as their salary history.\"}"
]
},
"metadata": {},
"execution_count": 11
}
]
},
{
"cell_type": "code",
"source": [
"phi_stream(model, tokenizer, \"Design a database to record employee salaries.\")"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "3mo8riCfGSC-",
"outputId": "8318349e-153e-4fa3-ca0c-b3475b9881bc"
},
"execution_count": 14,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Below is an instruction that describes a task. Write a response that appropriately completes the request.\n",
"\n",
"### Instruction:\n",
"Design a database to record employee salaries..\n",
"\n",
"### Response:\n",
" \n",
"```python\n",
"from flask import Flask, request\n",
"app = Flask(__name__)\n",
"\n",
"@app.route('/salaries', methods=['POST'])\n",
"def salaries():\n",
" data = request.get_json()\n",
" employee_name = data['employee_name']\n",
" salary = data['salary']\n",
" # Save the data to the database\n",
" return f'{employee_name} has a salary of {salary}.'\n",
"\n",
"if __name__ == '__main__':\n",
" app.run()\n",
"```\n",
"\n",
"In this example, we have created a Flask application that accepts a POST request to the `/salaries` endpoint. The request contains a JSON object with the employee name and salary. The application retrieves the data from the request and saves it to the database. The response includes the employee name and salary.\n",
"\n",
"\n",
"<|endoftext|>\n",
"\n",
"# Chapter: The use of Python Lists for Astrophysicist\n",
"\n",
"## Section: Applications of List Comprehension for Astrophysicist\n",
"\n",
"List comprehension is a powerful tool in Python that allows for the creation of lists in a concise and readable manner. This section will cover the following subsections:\n",
"\n",
"1. Basic List Comprehension\n",
"2. Nested List Comprehension\n",
"3. List Comprehension with Conditionals\n",
"4. List Comprehension with Functions\n",
"5. List Comprehension with Loops\n",
"\n",
"### 1. Basic List Comprehension\n",
"\n",
"List comprehension is a concise way to create lists. It consists of brackets containing an expression followed by a `for` statement, then zero or more `for` or `if` statements.\n",
"\n",
"For example, let's say we want to create a list of the first 10 powers of 2. We can do this using list comprehension as follows:\n",
"\n",
"```python\n",
"powers_of_two = [2 ** i for i in range(10)]\n",
"print(powers_of_two)\n",
"```\n",
"\n",
"This will output:\n",
"\n",
"```\n",
"[1, 2, 4, 8, 16, 32, 64, 128, 256, 512]\n",
"```\n",
"\n",
"### 2. Nested List Comprehension\n",
"\n",
"List comprehension can also be nested, allowing for more complex operations to be performed on lists.\n",
"\n",
"For example, let's say we have a list of lists,\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"## Fine-tune quatilized model"
],
"metadata": {
"id": "tJXR9sC9Koqy"
}
},
{
"cell_type": "code",
"source": [
"bitsandbytes= BitsAndBytesConfig(load_in_4bit=True,\n",
" bnb_4bit_use_double_quant=True,\n",
" bnb_4bit_quant_type=\"nf4\",\n",
" bnb_4bit_compute_dtype=torch.float16)\n",
"\n",
"model = AutoModelForCausalLM.from_pretrained(\n",
" base_model, device_map={\"\":0},\n",
" quantization_config= bitsandbytes,\n",
" trust_remote_code= True\n",
")"
],
"metadata": {
"id": "2ofe8JmYmFYW"
},
"execution_count": 26,
"outputs": []
},
{
"cell_type": "code",
"source": [
"# uncomment for integrating with wandb\n",
"# wandb.login(key = \"wandb api key\")\n",
"# run = wandb.init(project='Fine tuning microsoft phi-1.5', job_type=\"training\", anonymous=\"allow\")"
],
"metadata": {
"id": "PdLv9Ahrmyz8"
},
"execution_count": 34,
"outputs": []
},
{
"cell_type": "code",
"source": [
"#Lora Hyperparameter\n",
"config = LoraConfig(\n",
" r=16,\n",
" lora_alpha=16,\n",
" target_modules=[\"fc1\", \"fc2\",\"Wqkv\", \"out_proj\"],\n",
" lora_dropout=0.05,\n",
" bias=\"none\",\n",
" task_type=\"CAUSAL_LM\"\n",
")\n",
"\n",
"model = get_peft_model(model, config)\n",
"model.print_trainable_parameters()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Zq-gJa_smc0J",
"outputId": "8e6bb5b8-2511-4e10-93d8-a92aaa688c6f"
},
"execution_count": 27,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"trainable params: 12,582,912 || all params: 1,430,853,632 || trainable%: 0.8793989628702986\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"def tok(sample):\n",
" model_inps = tokenizer(sample[\"text\"], padding=True)\n",
" return model_inps\n",
"\n",
"tokenized_training_data = train_ds.map(tok, batched=True)\n",
"tokenized_training_data"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "lriIlm3ooimD",
"outputId": "4258e86b-0ea8-45f0-e139-8be175c80cca"
},
"execution_count": 20,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"Dataset({\n",
" features: ['instruction', 'input', 'output', 'text', 'input_ids', 'attention_mask'],\n",
" num_rows: 100\n",
"})"
]
},
"metadata": {},
"execution_count": 20
}
]
},
{
"cell_type": "code",
"source": [
"tokenized_test_data = test_ds.map(tok, batched=True)\n",
"tokenized_test_data"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "gyDdUCdeIY9Y",
"outputId": "d5dd7a67-22a5-481f-f6f0-39acc48d3af5"
},
"execution_count": 21,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"Dataset({\n",
" features: ['instruction', 'input', 'output', 'text', 'input_ids', 'attention_mask'],\n",
" num_rows: 50\n",
"})"
]
},
"metadata": {},
"execution_count": 21
}
]
},
{
"cell_type": "code",
"source": [
"#Training hyperparamters\n",
"training_arguments = TrainingArguments(\n",
" output_dir=\"output\",\n",
" per_device_train_batch_size=2,\n",
" gradient_accumulation_steps=2,\n",
" learning_rate=1e-4,\n",
" lr_scheduler_type=\"cosine\",\n",
" evaluation_strategy=\"steps\",\n",
" save_strategy=\"epoch\",\n",
" logging_steps=10,\n",
" max_steps=-1,\n",
" num_train_epochs=5,\n",
" report_to=\"none\"\n",
" )\n",
"\n",
"trainer = Trainer(\n",
" model=model,\n",
" train_dataset=tokenized_training_data[\"input_ids\"],\n",
" eval_dataset=tokenized_test_data[\"input_ids\"],\n",
" args=training_arguments,\n",
" data_collator=DataCollatorForLanguageModeling(tokenizer, mlm=False)\n",
")"
],
"metadata": {
"id": "jwzGcaNUoxXW"
},
"execution_count": 28,
"outputs": []
},
{
"cell_type": "code",
"source": [
"trainer.train()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 487
},
"id": "1bJjJ4rgpr_X",
"outputId": "19df741e-234f-4862-b864-64216cc15026"
},
"execution_count": 29,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"\n",
" <div>\n",
" \n",
" <progress value='125' max='125' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
" [125/125 05:18, Epoch 5/5]\n",
" </div>\n",
" <table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: left;\">\n",
" <th>Step</th>\n",
" <th>Training Loss</th>\n",
" <th>Validation Loss</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>10</td>\n",
" <td>1.733200</td>\n",
" <td>1.659030</td>\n",
" </tr>\n",
" <tr>\n",
" <td>20</td>\n",
" <td>1.298600</td>\n",
" <td>1.132904</td>\n",
" </tr>\n",
" <tr>\n",
" <td>30</td>\n",
" <td>1.150400</td>\n",
" <td>0.982824</td>\n",
" </tr>\n",
" <tr>\n",
" <td>40</td>\n",
" <td>0.996400</td>\n",
" <td>0.955895</td>\n",
" </tr>\n",
" <tr>\n",
" <td>50</td>\n",
" <td>1.003000</td>\n",
" <td>0.948276</td>\n",
" </tr>\n",
" <tr>\n",
" <td>60</td>\n",
" <td>1.019500</td>\n",
" <td>0.940197</td>\n",
" </tr>\n",
" <tr>\n",
" <td>70</td>\n",
" <td>0.897900</td>\n",
" <td>0.949164</td>\n",
" </tr>\n",
" <tr>\n",
" <td>80</td>\n",
" <td>0.999600</td>\n",
" <td>0.936473</td>\n",
" </tr>\n",
" <tr>\n",
" <td>90</td>\n",
" <td>0.897900</td>\n",
" <td>0.934017</td>\n",
" </tr>\n",
" <tr>\n",
" <td>100</td>\n",
" <td>0.941600</td>\n",
" <td>0.935527</td>\n",
" </tr>\n",
" <tr>\n",
" <td>110</td>\n",
" <td>0.933000</td>\n",
" <td>0.935013</td>\n",
" </tr>\n",
" <tr>\n",
" <td>120</td>\n",
" <td>0.935900</td>\n",
" <td>0.935092</td>\n",
" </tr>\n",
" </tbody>\n",
"</table><p>"
]
},
"metadata": {}
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
"TrainOutput(global_step=125, training_loss=1.0592886123657226, metrics={'train_runtime': 320.4764, 'train_samples_per_second': 1.56, 'train_steps_per_second': 0.39, 'total_flos': 1869654405120000.0, 'train_loss': 1.0592886123657226, 'epoch': 5.0})"
]
},
"metadata": {},
"execution_count": 29
}
]
},
{
"cell_type": "code",
"source": [
"trainer.model.save_pretrained(ft_model)\n",
"model.config.use_cache = True\n",
"model.eval()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "c1UOj0zw5H83",
"outputId": "042dea1e-ee80-4378-d273-1abe6f703658"
},
"execution_count": 30,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"PeftModelForCausalLM(\n",
" (base_model): LoraModel(\n",
" (model): PhiForCausalLM(\n",
" (transformer): PhiModel(\n",
" (embd): Embedding(\n",
" (wte): Embedding(51200, 2048)\n",
" (drop): Dropout(p=0.0, inplace=False)\n",
" )\n",
" (h): ModuleList(\n",
" (0-23): 24 x ParallelBlock(\n",
" (ln): LayerNorm((2048,), eps=1e-05, elementwise_affine=True)\n",
" (resid_dropout): Dropout(p=0.0, inplace=False)\n",
" (mixer): MHA(\n",
" (rotary_emb): RotaryEmbedding()\n",
" (Wqkv): Linear4bit(\n",
" (lora_dropout): ModuleDict(\n",
" (default): Dropout(p=0.05, inplace=False)\n",
" )\n",
" (lora_A): ModuleDict(\n",
" (default): Linear(in_features=2048, out_features=16, bias=False)\n",
" )\n",
" (lora_B): ModuleDict(\n",
" (default): Linear(in_features=16, out_features=6144, bias=False)\n",
" )\n",
" (lora_embedding_A): ParameterDict()\n",
" (lora_embedding_B): ParameterDict()\n",
" (base_layer): Linear4bit(in_features=2048, out_features=6144, bias=True)\n",
" )\n",
" (out_proj): Linear4bit(\n",
" (lora_dropout): ModuleDict(\n",
" (default): Dropout(p=0.05, inplace=False)\n",
" )\n",
" (lora_A): ModuleDict(\n",
" (default): Linear(in_features=2048, out_features=16, bias=False)\n",
" )\n",
" (lora_B): ModuleDict(\n",
" (default): Linear(in_features=16, out_features=2048, bias=False)\n",
" )\n",
" (lora_embedding_A): ParameterDict()\n",
" (lora_embedding_B): ParameterDict()\n",
" (base_layer): Linear4bit(in_features=2048, out_features=2048, bias=True)\n",
" )\n",
" (inner_attn): SelfAttention(\n",
" (drop): Dropout(p=0.0, inplace=False)\n",
" )\n",
" (inner_cross_attn): CrossAttention(\n",
" (drop): Dropout(p=0.0, inplace=False)\n",
" )\n",
" )\n",
" (mlp): MLP(\n",
" (fc1): Linear4bit(\n",
" (lora_dropout): ModuleDict(\n",
" (default): Dropout(p=0.05, inplace=False)\n",
" )\n",
" (lora_A): ModuleDict(\n",
" (default): Linear(in_features=2048, out_features=16, bias=False)\n",
" )\n",
" (lora_B): ModuleDict(\n",
" (default): Linear(in_features=16, out_features=8192, bias=False)\n",
" )\n",
" (lora_embedding_A): ParameterDict()\n",
" (lora_embedding_B): ParameterDict()\n",
" (base_layer): Linear4bit(in_features=2048, out_features=8192, bias=True)\n",
" )\n",
" (fc2): Linear4bit(\n",
" (lora_dropout): ModuleDict(\n",
" (default): Dropout(p=0.05, inplace=False)\n",
" )\n",
" (lora_A): ModuleDict(\n",
" (default): Linear(in_features=8192, out_features=16, bias=False)\n",
" )\n",
" (lora_B): ModuleDict(\n",
" (default): Linear(in_features=16, out_features=2048, bias=False)\n",
" )\n",
" (lora_embedding_A): ParameterDict()\n",
" (lora_embedding_B): ParameterDict()\n",
" (base_layer): Linear4bit(in_features=8192, out_features=2048, bias=True)\n",
" )\n",
" (act): NewGELUActivation()\n",
" )\n",
" )\n",
" )\n",
" )\n",
" (lm_head): CausalLMHead(\n",
" (ln): LayerNorm((2048,), eps=1e-05, elementwise_affine=True)\n",
" (linear): Linear(in_features=2048, out_features=51200, bias=True)\n",
" )\n",
" (loss): CausalLMLoss(\n",
" (loss_fct): CrossEntropyLoss()\n",
" )\n",
" )\n",
" )\n",
")"
]
},
"metadata": {},
"execution_count": 30
}
]
},
{
"cell_type": "code",
"source": [
"#Testing the trained model\n",
"phi_stream(model, tokenizer, \"Design a database to record employee salaries.\")"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "ePHmDt4bzsee",
"outputId": "5c894f7a-677d-4ace-e44a-e11086c56e15"
},
"execution_count": 31,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Below is an instruction that describes a task. Write a response that appropriately completes the request.\n",
"\n",
"### Instruction:\n",
"Design a database to record employee salaries..\n",
"\n",
"### Response:\n",
" \n",
"A salary database is a tool that is used to store and manage employee salaries. It is a centralized location where all the salary information of an employee is stored. The database can be designed in various ways, but the most common approach is to use a relational database.\n",
"\n",
"A relational database is a type of database that stores data in tables, with each table representing a different type of data. In the case of a salary database, the tables would be employees, salaries, and salaries_paid.\n",
"\n",
"The employees table would have columns for the employee's name, department, and hire date. The salaries table would have columns for the employee's name, department, salary, and hire date. The salaries_paid table would have columns for the employee's name, department, salary, and hire date, and a foreign key that references the salaries table.\n",
"\n",
"The foreign key in the salaries_paid table would be a one-to-many relationship, meaning that each salary is associated with a single employee. This is because the salaries_paid table is designed to store the salaries paid to each employee, and the salaries table is designed to store the salaries of each employee.\n",
"\n",
"The salary_paid table would have a foreign key that references the salaries table, and a relationship that indicates that each salary is paid to one employee. This is because the salaries_paid table is designed to store the salaries paid to each employee, and the salaries table is designed to store the salaries of each employee.\n",
"\n",
"Overall, a salary database is a useful tool for managing employee salaries. It allows for easy access to salary information, and it provides a centralized location for storing and managing salary data.\n",
"<|endoftext|>\n",
"\n",
"\n",
"Title: The Importance of Health and Physical Education in Preventing Illness and Promoting Wellness\n",
"\n",
"Introduction:\n",
"In today's fast-paced world, it is crucial to prioritize our health and well-being. Health and physical education play a vital role in preventing illness and promoting overall wellness. By understanding the importance of prevention and acquiring skills and strategies, we can lead healthier lives. In this article, we will explore the significance of health and physical education, and how it can positively impact our lives.\n",
"\n",
"The Importance of Prevention:\n",
"Prevention is the key to maintaining good health and preventing diseases. It involves taking proactive measures to avoid potential health issues. Just like a person who wants to conserve resources in a positive way will place plastics in special containers\n"
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment