diff --git a/notebooks/unsloth_panza.ipynb b/notebooks/unsloth_panza.ipynb new file mode 100644 index 0000000..f08c6be --- /dev/null +++ b/notebooks/unsloth_panza.ipynb @@ -0,0 +1,7934 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [], + "gpuType": "T4" + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + }, + "accelerator": "GPU", + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "757e2134f09443c994353bee5dc7d209": { + "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_261c147c241e45a6bfd1ac36706b92c6", + "IPY_MODEL_fe93408da05c41058a12e5166ac00af5", + "IPY_MODEL_014a4d4475c0468082282cafeb433654" + ], + "layout": "IPY_MODEL_099661f4d7d44adc8601374d6b11bb77" + } + }, + "261c147c241e45a6bfd1ac36706b92c6": { + "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_2e4f4c0fb6574fde9d87032e8a863705", + "placeholder": "​", + "style": "IPY_MODEL_f0640959af9847289a34809035450bf9", + "value": "Loading checkpoint shards: 100%" + } + }, + "fe93408da05c41058a12e5166ac00af5": { + "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_1973deb9a321449f973e8b4219d092ce", + "max": 2, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_021d7dbcbc0a4d19bf0fd095a244a10f", + "value": 2 + } + }, + "014a4d4475c0468082282cafeb433654": { + "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_f6b68f408ec148f3a14af081beb6f6ee", + "placeholder": "​", + "style": "IPY_MODEL_0d3fdb6795d140bf89157b8c3858b584", + "value": " 2/2 [00:26<00:00, 12.05s/it]" + } + }, + "099661f4d7d44adc8601374d6b11bb77": { + "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 + } + }, + "2e4f4c0fb6574fde9d87032e8a863705": { + "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 + } + }, + "f0640959af9847289a34809035450bf9": { + "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": "" + } + }, + "1973deb9a321449f973e8b4219d092ce": { + "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 + } + }, + "021d7dbcbc0a4d19bf0fd095a244a10f": { + "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": "" + } + }, + "f6b68f408ec148f3a14af081beb6f6ee": { + "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 + } + }, + "0d3fdb6795d140bf89157b8c3858b584": { + "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": "" + } + }, + "cc95b85ddb28402c80b17707ad22f0b7": { + "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_18bbdd291e154d1986e99cf85a12ae5d", + "IPY_MODEL_b0beeb4e363c410a90a0035c7794a88e", + "IPY_MODEL_3df10434312c400dbef72d0825697369" + ], + "layout": "IPY_MODEL_f308c3ff74fd40afa55266fd0b2deb14" + } + }, + "18bbdd291e154d1986e99cf85a12ae5d": { + "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_ef712467d07c4d78b944df5e02b58517", + "placeholder": "​", + "style": "IPY_MODEL_5bf5c996ea9a4b03ba7de1c1ee8491c3", + "value": "Generating train split: " + } + }, + "b0beeb4e363c410a90a0035c7794a88e": { + "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_efb060fd32f448b1bb07cd1e9567c0f4", + "max": 1, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_d8da90c9ac4c4a088d6c744e53ab7b80", + "value": 1 + } + }, + "3df10434312c400dbef72d0825697369": { + "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_8aab096c3bba48faac83025b3a0043c1", + "placeholder": "​", + "style": "IPY_MODEL_5bd45715b0f2425d8ca7ef5cb6789459", + "value": " 166/0 [00:00<00:00, 1669.52 examples/s]" + } + }, + "f308c3ff74fd40afa55266fd0b2deb14": { + "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 + } + }, + "ef712467d07c4d78b944df5e02b58517": { + "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 + } + }, + "5bf5c996ea9a4b03ba7de1c1ee8491c3": { + "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": "" + } + }, + "efb060fd32f448b1bb07cd1e9567c0f4": { + "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": "20px" + } + }, + "d8da90c9ac4c4a088d6c744e53ab7b80": { + "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": "" + } + }, + "8aab096c3bba48faac83025b3a0043c1": { + "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 + } + }, + "5bd45715b0f2425d8ca7ef5cb6789459": { + "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": "" + } + }, + "921902a9ffb54f8c8f1728a1c38277b1": { + "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_262c0c8c34994f60882edbbb6672ff51", + "IPY_MODEL_54aa02d647744cea9a2b551bfeae562e", + "IPY_MODEL_e1fbac672afb4bd988e39db0e8177ec3" + ], + "layout": "IPY_MODEL_b84551b0f64f48858ae15cd155ce5daf" + } + }, + "262c0c8c34994f60882edbbb6672ff51": { + "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_394ecebe42d0457fa634c9f3fbeb0444", + "placeholder": "​", + "style": "IPY_MODEL_575c5701c20a4e44ba42ea5b9f300277", + "value": "Map: 100%" + } + }, + "54aa02d647744cea9a2b551bfeae562e": { + "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_b7a34db0b49d4e2088ad3db06d6b91f9", + "max": 166, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_86a4423aa6c5451aa187c28a952e530d", + "value": 166 + } + }, + "e1fbac672afb4bd988e39db0e8177ec3": { + "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_da7ebc4bccba4c4d963766fbc39758ba", + "placeholder": "​", + "style": "IPY_MODEL_821ff68a9fe248f596f0fa584b2e83b5", + "value": " 166/166 [00:00<00:00, 2807.78 examples/s]" + } + }, + "b84551b0f64f48858ae15cd155ce5daf": { + "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 + } + }, + "394ecebe42d0457fa634c9f3fbeb0444": { + "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 + } + }, + "575c5701c20a4e44ba42ea5b9f300277": { + "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": "" + } + }, + "b7a34db0b49d4e2088ad3db06d6b91f9": { + "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 + } + }, + "86a4423aa6c5451aa187c28a952e530d": { + "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": "" + } + }, + "da7ebc4bccba4c4d963766fbc39758ba": { + "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 + } + }, + "821ff68a9fe248f596f0fa584b2e83b5": { + "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": "" + } + }, + "6901669228e4443483721ef8ebdf74fa": { + "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_0336e6a94e7b46ac8850e76e5391e2b1", + "IPY_MODEL_58044a15d7cd4e1b810c09b8f567abd6", + "IPY_MODEL_951b4bfb21204b6a8dff5b221e020e0c" + ], + "layout": "IPY_MODEL_f5d736ab164f4f728d67f70ede912f26" + } + }, + "0336e6a94e7b46ac8850e76e5391e2b1": { + "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_a0b8ebe67c3c48ea92d5b5dd7b21a80b", + "placeholder": "​", + "style": "IPY_MODEL_bce2fd045ad647829ddd3d11cf2d00c6", + "value": "Generating train split: " + } + }, + "58044a15d7cd4e1b810c09b8f567abd6": { + "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_4158ed87d2fe4a3f8248f6383a9e42ea", + "max": 1, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_b29448132eca4b1fa31737db8288a267", + "value": 1 + } + }, + "951b4bfb21204b6a8dff5b221e020e0c": { + "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_f7fe1d614a0340e0b1adcdeb2e7ca364", + "placeholder": "​", + "style": "IPY_MODEL_292883e9ee4b41a3ada4e557c4276743", + "value": " 166/0 [00:00<00:00, 6091.31 examples/s]" + } + }, + "f5d736ab164f4f728d67f70ede912f26": { + "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 + } + }, + "a0b8ebe67c3c48ea92d5b5dd7b21a80b": { + "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 + } + }, + "bce2fd045ad647829ddd3d11cf2d00c6": { + "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": "" + } + }, + "4158ed87d2fe4a3f8248f6383a9e42ea": { + "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": "20px" + } + }, + "b29448132eca4b1fa31737db8288a267": { + "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": "" + } + }, + "f7fe1d614a0340e0b1adcdeb2e7ca364": { + "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 + } + }, + "292883e9ee4b41a3ada4e557c4276743": { + "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": "" + } + }, + "fd06e08217c34601ae7e5324d68e5e02": { + "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_90f2d2bac25d4289a37c7fc0b2f2e8bf", + "IPY_MODEL_e7b5c95c9a5048dfbaabf7c1a047643f", + "IPY_MODEL_2a2ee2cc44364403babcbd9bb02584b4" + ], + "layout": "IPY_MODEL_b56a3fd34cef4f7c9eea9b017399317e" + } + }, + "90f2d2bac25d4289a37c7fc0b2f2e8bf": { + "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_fc87949ee843407786476a740a116dc3", + "placeholder": "​", + "style": "IPY_MODEL_d604ac4e799a411fa77cd562c8fef5af", + "value": "Map: 100%" + } + }, + "e7b5c95c9a5048dfbaabf7c1a047643f": { + "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_bac64a6c0a184bee86302f5833c7f3b4", + "max": 166, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_5619ae9cc17b4073a80573785bfa4386", + "value": 166 + } + }, + "2a2ee2cc44364403babcbd9bb02584b4": { + "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_1d150e07eb1545bda1db162033ca9f33", + "placeholder": "​", + "style": "IPY_MODEL_e59f0b019a284c2ea6edcf12eb5bdfa2", + "value": " 166/166 [00:00<00:00, 3060.96 examples/s]" + } + }, + "b56a3fd34cef4f7c9eea9b017399317e": { + "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 + } + }, + "fc87949ee843407786476a740a116dc3": { + "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 + } + }, + "d604ac4e799a411fa77cd562c8fef5af": { + "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": "" + } + }, + "bac64a6c0a184bee86302f5833c7f3b4": { + "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 + } + }, + "5619ae9cc17b4073a80573785bfa4386": { + "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": "" + } + }, + "1d150e07eb1545bda1db162033ca9f33": { + "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 + } + }, + "e59f0b019a284c2ea6edcf12eb5bdfa2": { + "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": "" + } + }, + "0a8884725d0f47a9ba082484d23b3ee5": { + "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_64cd9733b3684450b1d81db4738e0c4b", + "IPY_MODEL_e3885ade73d7470782b96eff75ecacfb", + "IPY_MODEL_2278116ffec24ba0a34bbcd87889bed7" + ], + "layout": "IPY_MODEL_8cd1b86576984bcc943dbacf090f05ab" + } + }, + "64cd9733b3684450b1d81db4738e0c4b": { + "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_e88805ae19e24514b36e2afdbad31d60", + "placeholder": "​", + "style": "IPY_MODEL_64ccc4303d1a4127890715017f3fd8c0", + "value": "Unsloth: Tokenizing ["text"] (num_proc=2): 100%" + } + }, + "e3885ade73d7470782b96eff75ecacfb": { + "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_da75f8593b25418fb6c623ea5d67b832", + "max": 166, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_3fc9d4afa3334935a410647bb7a00955", + "value": 166 + } + }, + "2278116ffec24ba0a34bbcd87889bed7": { + "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_5d201d14bb1f43d69eec580d2d76e7d0", + "placeholder": "​", + "style": "IPY_MODEL_1b4459a8f56d4ed1a787a8fb0a74a4a5", + "value": " 166/166 [00:02<00:00, 97.06 examples/s]" + } + }, + "8cd1b86576984bcc943dbacf090f05ab": { + "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 + } + }, + "e88805ae19e24514b36e2afdbad31d60": { + "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 + } + }, + "64ccc4303d1a4127890715017f3fd8c0": { + "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": "" + } + }, + "da75f8593b25418fb6c623ea5d67b832": { + "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 + } + }, + "3fc9d4afa3334935a410647bb7a00955": { + "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": "" + } + }, + "5d201d14bb1f43d69eec580d2d76e7d0": { + "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 + } + }, + "1b4459a8f56d4ed1a787a8fb0a74a4a5": { + "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": "" + } + }, + "579e8bd62d924e09acdbc7f767d248ee": { + "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_e29e1faca7d742f2854d603eca2a4f31", + "IPY_MODEL_415031218baf4d1db7594d250a1241ab", + "IPY_MODEL_e4584935c484463c90d13fe070f86bbb" + ], + "layout": "IPY_MODEL_145dbd02302241e6870018af35f368bf" + } + }, + "e29e1faca7d742f2854d603eca2a4f31": { + "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_00fff41f774c4c40829cb5d83e1c6bc7", + "placeholder": "​", + "style": "IPY_MODEL_30965c882e4f411faf19a8a4cb583bd0", + "value": "Featurizing p: 100%" + } + }, + "415031218baf4d1db7594d250a1241ab": { + "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_fc67b06adf97402e82621f47e34fb3bf", + "max": 166, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_11879b21ec1e4fa6840452e06812dda1", + "value": 166 + } + }, + "e4584935c484463c90d13fe070f86bbb": { + "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_56da4c7d9bc84892b959333090051813", + "placeholder": "​", + "style": "IPY_MODEL_bbc91e26076242d78feb2b5b0b32acd4", + "value": " 166/166 [03:45<00:00,  1.02s/it]" + } + }, + "145dbd02302241e6870018af35f368bf": { + "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 + } + }, + "00fff41f774c4c40829cb5d83e1c6bc7": { + "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 + } + }, + "30965c882e4f411faf19a8a4cb583bd0": { + "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": "" + } + }, + "fc67b06adf97402e82621f47e34fb3bf": { + "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 + } + }, + "11879b21ec1e4fa6840452e06812dda1": { + "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": "" + } + }, + "56da4c7d9bc84892b959333090051813": { + "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 + } + }, + "bbc91e26076242d78feb2b5b0b32acd4": { + "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": "" + } + }, + "f8492c624a2e4b07b241671d6bb3403b": { + "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_c3f2f48393fa4b9083329a2a9aafa60a", + "IPY_MODEL_49d471cd44f347809eb044785477ccbb", + "IPY_MODEL_1cd47be7fe6a499faa48e4eac48c92fa" + ], + "layout": "IPY_MODEL_446d1b618b4e40bc847f61128eafca19" + } + }, + "c3f2f48393fa4b9083329a2a9aafa60a": { + "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_a53987ad5da44c5c9d1473fd4161693d", + "placeholder": "​", + "style": "IPY_MODEL_f1f999d590ff42aca914d2b6991b3ebf", + "value": "Featurizing q: 100%" + } + }, + "49d471cd44f347809eb044785477ccbb": { + "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_cd230a8e262f44f391643461945a9661", + "max": 166, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_d893d3060b4944c1907cf7fe2dfa9ca7", + "value": 166 + } + }, + "1cd47be7fe6a499faa48e4eac48c92fa": { + "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_71867253cf6d4498aa3f95442f63e12c", + "placeholder": "​", + "style": "IPY_MODEL_350e68d979774a7a8512af120a709b2c", + "value": " 166/166 [03:23<00:00,  1.02s/it]" + } + }, + "446d1b618b4e40bc847f61128eafca19": { + "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 + } + }, + "a53987ad5da44c5c9d1473fd4161693d": { + "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 + } + }, + "f1f999d590ff42aca914d2b6991b3ebf": { + "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": "" + } + }, + "cd230a8e262f44f391643461945a9661": { + "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 + } + }, + "d893d3060b4944c1907cf7fe2dfa9ca7": { + "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": "" + } + }, + "71867253cf6d4498aa3f95442f63e12c": { + "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 + } + }, + "350e68d979774a7a8512af120a709b2c": { + "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", + "source": [ + "Clone the panza repository by running the following cell." + ], + "metadata": { + "id": "fXxhinJuMLRu" + } + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "cfJ-21XXetNt", + "outputId": "d8fa87d0-ee8e-418e-aed5-39fdc6716982" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Cloning into 'PanzaMail'...\n", + "remote: Enumerating objects: 1879, done.\u001b[K\n", + "remote: Counting objects: 100% (203/203), done.\u001b[K\n", + "remote: Compressing objects: 100% (81/81), done.\u001b[K\n", + "remote: Total 1879 (delta 159), reused 136 (delta 122), pack-reused 1676 (from 2)\u001b[K\n", + "Receiving objects: 100% (1879/1879), 1.71 MiB | 26.99 MiB/s, done.\n", + "Resolving deltas: 100% (1064/1064), done.\n", + "/content/PanzaMail\n" + ] + } + ], + "source": [ + "!git clone https://github.com/IST-DASLab/PanzaMail.git\n", + "%cd PanzaMail" + ] + }, + { + "cell_type": "markdown", + "source": [ + "Install all the required packages" + ], + "metadata": { + "id": "YjJtPW1IMjfT" + } + }, + { + "cell_type": "code", + "source": [ + "!pip install hydra-core langchain-community fastapi uvicorn pydantic python-dotenv gradio evaluate torchmetrics nltk accelerate mauve-text langdetect --quiet" + ], + "metadata": { + "id": "D1bJh7MNMjwp" + }, + "execution_count": 1, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "%%capture\n", + "import os\n", + "if \"COLAB_\" not in \"\".join(os.environ.keys()):\n", + " !pip install unsloth\n", + "else:\n", + " !pip install --no-deps bitsandbytes accelerate xformers==0.0.29.post3 peft trl==0.15.2 triton cut_cross_entropy unsloth_zoo\n", + " !pip install sentencepiece protobuf \"datasets>=3.4.1\" huggingface_hub hf_transfer\n", + " !pip install --no-deps unsloth" + ], + "metadata": { + "id": "czyjw5s5L_Au" + }, + "execution_count": 2, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "from unsloth import FastLanguageModel\n", + "import json\n", + "import re\n", + "import sys\n", + "import hydra\n", + "import torch\n", + "import numpy as np\n", + "from datasets import load_dataset\n", + "from transformers import TextStreamer, AutoConfig, AutoTokenizer\n", + "import os\n", + "from typing import Dict\n", + "from omegaconf import OmegaConf\n", + "from unsloth.chat_templates import get_chat_template\n", + "from trl import SFTTrainer\n", + "from transformers import TrainingArguments\n", + "from unsloth import is_bfloat16_supported\n", + "import re\n", + "import pandas as pd" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "6aBXd91NMtqs", + "outputId": "07ab600f-fe47-4ec5-dee5-5a430a64cab6" + }, + "execution_count": 3, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "🦥 Unsloth: Will patch your computer to enable 2x faster free finetuning.\n", + "🦥 Unsloth Zoo will now patch everything to make training faster!\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "!huggingface-cli login" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "ixLjfdBmKzER", + "outputId": "e5b37a19-2a12-4edd-acc7-d5d62f3cd080" + }, + "execution_count": 5, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " _| _| _| _| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _|_|_|_| _|_| _|_|_| _|_|_|_|\n", + " _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|\n", + " _|_|_|_| _| _| _| _|_| _| _|_| _| _| _| _| _| _|_| _|_|_| _|_|_|_| _| _|_|_|\n", + " _| _| _| _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|\n", + " _| _| _|_| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _| _| _| _|_|_| _|_|_|_|\n", + "\n", + " To log in, `huggingface_hub` requires a token generated from https://huggingface.co/settings/tokens .\n", + "Enter your token (input will not be visible): \n", + "Add token as git credential? (Y/n) Y\n", + "Token is valid (permission: fineGrained).\n", + "The token `panza-preetika` has been saved to /root/.cache/huggingface/stored_tokens\n", + "\u001b[1m\u001b[31mCannot authenticate through git-credential as no helper is defined on your machine.\n", + "You might have to re-authenticate when pushing to the Hugging Face Hub.\n", + "Run the following command in your terminal in case you want to set the 'store' credential helper as default.\n", + "\n", + "git config --global credential.helper store\n", + "\n", + "Read https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage for more details.\u001b[0m\n", + "Token has not been saved to git credential helper.\n", + "Your token has been saved to /root/.cache/huggingface/token\n", + "Login successful.\n", + "The current active token is: `panza-preetika`\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "Download your emails" + ], + "metadata": { + "id": "Iu2thWvI1nIb" + } + }, + { + "cell_type": "code", + "source": [ + "from google.colab import drive\n", + "drive.mount('/content/drive')\n", + "%cp /content/drive/MyDrive/panza/Sent.mbox /content/PanzaMail/data/Sent.mbox" + ], + "metadata": { + "id": "Wa-7_ZVP1mZ_" + }, + "execution_count": 11, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "##Configuration\n", + "\n", + "Now from the left panel, open the file PanzaMail/scripts/config.sh and configure the parameters according to this set of [instructions](https://github.com/IST-DASLab/PanzaMail?tab=readme-ov-file#step-1-environment-configuration). Additionally, you would want to edit your prompt preambles (under PanzaMail/prompt_preambles).\n" + ], + "metadata": { + "id": "lgw5r3TJGYdS" + } + }, + { + "cell_type": "code", + "source": [ + "script_dir = os.path.dirname(os.path.abspath('/content/PanzaMail/scripts/prepare_data.py')) # location of prepare_data.py\n", + "src_path = os.path.join(script_dir, '..', 'src')\n", + "sys.path.insert(0, os.path.abspath(src_path))" + ], + "metadata": { + "id": "3Ln4ty8VQknO" + }, + "execution_count": 4, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "from panza import PanzaWriter # The import also loads custom Hydra resolvers\n", + "from panza.entities import Document, Email, SummarizationInstruction, EmailInstruction\n", + "from panza.retriever import DocumentRetriever\n", + "from panza.data_preparation.extract_emails import extract_emails\n", + "from panza.data_preparation.prepare_raft_emails import prepare_raft_emails\n", + "from panza.data_preparation.rag import create_vector_store\n", + "from panza.interface.json import compute_rouge_scores, compute_bleu_scores, compute_mauve_score" + ], + "metadata": { + "id": "HcOW7aiiYgYD", + "colab": { + "base_uri": "https://localhost:8080/" + }, + "outputId": "8298ccad-0830-4dc5-c2b5-517d35fc15d6" + }, + "execution_count": 5, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + " . . . . . . \n", + " ... . . . . . . . \n", + " . . . . . =%[ :+. . \n", + " . . . .~@% +@( \n", + " . .. ~<: . . . >@^.@) . \n", + " . . :}: . . *@@@@@{^=-. \n", + " . ={@@~ . . . .)@@@@@@@@@#= . \n", + " *%@@@@^ . . ~^^ >@@@@@@@@@%(=. \n", + " (@%@@@@@@@@[ =#@@@@@@@@@@@#= -}@@@@@@]..*= \n", + " ^@@@@@@@@@@%.. :<#@@@@@@@@@@@{= ..:}@@@@@-) .. \n", + " ~@@@@@@@@@@@-:[@@@@@@@@@@@@@@%+ . =#@@@@@+* .. .\n", + " :@@@@@@#^:.^*>#@%#{@@@@@@@@@@@# ..+-.^@@@@@@<-- \n", + " .}@@@[+ -( . .<@@@@@@@@@@^ ^%[=)@@@@@@~<( \n", + " . .. +@*. *}@@@@@@@@@@@@()>+)@@+=%@@@@@+}{= . \n", + " {@@#%@@@@@@@@@@@@@@@%{@@@%+]@@@@@@+ \n", + " . =@@@@@@@@@@@@@@@@@@@@@{#{*.(@@@@@@* \n", + " . -@][[#@@@@@@@@@@@@@@@@@).=#@@@@@@* \n", + " +)}[{}* #..-@@@@@@@@@@@@@@@@@@%>(@@@@@@@^ \n", + " . ~[@@@@@@^:=#{#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<. . \n", + " ~#@@@@@@#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@% \n", + " .:)@@@@(:~%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@* \n", + " ~{@#<. <@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#.. .. \n", + " == (@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@> . . \n", + " . .>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@] . \n", + " . :%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(. \n", + " . ^@@@@@@@@@@@@@@@@@@@@@@@@@@@@@~ \n", + " ... ~@@@@@@@@@@@@@@@@@@@@@@@@@[~ . . \n", + " . . . >@@@@@@@}=:=+^>^+@@@@@@@[: . . \n", + ". ..>@@@@@}- +@@@@@]: . .. \n", + ". :#<<( -{](> . \n", + " . . ..(]>}+~~~=======+}(((~-::... . .. \n", + " .:~=+^>)][[}{#%%@@@@@@@@@@@@@@@@@%%#{}}[])<>*+=-:. . \n", + " . . . . . .. . . . \n", + ".______ ___ .__ __. ________ ___ \n", + "| _ \\ / \\ | \\ | | | / / \\ \n", + "| |_) | / ^ \\ | \\| | `---/ / / ^ \\ \n", + "| ___/ / /_\\ \\ | . ` | / / / /_\\ \\ \n", + "| | / _____ \\ | |\\ | / /----./ _____ \\ \n", + "| _| /__/ \\__\\ |__| \\__| /________/__/ \\__\\ \n", + " \n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "from hydra import initialize, compose\n", + "from omegaconf import OmegaConf as om\n", + "from omegaconf import OmegaConf, open_dict\n", + "from hydra.core.hydra_config import HydraConfig\n", + "\n", + "%cd /content/PanzaMail\n", + "sys.path.append(os.path.abspath(os.path.join('../src')))\n", + "\n", + "\n", + "config_dir = \"./configs\"\n", + "\n", + "with initialize(version_base=\"1.1\", config_path=config_dir):\n", + " cfg = compose(config_name=\"panza_preparation.yaml\")\n", + " OmegaConf.set_struct(cfg, False)\n", + " cfg.writer.llm.name = 'meta-llama/Llama-3.2-3B-Instruct'\n", + " cfg.writer.llm.checkpoint = 'meta-llama/Llama-3.2-3B-Instruct'\n", + " cfg.panza_workspace = os.getcwd()\n", + " om.resolve(cfg)\n", + " print(cfg)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "DjXE5dxafFTs", + "outputId": "6e1bc969-607e-4999-bffa-b6204e902569" + }, + "execution_count": 6, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "/content/PanzaMail\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "/usr/local/lib/python3.11/dist-packages/hydra/_internal/defaults_list.py:251: UserWarning: In 'panza_preparation.yaml': Defaults list is missing `_self_`. See https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/default_composition_order for more information\n", + " warnings.warn(msg, UserWarning)\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "{'user': {'email_address': 'david_anonymous@xyz.com', 'username': 'david_anonymous', 'data_dir': '/content/PanzaMail/data', 'system_preamble_path': '/content/PanzaMail/prompt_preambles/system_preamble.txt', 'user_preamble_path': '/content/PanzaMail/prompt_preambles/user_preamble.txt', 'rag_preamble_path': '/content/PanzaMail/prompt_preambles/rag_preamble.txt', 'thread_preamble_path': '/content/PanzaMail/prompt_preambles/thread_preamble.txt'}, 'panza_workspace': '/content/PanzaMail', 'checkpoint_dir': '/content/PanzaMail/checkpoints', 'seed': 41, 'embedding_model': 'sentence-transformers/all-mpnet-base-v2', 'model_precision': 'bf16', 'writer': {'llm': {'sampling': {'do_sample': True, 'temperature': 0.7, 'top_k': 50, 'top_p': 0.7, 'max_new_tokens': 1024}, '_target_': 'panza.llm.TransformersLLM', 'name': 'meta-llama/Llama-3.2-3B-Instruct', 'checkpoint': 'meta-llama/Llama-3.2-3B-Instruct', 'device': 'cuda', 'dtype': 'bf16', 'load_in_4bit': False, 'remove_prompt_from_stream': False}, 'prompting': {'_target_': 'panza.prompting.SummarizationPromptBuilder', 'summarization_prompt': 'Summarize the following email that I wrote, in an imperative form, in one or two or maximum three sentences, and make sure to include relevant information, without copying the email content itself. The summary should look like an instruction directing someone to write the same email, and start with Instruction: \\nHere is the email text:\\n{email}'}, '_target_': 'panza.writer.PanzaWriter'}, 'retriever': {'_target_': 'panza.retriever.FaissRetriever', 'db_path': '/content/PanzaMail/data', 'index_name': 'david_anonymous', 'embedding_model': 'sentence-transformers/all-mpnet-base-v2', 'device': 'cpu'}, 'batch_size': 8, 'email_dump_path': '/content/PanzaMail/data/Sent.mbox', 'cleaned_emails_path': '/content/PanzaMail/data/david_anonymous_clean.jsonl', 'discarded_emails_dir': '/content/PanzaMail/data/david_anonymous/discarded_emails', 'summarized_emails_path': '/content/PanzaMail/data/david_anonymous_clean_summarized.jsonl', 'rag_db_dir': '/content/PanzaMail/data', 'checkpoint': 'microsoft/Phi-3-mini-4k-instruct', 'force_extract_clean_emails': False, 'test_split': 0.0, 'split_type': 'random', 'rag_embedding_chunk_size': 3000, 'rag_embedding_chunk_overlap': 3000, 'rag_embedding_model': 'sentence-transformers/all-mpnet-base-v2', 'number_rag_emails_to_cache_with_train_data': 10}\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "import importlib.util\n", + "\n", + "# Path to the file you want to import from\n", + "file_path = \"/content/PanzaMail/scripts/prepare_data.py\"\n", + "\n", + "# Load the module\n", + "spec = importlib.util.spec_from_file_location(\"prepare_data\", file_path)\n", + "prepare_data = importlib.util.module_from_spec(spec)\n", + "spec.loader.exec_module(prepare_data)\n", + "\n", + "# Now you can access the function\n", + "rename_config_keys = prepare_data.rename_config_keys\n", + "load_documents = prepare_data.load_documents\n", + "generate_synthetic_instructions = prepare_data.generate_synthetic_instructions\n", + "check_if_file_exists = prepare_data.check_if_file_exists\n", + "split_and_write_data = prepare_data.split_and_write_data" + ], + "metadata": { + "id": "L5Lh-xy2ZAbA" + }, + "execution_count": 7, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "rename_config_keys(cfg)\n", + "if not check_if_file_exists(cfg):\n", + " extract_emails(cfg.email_dump_path, cfg.cleaned_emails_path,[cfg.user.email_address], cfg.discarded_emails_dir,)" + ], + "metadata": { + "id": "SWJdMQmoZA1W", + "colab": { + "base_uri": "https://localhost:8080/" + }, + "outputId": "83592897-96a3-4cff-9b66-acf0e5e03479" + }, + "execution_count": 8, + "outputs": [ + { + "output_type": "stream", + "name": "stderr", + "text": [ + "WARNING:prepare_data:Cleaned email file already exists, using existing file /content/PanzaMail/data/david_anonymous_clean.jsonl. If you want to regenerate use the flag force_extract_clean_emails=true.\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "import hydra\n", + "from panza import PanzaWriter\n", + "\n", + "writer: PanzaWriter = hydra.utils.instantiate(cfg.writer)\n", + "assert isinstance(writer, PanzaWriter), \"Failed to instantiate PanzaWriter\"" + ], + "metadata": { + "id": "oMQdnSXpnMyD", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 49, + "referenced_widgets": [ + "757e2134f09443c994353bee5dc7d209", + "261c147c241e45a6bfd1ac36706b92c6", + "fe93408da05c41058a12e5166ac00af5", + "014a4d4475c0468082282cafeb433654", + "099661f4d7d44adc8601374d6b11bb77", + "2e4f4c0fb6574fde9d87032e8a863705", + "f0640959af9847289a34809035450bf9", + "1973deb9a321449f973e8b4219d092ce", + "021d7dbcbc0a4d19bf0fd095a244a10f", + "f6b68f408ec148f3a14af081beb6f6ee", + "0d3fdb6795d140bf89157b8c3858b584" + ] + }, + "outputId": "29dbc44a-ca73-478a-ca92-cfe4f57b2f49" + }, + "execution_count": 9, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "Loading checkpoint shards: 0%| | 0/2 [00:00 0:\n", + " prepare_raft_emails(\n", + " os.path.join(cfg.user.data_dir, \"train.jsonl\"),\n", + " cfg.rag_embedding_model,\n", + " cfg.rag_db_dir,\n", + " cfg.user.username,\n", + " cfg.number_rag_emails_to_cache_with_train_data,\n", + " write_back_to_same_loc=True,\n", + " )" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "650oxh9LptC_", + "outputId": "c7508d49-52f1-483c-bdad-191e4372ee8c" + }, + "execution_count": 11, + "outputs": [ + { + "metadata": { + "tags": null + }, + "name": "stdout", + "output_type": "stream", + "text": [ + "--> # emails = 166\n" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stderr", + "output_type": "stream", + "text": [ + "\r 0%| | 0/21 [00:00 Processing batch 1/21\n" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stderr", + "output_type": "stream", + "text": [ + "\r 5%|▍ | 1/21 [00:23<07:44, 23.22s/it]" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stdout", + "output_type": "stream", + "text": [ + "--> Processing batch 2/21\n" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stderr", + "output_type": "stream", + "text": [ + "\r 10%|▉ | 2/21 [00:45<07:07, 22.49s/it]" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stdout", + "output_type": "stream", + "text": [ + "--> Processing batch 3/21\n" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stderr", + "output_type": "stream", + "text": [ + "\r 14%|█▍ | 3/21 [01:02<06:05, 20.33s/it]" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stdout", + "output_type": "stream", + "text": [ + "--> Processing batch 4/21\n" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stderr", + "output_type": "stream", + "text": [ + "\r 19%|█▉ | 4/21 [01:18<05:13, 18.43s/it]" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stdout", + "output_type": "stream", + "text": [ + "--> Processing batch 5/21\n" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stderr", + "output_type": "stream", + "text": [ + "\r 24%|██▍ | 5/21 [01:34<04:38, 17.43s/it]" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stdout", + "output_type": "stream", + "text": [ + "--> Processing batch 6/21\n" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stderr", + "output_type": "stream", + "text": [ + "\r 29%|██▊ | 6/21 [01:51<04:21, 17.41s/it]" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stdout", + "output_type": "stream", + "text": [ + "--> Processing batch 7/21\n" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stderr", + "output_type": "stream", + "text": [ + "\r 33%|███▎ | 7/21 [02:08<04:02, 17.33s/it]" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stdout", + "output_type": "stream", + "text": [ + "--> Processing batch 8/21\n" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stderr", + "output_type": "stream", + "text": [ + "\r 38%|███▊ | 8/21 [02:23<03:35, 16.56s/it]" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stdout", + "output_type": "stream", + "text": [ + "--> Processing batch 9/21\n" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stderr", + "output_type": "stream", + "text": [ + "\r 43%|████▎ | 9/21 [02:38<03:12, 16.01s/it]" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stdout", + "output_type": "stream", + "text": [ + "--> Processing batch 10/21\n" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stderr", + "output_type": "stream", + "text": [ + "\r 48%|████▊ | 10/21 [03:00<03:16, 17.82s/it]" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stdout", + "output_type": "stream", + "text": [ + "--> Processing batch 11/21\n" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stderr", + "output_type": "stream", + "text": [ + "\r 52%|█████▏ | 11/21 [03:22<03:10, 19.09s/it]" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stdout", + "output_type": "stream", + "text": [ + "--> Processing batch 12/21\n" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stderr", + "output_type": "stream", + "text": [ + "\r 57%|█████▋ | 12/21 [03:36<02:38, 17.59s/it]" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stdout", + "output_type": "stream", + "text": [ + "--> Processing batch 13/21\n" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stderr", + "output_type": "stream", + "text": [ + "\r 62%|██████▏ | 13/21 [03:51<02:13, 16.71s/it]" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stdout", + "output_type": "stream", + "text": [ + "--> Processing batch 14/21\n" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stderr", + "output_type": "stream", + "text": [ + "\r 67%|██████▋ | 14/21 [04:12<02:07, 18.22s/it]" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stdout", + "output_type": "stream", + "text": [ + "--> Processing batch 15/21\n" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stderr", + "output_type": "stream", + "text": [ + "\r 71%|███████▏ | 15/21 [04:27<01:43, 17.19s/it]" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stdout", + "output_type": "stream", + "text": [ + "--> Processing batch 16/21\n" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stderr", + "output_type": "stream", + "text": [ + "\r 76%|███████▌ | 16/21 [04:43<01:23, 16.75s/it]" + ] + }, + { + "metadata": { + "tags": null + }, + "name": "stdout", + "output_type": "stream", + "text": [ + "--> Processing batch 17/21\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 81%|████████ | 17/21 [05:01<01:09, 17.30s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 18/21\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 86%|████████▌ | 18/21 [05:22<00:55, 18.41s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 19/21\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 90%|█████████ | 19/21 [05:37<00:34, 17.34s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 20/21\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 95%|█████████▌| 20/21 [05:51<00:16, 16.26s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 21/21\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 21/21 [06:07<00:00, 17.49s/it]\n", + "/content/PanzaMail/src/panza/data_preparation/rag.py:43: LangChainDeprecationWarning: The class `HuggingFaceEmbeddings` was deprecated in LangChain 0.2.2 and will be removed in 1.0. An updated version of the class exists in the :class:`~langchain-huggingface package and should be used instead. To use it run `pip install -U :class:`~langchain-huggingface` and import as `from :class:`~langchain_huggingface import HuggingFaceEmbeddings``.\n", + " embeddings_model = HuggingFaceEmbeddings(\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Loaded 166 emails.\n", + "Obtained 166 text chunks.\n", + "Creating vector DB...\n", + "Vector DB created in 27.67449402809143 seconds.\n", + "Vector DB index david_anonymous saved to /content/PanzaMail/data.\n", + "--> Reading emails from: /content/PanzaMail/data/train.jsonl\n", + "--> # emails = 166\n", + "Faiss index loaded \n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 0%| | 0/42 [00:00 Processing batch 0/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 2%|▏ | 1/42 [00:00<00:28, 1.44it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 4/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 5%|▍ | 2/42 [00:01<00:29, 1.37it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 8/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 7%|▋ | 3/42 [00:02<00:25, 1.51it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 12/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 10%|▉ | 4/42 [00:02<00:25, 1.48it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 16/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 12%|█▏ | 5/42 [00:03<00:23, 1.58it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 20/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 14%|█▍ | 6/42 [00:03<00:21, 1.64it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 24/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 17%|█▋ | 7/42 [00:04<00:21, 1.67it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 28/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 19%|█▉ | 8/42 [00:05<00:21, 1.58it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 32/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 21%|██▏ | 9/42 [00:05<00:21, 1.56it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 36/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 24%|██▍ | 10/42 [00:06<00:20, 1.57it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 40/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 26%|██▌ | 11/42 [00:07<00:21, 1.45it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 44/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 29%|██▊ | 12/42 [00:07<00:20, 1.49it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 48/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 31%|███ | 13/42 [00:08<00:19, 1.52it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 52/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 33%|███▎ | 14/42 [00:09<00:17, 1.61it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 56/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 36%|███▌ | 15/42 [00:09<00:16, 1.66it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 60/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 38%|███▊ | 16/42 [00:10<00:15, 1.71it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 64/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 40%|████ | 17/42 [00:10<00:13, 1.80it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 68/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 43%|████▎ | 18/42 [00:11<00:12, 1.89it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 72/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 45%|████▌ | 19/42 [00:11<00:12, 1.78it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 76/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 48%|████▊ | 20/42 [00:12<00:12, 1.70it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 80/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 50%|█████ | 21/42 [00:13<00:12, 1.63it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 84/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 52%|█████▏ | 22/42 [00:14<00:14, 1.38it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 88/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 55%|█████▍ | 23/42 [00:14<00:12, 1.50it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 92/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 57%|█████▋ | 24/42 [00:15<00:11, 1.58it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 96/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 60%|█████▉ | 25/42 [00:15<00:10, 1.64it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 100/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 62%|██████▏ | 26/42 [00:16<00:09, 1.72it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 104/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 64%|██████▍ | 27/42 [00:16<00:08, 1.72it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 108/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 67%|██████▋ | 28/42 [00:17<00:09, 1.45it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 112/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 69%|██████▉ | 29/42 [00:18<00:08, 1.47it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 116/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 71%|███████▏ | 30/42 [00:19<00:08, 1.45it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 120/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 74%|███████▍ | 31/42 [00:19<00:08, 1.34it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 124/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 76%|███████▌ | 32/42 [00:20<00:07, 1.39it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 128/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 79%|███████▊ | 33/42 [00:21<00:06, 1.38it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 132/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 81%|████████ | 34/42 [00:21<00:05, 1.51it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 136/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 83%|████████▎ | 35/42 [00:22<00:04, 1.53it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 140/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 86%|████████▌ | 36/42 [00:22<00:03, 1.67it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 144/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 88%|████████▊ | 37/42 [00:23<00:03, 1.62it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 148/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 90%|█████████ | 38/42 [00:24<00:02, 1.73it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 152/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 93%|█████████▎| 39/42 [00:24<00:01, 1.80it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 156/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 95%|█████████▌| 40/42 [00:25<00:01, 1.84it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 160/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 98%|█████████▊| 41/42 [00:25<00:00, 1.83it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "--> Processing batch 164/166\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 42/42 [00:25<00:00, 1.62it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "25.92 seconds to process 166 emails.\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "from hydra import initialize, compose\n", + "from omegaconf import OmegaConf as om\n", + "from omegaconf import OmegaConf, open_dict\n", + "from hydra.core.hydra_config import HydraConfig\n", + "sys.path.append(os.path.abspath(os.path.join('../src')))\n", + "\n", + "config_dir = \"./configs\"\n", + "\n", + "with initialize(version_base=\"1.1\", config_path=config_dir):\n", + " cfg = compose(config_name=\"panza_finetuning.yaml\")\n", + " OmegaConf.set_struct(cfg, False)\n", + " cfg.panza_workspace = os.getcwd()\n", + " om.resolve(cfg)\n", + " cfg.preprocessing.model = cfg.finetuning.model_name_or_path\n", + " prompting_config = cfg.preprocessing.prompting" + ], + "metadata": { + "id": "hXT_fyfebGF6" + }, + "execution_count": 12, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "max_seq_length = 512\n", + "dtype = None\n", + "load_in_4bit = True\n", + "load_in_8bit = False" + ], + "metadata": { + "id": "BM-atEmIOCht" + }, + "execution_count": 13, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "model, tokenizer = FastLanguageModel.from_pretrained(\n", + " model_name = \"unsloth/llama-3-8b-Instruct-bnb-4bit\",\n", + " max_seq_length = max_seq_length,\n", + " dtype = dtype,\n", + " full_finetuning = False,\n", + " load_in_4bit = load_in_4bit,\n", + " load_in_8bit = load_in_8bit,\n", + ")\n", + "\n", + "model = FastLanguageModel.get_peft_model(\n", + " model,\n", + " r = 16, # Choose any number > 0 ! Suggested 8, 16, 32, 64, 128\n", + " target_modules = [\"q_proj\", \"k_proj\", \"v_proj\", \"o_proj\",\n", + " \"gate_proj\", \"up_proj\", \"down_proj\",],\n", + " lora_alpha = 16,\n", + " lora_dropout = 0, # Supports any, but = 0 is optimized\n", + " bias = \"none\", # Supports any, but = \"none\" is optimized\n", + " use_gradient_checkpointing = \"unsloth\", # True or \"unsloth\" for very long context\n", + " random_state = 3407,\n", + " use_rslora = False, # rank stabilized LoRA\n", + " loftq_config = None, # LoftQ\n", + ")\n", + "\n", + "prompt_builder = hydra.utils.instantiate(prompting_config)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "8Owv9Xm-wXnk", + "outputId": "53a8d8ba-3f56-4451-9a47-8cdecb29d732" + }, + "execution_count": 14, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "==((====))== Unsloth 2025.5.7: Fast Llama patching. Transformers: 4.51.3.\n", + " \\\\ /| Tesla T4. Num GPUs = 1. Max memory: 14.741 GB. Platform: Linux.\n", + "O^O/ \\_/ \\ Torch: 2.6.0+cu124. CUDA: 7.5. CUDA Toolkit: 12.4. Triton: 3.2.0\n", + "\\ / Bfloat16 = FALSE. FA [Xformers = 0.0.29.post3. FA2 = False]\n", + " \"-____-\" Free license: http://github.com/unslothai/unsloth\n", + "Unsloth: Fast downloading is enabled - ignore downloading bars which are red colored!\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "Unsloth 2025.5.7 patched 32 layers with 32 QKV layers, 32 O layers and 32 MLP layers.\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "def panza_preprocessing_function(inputs):\n", + " try:\n", + " prompt_raw = inputs[\"summary\"].split(\"\\n\\nInstruction: \")[-1]\n", + " instruction = EmailInstruction(instruction=prompt_raw, thread=inputs.get(\"thread\", []))\n", + " prompt = prompt_builder.build_prompt(instruction)\n", + " conversation = [\n", + " {\"role\": \"user\", \"content\": prompt},\n", + " {\"role\": \"assistant\", \"content\": inputs[\"email\"]},\n", + " ]\n", + " chat_prompt = tokenizer.apply_chat_template(conversation, tokenize=False)\n", + " response_begin_index = chat_prompt.index(inputs[\"email\"].strip())\n", + "\n", + " prompt = chat_prompt[:response_begin_index]\n", + " response = chat_prompt[response_begin_index:]\n", + "\n", + " return {\n", + " \"prompt\": prompt,\n", + " \"response\": response,\n", + " \"text\": prompt + response,\n", + " }\n", + " except Exception as e:\n", + " raise ValueError(f\"Unable to extract prompt/response from {inputs}\") from e\n" + ], + "metadata": { + "id": "hP41rk0CwZl8" + }, + "execution_count": 15, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "def get_dataset(filename):\n", + " data = load_dataset(\n", + " path=\"json\",\n", + " data_files={\"train\":filename},\n", + " split=\"train\",\n", + " )\n", + " data = data.map(panza_preprocessing_function, remove_columns=data.column_names,batched = False)\n", + " return data\n", + "\n", + "train_dataset = get_dataset(\"./data/train.jsonl\")\n", + "test_dataset = get_dataset(\"./data/test.jsonl\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 145, + "referenced_widgets": [ + "cc95b85ddb28402c80b17707ad22f0b7", + "18bbdd291e154d1986e99cf85a12ae5d", + "b0beeb4e363c410a90a0035c7794a88e", + "3df10434312c400dbef72d0825697369", + "f308c3ff74fd40afa55266fd0b2deb14", + "ef712467d07c4d78b944df5e02b58517", + "5bf5c996ea9a4b03ba7de1c1ee8491c3", + "efb060fd32f448b1bb07cd1e9567c0f4", + "d8da90c9ac4c4a088d6c744e53ab7b80", + "8aab096c3bba48faac83025b3a0043c1", + "5bd45715b0f2425d8ca7ef5cb6789459", + "921902a9ffb54f8c8f1728a1c38277b1", + "262c0c8c34994f60882edbbb6672ff51", + "54aa02d647744cea9a2b551bfeae562e", + "e1fbac672afb4bd988e39db0e8177ec3", + "b84551b0f64f48858ae15cd155ce5daf", + "394ecebe42d0457fa634c9f3fbeb0444", + "575c5701c20a4e44ba42ea5b9f300277", + "b7a34db0b49d4e2088ad3db06d6b91f9", + "86a4423aa6c5451aa187c28a952e530d", + "da7ebc4bccba4c4d963766fbc39758ba", + "821ff68a9fe248f596f0fa584b2e83b5", + "6901669228e4443483721ef8ebdf74fa", + "0336e6a94e7b46ac8850e76e5391e2b1", + "58044a15d7cd4e1b810c09b8f567abd6", + "951b4bfb21204b6a8dff5b221e020e0c", + "f5d736ab164f4f728d67f70ede912f26", + "a0b8ebe67c3c48ea92d5b5dd7b21a80b", + "bce2fd045ad647829ddd3d11cf2d00c6", + "4158ed87d2fe4a3f8248f6383a9e42ea", + "b29448132eca4b1fa31737db8288a267", + "f7fe1d614a0340e0b1adcdeb2e7ca364", + "292883e9ee4b41a3ada4e557c4276743", + "fd06e08217c34601ae7e5324d68e5e02", + "90f2d2bac25d4289a37c7fc0b2f2e8bf", + "e7b5c95c9a5048dfbaabf7c1a047643f", + "2a2ee2cc44364403babcbd9bb02584b4", + "b56a3fd34cef4f7c9eea9b017399317e", + "fc87949ee843407786476a740a116dc3", + "d604ac4e799a411fa77cd562c8fef5af", + "bac64a6c0a184bee86302f5833c7f3b4", + "5619ae9cc17b4073a80573785bfa4386", + "1d150e07eb1545bda1db162033ca9f33", + "e59f0b019a284c2ea6edcf12eb5bdfa2" + ] + }, + "id": "EahJN_H9wZo7", + "outputId": "ac13fd39-dd54-4604-d0b1-b6dc0556ecce" + }, + "execution_count": 16, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "Generating train split: 0 examples [00:00, ? examples/s]" + ], + "application/vnd.jupyter.widget-view+json": { + "version_major": 2, + "version_minor": 0, + "model_id": "cc95b85ddb28402c80b17707ad22f0b7" + } + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "Map: 0%| | 0/166 [00:00" + ], + "text/html": [ + "\n", + "
\n", + " \n", + " \n", + " [140/140 16:52, Epoch 6/7]\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
StepTraining Loss
13.642700
23.558800
33.532300
43.369400
53.213700
62.994400
72.549200
82.337100
92.307300
102.123600
111.825700
121.633600
131.799800
141.456300
151.314000
161.366100
171.141200
181.039700
191.290200
201.093400
211.861400
220.858500
231.290900
241.081900
251.008400
260.922800
270.988500
280.980600
290.863500
300.989100
310.931400
320.956300
330.872500
340.789500
351.221200
360.846400
371.061300
380.980100
391.008500
400.876300
411.623000
420.880000
430.951300
440.914900
450.863200
460.738900
470.836500
480.806900
490.840500
500.941100
510.914200
520.684500
531.032100
540.658900
550.866200
560.829200
571.128400
580.824600
590.769200
600.859200
611.677900
620.743900
630.815500
640.658900
650.741000
660.723800
670.744600
680.570600
690.812400
700.861200
710.683800
720.626500
730.692700
740.838200
750.846500
760.798100
770.697900
780.727300
790.604600
800.696800
811.304100
820.658500
830.715600
840.839100
850.509700
860.663500
870.619100
880.527000
890.586400
900.563500
910.636900
920.899100
930.562400
940.578200
950.712600
960.626200
970.623000
980.562900
990.687200
1000.633800
1011.133700
1020.601400
1030.479500
1040.456900
1050.499600
1060.636700
1070.495000
1080.435600
1090.770900
1100.588900
1110.599500
1120.601500
1130.477000
1140.548900
1150.662000
1160.496800
1170.429200
1180.549800
1190.455000
1200.452600
1210.800600
1220.374300
1230.495900
1240.458000
1250.349200
1260.578700
1270.373400
1280.615900
1290.386100
1300.510600
1310.375500
1320.686300
1330.497900
1340.477600
1350.497100
1360.458300
1370.462500
1380.395400
1390.555900
1400.386800

" + ] + }, + "metadata": {} + } + ] + }, + { + "cell_type": "code", + "source": [ + "FastLanguageModel.for_inference(model)\n", + "streamer = TextStreamer(tokenizer, skip_prompt=True)\n", + "rouge_scores = []\n", + "mauve_scores = []\n", + "bleu_scores = []\n", + "golden_responses = []\n", + "panza_responses = []\n", + "count = 0\n", + "dataset = test_dataset" + ], + "metadata": { + "id": "Hr_S0CVEyjFL" + }, + "execution_count": 18, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "def do_compute_metrics(all_responses):\n", + " for response in all_responses:\n", + " response[\"scores\"] = {}\n", + " response[\"scores\"][\"BLEU\"] = compute_bleu_scores(\n", + " response[\"panza_responses\"], response[\"golden_responses\"]\n", + " )\n", + " response[\"scores\"][\"ROUGE\"] = compute_rouge_scores(\n", + " response[\"panza_responses\"], response[\"golden_responses\"]\n", + " )\n", + " rouge_categories = all_responses[0][\"scores\"][\"ROUGE\"][0].keys()\n", + " aggregate_metrics = {\n", + " \"BLEU\": np.mean([s for r in all_responses for s in r[\"scores\"][\"BLEU\"]]),\n", + " \"ROUGE\": {\n", + " cat: np.mean([s[cat] for r in all_responses for s in r[\"scores\"][\"ROUGE\"]])\n", + " for cat in rouge_categories\n", + " },\n", + " \"MAUVE\": compute_mauve_score(\n", + " [r[\"panza_responses\"] for r in all_responses],\n", + " [r[\"golden_responses\"] for r in all_responses],\n", + " ).mauve,\n", + " }\n", + " print(\"########## Aggregated quality metrics ##########\\n\")\n", + " print(json.dumps(aggregate_metrics, indent=2))\n", + " return {\"responses\": all_responses, \"aggregate_metrics\": aggregate_metrics}\n" + ], + "metadata": { + "id": "Jcirs_yDyjIc" + }, + "execution_count": 19, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "for x in dataset:\n", + " inputs = tokenizer(x['prompt'], return_tensors=\"pt\",)\n", + " input_ids = inputs[\"input_ids\"].to(model.device)\n", + " attention_mask = inputs[\"attention_mask\"].to(model.device)\n", + " output = model.generate(input_ids, max_new_tokens = 256, attention_mask=attention_mask)\n", + " output_text = tokenizer.decode(output[0], skip_special_tokens=True)\n", + " panza_responses = [re.sub(r\"^Subject:.*\\n\", \"\", resp, flags=re.IGNORECASE) for resp in panza_responses]\n", + " golden_responses.append(x['response'].rstrip().removesuffix(\"<|eot_id|>\"))\n", + " panza_responses.append(output_text.split(\"assistant\\n\")[-1].strip())\n", + "\n", + "panza_responses = [resp.rstrip().removesuffix(\"<|eotid|>\") for resp in panza_responses]\n", + "golden_responses = [resp.split(\"assistant\")[-1].strip() for resp in golden_responses]\n", + "all_responses = [\n", + " {\"panza_responses\": [pred], \"golden_responses\": [gold]}\n", + " for pred, gold in zip(panza_responses, golden_responses)\n", + "]\n", + "data = {\n", + " \"panza_response\": panza_responses,\n", + " \"golden_response\": golden_responses\n", + "}\n", + "\n", + "df = pd.DataFrame(data)\n", + "do_compute_metrics(all_responses)" + ], + "metadata": { + "id": "Nfr8MHPvzENb", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000, + "referenced_widgets": [ + "579e8bd62d924e09acdbc7f767d248ee", + "e29e1faca7d742f2854d603eca2a4f31", + "415031218baf4d1db7594d250a1241ab", + "e4584935c484463c90d13fe070f86bbb", + "145dbd02302241e6870018af35f368bf", + "00fff41f774c4c40829cb5d83e1c6bc7", + "30965c882e4f411faf19a8a4cb583bd0", + "fc67b06adf97402e82621f47e34fb3bf", + "11879b21ec1e4fa6840452e06812dda1", + "56da4c7d9bc84892b959333090051813", + "bbc91e26076242d78feb2b5b0b32acd4", + "f8492c624a2e4b07b241671d6bb3403b", + "c3f2f48393fa4b9083329a2a9aafa60a", + "49d471cd44f347809eb044785477ccbb", + "1cd47be7fe6a499faa48e4eac48c92fa", + "446d1b618b4e40bc847f61128eafca19", + "a53987ad5da44c5c9d1473fd4161693d", + "f1f999d590ff42aca914d2b6991b3ebf", + "cd230a8e262f44f391643461945a9661", + "d893d3060b4944c1907cf7fe2dfa9ca7", + "71867253cf6d4498aa3f95442f63e12c", + "350e68d979774a7a8512af120a709b2c" + ] + }, + "outputId": "c6bd5541-ff56-48ca-df8b-535bbb3ad652" + }, + "execution_count": 20, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Loading tokenizer\n", + "Tokenizing text...\n", + "Loading tokenizer\n", + "Loading model\n", + "Featurizing tokens\n" + ] + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "Featurizing p: 0%| | 0/166 [00:00