{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [], "collapsed_sections": [ "xtifkCveWLeU", "5-eapEpISBik", "1hjeAlZ5Ji7K", "8zDgHemnPiT0", "5jVoDwbbTYv1", "h3j7S9naWwSV", "roiJNbfdEdNm" ] }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "ae323dbe1a464e348fddf60b6cae7181": { "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_38725e3450f340deb3d807f8b8fa5281", "IPY_MODEL_a01ea19b883f4322852252dc4e59761f", "IPY_MODEL_4ba9a1dda2d24987a59765a42364e05d" ], "layout": "IPY_MODEL_669f52cb678c466382444f36e5b914d0" } }, "38725e3450f340deb3d807f8b8fa5281": { "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_4d1b22d254fe4502b151b67a8b27d384", "placeholder": "​", "style": "IPY_MODEL_523b5c5952f3498ba1c69d4b3d5bdcf8", "value": "preprocessor_config.json: 100%" } }, "a01ea19b883f4322852252dc4e59761f": { "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_c3770228dd13461496690eefaf918ee6", "max": 266, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_6784388a77f5491bb7b867931ab342b3", "value": 266 } }, "4ba9a1dda2d24987a59765a42364e05d": { "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_12474dc62e6f429ab55c82d9b1d30ee4", "placeholder": "​", "style": "IPY_MODEL_e42c82a3e6c74b36a89bcd9794cc7730", "value": " 266/266 [00:00<00:00, 15.9kB/s]" } }, "669f52cb678c466382444f36e5b914d0": { "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 } }, "4d1b22d254fe4502b151b67a8b27d384": { "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 } }, "523b5c5952f3498ba1c69d4b3d5bdcf8": { "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": "" } }, "c3770228dd13461496690eefaf918ee6": { "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 } }, "6784388a77f5491bb7b867931ab342b3": { "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": "" } }, "12474dc62e6f429ab55c82d9b1d30ee4": { "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 } }, "e42c82a3e6c74b36a89bcd9794cc7730": { "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": "" } }, "94fe94b7f9a74e0caa6f54f8a3f8c0cf": { "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_6f40c975179f4f759df2052e89e9b236", "IPY_MODEL_5e7b1a2417ef44a78f5659906b527d8f", "IPY_MODEL_fab2fe2bf9fc43009f57611bb924f1d6" ], "layout": "IPY_MODEL_1a347eacc39443f8b13a499268eb2b71" } }, "6f40c975179f4f759df2052e89e9b236": { "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_9ffb25685adc4b69a461ee6d6dbaad11", "placeholder": "​", "style": "IPY_MODEL_23719cc21c9e49a7b4781454a83ded9c", "value": "config.json: 100%" } }, "5e7b1a2417ef44a78f5659906b527d8f": { "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_1f83698710e3423db5c96828c611a665", "max": 69556, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_ee4ee6b9f44e4609b6936f1cc672df5a", "value": 69556 } }, "fab2fe2bf9fc43009f57611bb924f1d6": { "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_20288382b2444e00a7da6fa8b5b9c35f", "placeholder": "​", "style": "IPY_MODEL_343af96deeda429194b13460455731c3", "value": " 69.6k/69.6k [00:00<00:00, 364kB/s]" } }, "1a347eacc39443f8b13a499268eb2b71": { "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 } }, "9ffb25685adc4b69a461ee6d6dbaad11": { "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 } }, "23719cc21c9e49a7b4781454a83ded9c": { "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": "" } }, "1f83698710e3423db5c96828c611a665": { "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 } }, "ee4ee6b9f44e4609b6936f1cc672df5a": { "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": "" } }, "20288382b2444e00a7da6fa8b5b9c35f": { "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 } }, "343af96deeda429194b13460455731c3": { "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": "" } }, "1bfedbd135ac47f197ee622ce91e4ac2": { "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_506b1e0ce0a248d5b98a3d843d7e78a9", "IPY_MODEL_c72b1e6b69a142298a1ed258e80f2760", "IPY_MODEL_b6fdd9cd8f4a4fc085b1ab08ca216a46" ], "layout": "IPY_MODEL_73be00c1b1df49c4a9a177740c8321e3" } }, "506b1e0ce0a248d5b98a3d843d7e78a9": { "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_46d74949b09e47c79357d4f882e2dbba", "placeholder": "​", "style": "IPY_MODEL_4f9e7454b0f94b4ca0038e934ab375da", "value": "model.safetensors: 100%" } }, "c72b1e6b69a142298a1ed258e80f2760": { "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_3ec02d00546f4a09a3e0d1676185ebcc", "max": 102482854, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_8a987131cbc94c6c8b248fed3fb3390e", "value": 102482854 } }, "b6fdd9cd8f4a4fc085b1ab08ca216a46": { "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_5280e8c01342499fb90e62ec9588e824", "placeholder": "​", "style": "IPY_MODEL_e0931c9e945a42c9af45aa766668699c", "value": " 102M/102M [00:00<00:00, 159MB/s]" } }, "73be00c1b1df49c4a9a177740c8321e3": { "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 } }, "46d74949b09e47c79357d4f882e2dbba": { "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 } }, "4f9e7454b0f94b4ca0038e934ab375da": { "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": "" } }, "3ec02d00546f4a09a3e0d1676185ebcc": { "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 } }, "8a987131cbc94c6c8b248fed3fb3390e": { "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": "" } }, "5280e8c01342499fb90e62ec9588e824": { "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 } }, "e0931c9e945a42c9af45aa766668699c": { "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": "" } }, "e99d8993a3de4335acfd88a916cec1bd": { "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_870db462077d41c4994136b83133eedd", "IPY_MODEL_951b722980b4498fbf4d7c7372b171cd", "IPY_MODEL_ba71825d3cc54da5af833ea6b4f9d6e3" ], "layout": "IPY_MODEL_72693d2d0010433182e008e724d1e770" } }, "870db462077d41c4994136b83133eedd": { "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_ce0a0a69a02946898b85a80ec0586cc4", "placeholder": "​", "style": "IPY_MODEL_1686adf30b4440de8b0f6393895b2af3", "value": "config.json: 100%" } }, "951b722980b4498fbf4d7c7372b171cd": { "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_b180cfd6bc6a465bafe585251f5edb01", "max": 629, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_285ecdbaa68341d1b2cecd40c77e11b6", "value": 629 } }, "ba71825d3cc54da5af833ea6b4f9d6e3": { "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_eddb2459839f4108bc3425e49c9dad3d", "placeholder": "​", "style": "IPY_MODEL_88e88bca01754cdc9ba2821c6d616a56", "value": " 629/629 [00:00<00:00, 14.3kB/s]" } }, "72693d2d0010433182e008e724d1e770": { "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 } }, "ce0a0a69a02946898b85a80ec0586cc4": { "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 } }, "1686adf30b4440de8b0f6393895b2af3": { "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": "" } }, "b180cfd6bc6a465bafe585251f5edb01": { "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 } }, "285ecdbaa68341d1b2cecd40c77e11b6": { "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": "" } }, "eddb2459839f4108bc3425e49c9dad3d": { "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 } }, "88e88bca01754cdc9ba2821c6d616a56": { "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": "" } }, "5b05f4a2d10b43529e4cbac04fb4b4bd": { "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_22b410db4cfb4dcebea1fa62b1fe525d", "IPY_MODEL_09ca1345826247ceb467224ec6036755", "IPY_MODEL_9ce892afbd7147d4940c9e123a61d734" ], "layout": "IPY_MODEL_b140aeaff5914630b340c281e8cf8b7b" } }, "22b410db4cfb4dcebea1fa62b1fe525d": { "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_4a2c2c7efe8a41a0960cf8cf4c66c597", "placeholder": "​", "style": "IPY_MODEL_a963388490bd4984a33493d5afec3f4d", "value": "model.safetensors: 100%" } }, "09ca1345826247ceb467224ec6036755": { "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_4f794bf9f8f045cba1e7f024cf96cfb3", "max": 267832558, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_76ddd37781664c5d810245c2378bb3fa", "value": 267832558 } }, "9ce892afbd7147d4940c9e123a61d734": { "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_78e31616065e4af9b10abfe1545362a0", "placeholder": "​", "style": "IPY_MODEL_bddbde48046b4a99856105fe5f404d3c", "value": " 268M/268M [00:02<00:00, 120MB/s]" } }, "b140aeaff5914630b340c281e8cf8b7b": { "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 } }, "4a2c2c7efe8a41a0960cf8cf4c66c597": { "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 } }, "a963388490bd4984a33493d5afec3f4d": { "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": "" } }, "4f794bf9f8f045cba1e7f024cf96cfb3": { "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 } }, "76ddd37781664c5d810245c2378bb3fa": { "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": "" } }, "78e31616065e4af9b10abfe1545362a0": { "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 } }, "bddbde48046b4a99856105fe5f404d3c": { "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": "" } }, "22ce43b857c84b4aa45e6f66e0e89380": { "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_13c699e0a1ae4848b307b06872a44ab9", "IPY_MODEL_de533dbd5b9d489a84ed225ff875b9eb", "IPY_MODEL_a2b18eff1e084b1aaff6e46b614fe8ae" ], "layout": "IPY_MODEL_bffcae4563804c4cb0ca583c4fd242df" } }, "13c699e0a1ae4848b307b06872a44ab9": { "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_70b8a3617b9840e293de99aee3181505", "placeholder": "​", "style": "IPY_MODEL_24ca25272e2144e9b6c45c4549b1d191", "value": "tokenizer_config.json: 100%" } }, "de533dbd5b9d489a84ed225ff875b9eb": { "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_aa285a657c97403780a3c879738d2d53", "max": 48, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_0c12ede2e96b4774b1aab90832b02ec1", "value": 48 } }, "a2b18eff1e084b1aaff6e46b614fe8ae": { "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_e9f3d794824041938616310f04597375", "placeholder": "​", "style": "IPY_MODEL_6ea3d7a37d014926801ff53e98c70858", "value": " 48.0/48.0 [00:00<00:00, 1.56kB/s]" } }, "bffcae4563804c4cb0ca583c4fd242df": { "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 } }, "70b8a3617b9840e293de99aee3181505": { "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 } }, "24ca25272e2144e9b6c45c4549b1d191": { "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": "" } }, "aa285a657c97403780a3c879738d2d53": { "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 } }, "0c12ede2e96b4774b1aab90832b02ec1": { "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": "" } }, "e9f3d794824041938616310f04597375": { "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 } }, "6ea3d7a37d014926801ff53e98c70858": { "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": "" } }, "dcf13204571740e19778b60387d551b4": { "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_bdaa3cb1b58846bc92303eb02c3cb3e5", "IPY_MODEL_29c67b9701884e80b23e2fce6b3fb432", "IPY_MODEL_bf3e47f63e3e48e38a438972cd278a1a" ], "layout": "IPY_MODEL_ecc76cd452df470dac87b4d29059981c" } }, "bdaa3cb1b58846bc92303eb02c3cb3e5": { "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_664f8b46de1a483baf7dbbda27ceec1f", "placeholder": "​", "style": "IPY_MODEL_6cd5857383174e71b286a1bafefa3a03", "value": "vocab.txt: 100%" } }, "29c67b9701884e80b23e2fce6b3fb432": { "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_75bdbecaf20e4cb5aa5303fecfe7665c", "max": 231508, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_94894035b9cc433c86d5687da1a65806", "value": 231508 } }, "bf3e47f63e3e48e38a438972cd278a1a": { "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_a668ab36c91f4d36a47a54e45ba3cc79", "placeholder": "​", "style": "IPY_MODEL_3c665998e79d4ec9b19b4c5f47e0301d", "value": " 232k/232k [00:00<00:00, 382kB/s]" } }, "ecc76cd452df470dac87b4d29059981c": { "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 } }, "664f8b46de1a483baf7dbbda27ceec1f": { "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 } }, "6cd5857383174e71b286a1bafefa3a03": { "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": "" } }, "75bdbecaf20e4cb5aa5303fecfe7665c": { "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 } }, "94894035b9cc433c86d5687da1a65806": { "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": "" } }, "a668ab36c91f4d36a47a54e45ba3cc79": { "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 } }, "3c665998e79d4ec9b19b4c5f47e0301d": { "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": [ "### Installation" ], "metadata": { "id": "xtifkCveWLeU" } }, { "cell_type": "code", "execution_count": 1, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "nbesmheXR8nF", "outputId": "5165b5e6-dbb6-4dba-b492-91c7996b7355" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m12.3/12.3 MB\u001b[0m \u001b[31m52.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m92.0/92.0 kB\u001b[0m \u001b[31m6.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m318.1/318.1 kB\u001b[0m \u001b[31m17.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.6/75.6 kB\u001b[0m \u001b[31m6.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m142.7/142.7 kB\u001b[0m \u001b[31m4.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m8.8/8.8 MB\u001b[0m \u001b[31m30.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.4/62.4 kB\u001b[0m \u001b[31m6.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m129.9/129.9 kB\u001b[0m \u001b[31m6.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m77.9/77.9 kB\u001b[0m \u001b[31m6.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m4.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m71.9/71.9 kB\u001b[0m \u001b[31m5.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m53.6/53.6 kB\u001b[0m \u001b[31m4.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m307.7/307.7 kB\u001b[0m \u001b[31m32.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m341.4/341.4 kB\u001b[0m \u001b[31m36.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.4/3.4 MB\u001b[0m \u001b[31m84.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.2/1.2 MB\u001b[0m \u001b[31m21.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25h Building wheel for ffmpy (setup.py) ... \u001b[?25l\u001b[?25hdone\n" ] } ], "source": [ "!pip install gradio -q" ] }, { "cell_type": "code", "source": [ "import gradio as gr" ], "metadata": { "id": "aAmsRz2ISYbA" }, "execution_count": 2, "outputs": [] }, { "cell_type": "markdown", "source": [ "### Gradio Components" ], "metadata": { "id": "5-eapEpISBik" } }, { "cell_type": "code", "source": [ "def add_numbers(x,y):\n", " return x+y" ], "metadata": { "id": "pjhBgpMpSC8P" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# iface = gr.Interface(fn=add_numbers,\n", "# inputs=[gr.Number(10), gr.Number()],\n", "# outputs=gr.Number()\n", "# )\n", "\n", "# iface.launch()" ], "metadata": { "id": "E8e--uWbSlUf" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "def reverse_text(input_text):\n", " return input_text[::-1]" ], "metadata": { "id": "yvNSRG_RTPit" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "reverse_text(\"Hello\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 35 }, "id": "aqfKsV2iUZUG", "outputId": "7b398b64-3304-4eb9-b0ab-2ab792d7d14a" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'olleH'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 8 } ] }, { "cell_type": "code", "source": [ "# iface = gr.Interface(fn=reverse_text, inputs = gr.Text(), outputs=gr.Text())\n", "# iface.launch()" ], "metadata": { "id": "t21gVGOzUaTG" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "def slider_example(value):\n", " return f\"Slider current value is: {value}\"" ], "metadata": { "id": "EM9vMBKCUk3L" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "slider_example(10)" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 35 }, "id": "vLWM3Ij_UwBY", "outputId": "b21725cb-8bde-46d8-bad8-9b467006eefa" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'Slider current value is: 10'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 12 } ] }, { "cell_type": "code", "source": [ "# iface = gr.Interface(fn=slider_example,\n", "# inputs= gr.Slider(minimum=0, maximum=1, step=0.1), outputs=gr.Text())\n", "# iface.launch()" ], "metadata": { "id": "JADLlJErUw6S" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "def drop_down(value):\n", " return f\"You selected {value}\"" ], "metadata": { "id": "HgSe3hS3U9_n" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# options = ['A', 'B', 'C']\n", "# iface = gr.Interface(fn=drop_down, inputs=gr.Dropdown(choices=options), outputs=gr.Text())\n", "# iface.launch()" ], "metadata": { "id": "eULi3NJcVdUt" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "from PIL import Image\n", "\n", "def convert(image_path):\n", " # Open the image\n", " image = Image.open(image_path)\n", "\n", " # Convert to grayscale\n", " return image.convert(\"L\")\n" ], "metadata": { "id": "jXvU-shbVtO4" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "convert(\"images.png\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 242 }, "id": "6hv19tmbXdkC", "outputId": "d81b100f-0f8c-415d-886c-a0bf2687663d" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "" ], "image/png": "iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAAAAAAb2I2mAAAfk0lEQVR4nO19aYxlx3Xed+q++16/vfee7uGQHHEoUR6TEhlKsmxSoikbVogYNhAjMZwfCaAggIE4yC8JiJAgDmIgUJAgAQQkQGL9SoIYCOJFWWzZHlMSA2ooiBzKIkWK5qbZ2NPre92vX9+lTuVH1V3ffXfp7hmyhTl/Zt7tW8tXdepsdaouKfyEk3i/O3Db6S7C0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IJSxBk3UTFFjBV0ZcER+O4/a6bD865ehMDtclMLLg+kwAEgqEGgjCpH8q7StAcTjATsCiD+3ujnRfyCgnNrqMRXthzn/FQOxFkpbIIhCBFEhBKUBBqhCcIj504znCLLuPTD11kbuu3v5BPKbBgu36TGzylDnXoXdnoaAifTA0e7Pez88B8Mbjw7F0PJ/h2RA1u2E1Z5pNGwC+e9200WnEHMVQuZiQU9hdUp7rJLwtyUsfzTn6VCA51n+0IZIgRcO2hcorR4g4yPtr9+XWDwCX9sIt+9wIECmC67sy6UxK3P9g7vctCmXj6J03kFhJLFjU7FpNIAMnKdLBBU3eT+XdeB/QnwafimLRnBFqIrhIUCCw5/keRGr6Zh8oGsIy0n/9nesiKS5YgIVVExbViGKcxL7vykjVeY+eL64dwKUoPYJFw6aaCKxOApTylSd9njAwJawHz+VOn66inBlx7d11MSETWYARWCpQ2kiJxpjVE/knAyO6EjvczkJXaurU50UnwhwSuP++7GNAKSod3PVuXMsAaToFTNrw3tnHyl8Ttvm8TMXbMus0JNm6756yo1fppob161flNJRJYtmdpp+mUFL/TicJ7p5by7vMJEVV76IYbW5d9wTyYRbI7yn0xmsyHyQr8OzK4ny1G+SqIgQAb3tncMsTyMLJCjx77p4qcfGINq9d9TJ5hBUY3YW5hQpzF9BREAIAvP3h/v5wlPQRYC/35yqOcZJGO5vbw3Sls+1ur1MsNbPpyAgNeb7nSk8CmEHTPtrUTVbquq4nAVh2vV4/zoDh+Ag/+HSE+MQpo7sITz/dRXj66S7C0093EZ5+uovw9NNdhKef7iI8/XQX4emnuwhPP91FePrpJx/h/wcwRv3+aQgiTgAAAABJRU5ErkJggg==\n" }, "metadata": {}, "execution_count": 4 } ] }, { "cell_type": "code", "source": [ "# iface = gr.Interface(fn=convert, inputs=gr.Image(type='filepath'), outputs=gr.Image())\n", "# iface.launch()" ], "metadata": { "id": "Z_TFzKWCkc1v" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "def number_details(number):\n", " details = {\n", " \"original\": number,\n", " \"squared\": number**2,\n", " \"sqrt\": number**0.5,\n", " \"is_even\": number % 2 == 0\n", " }\n", " return details" ], "metadata": { "id": "bT66iURGHRSE" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# iface = gr.Interface(fn=number_details, inputs=gr.Number(), outputs=gr.Json())\n", "# iface.launch()" ], "metadata": { "id": "T2kdSplhIrTt" }, "execution_count": 3, "outputs": [] }, { "cell_type": "code", "source": [ "def classify(number):\n", " if number > 0:\n", " return \"Positive\"\n", " elif number < 0:\n", " return \"Negative\"\n", " else:\n", " return \"Zero\"" ], "metadata": { "id": "mLFU-Q5lIyDr" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# iface = gr.Interface(fn=classify, inputs=gr.Number(), outputs=gr.Label())\n", "# iface.launch()" ], "metadata": { "id": "GFJMn0lZJOku" }, "execution_count": 4, "outputs": [] }, { "cell_type": "markdown", "source": [ "### Multiple Components and Layouts" ], "metadata": { "id": "1hjeAlZ5Ji7K" } }, { "cell_type": "code", "source": [ "# with gr.Blocks() as demo:\n", "# with gr.Row():\n", "# text1 = gr.Text(value='OUTPUT ONE')\n", "# text2 = gr.Text(value='OUTPUT TWO')\n", "# with gr.Row():\n", "# text3 = gr.Text(value='BOTTOM ROW')\n", "\n", "# demo.launch()" ], "metadata": { "id": "BZomdJosJT7t" }, "execution_count": 5, "outputs": [] }, { "cell_type": "code", "source": [ "# agar row define karke usme elements banao then ek k baju me ek chippak k\n", "# agar boht sare gr.Rows k andar elements banao then ek k niche ek\n", "# agar column define karke usme elements banao then ek k niche ek chippak k\n", "# agar boht sare gr.columns k andar elements banao then ek k baju me ek" ], "metadata": { "id": "doa3_FL0NXym" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# with gr.Blocks() as demo:\n", "# with gr.Row():\n", "# with gr.Column():\n", "# text1 = gr.Text('ROW 0 COL 0 - Comp 1')\n", "# text2 = gr.Text('ROW 0 COL 0 - Comp 2')\n", "# with gr.Column():\n", "# text3 = gr.Text('ROW 1 COL 1')\n", "# with gr.Row():\n", "# text5 = gr.Text(value='BOTTOM ROW')\n", "\n", "# demo.launch()" ], "metadata": { "id": "mJx1PEJYLCHW" }, "execution_count": 6, "outputs": [] }, { "cell_type": "code", "source": [ "# with gr.Blocks() as demo:\n", "# with gr.Row():\n", "# with gr.Column(scale=2):\n", "# text1 = gr.Text('ROW 0 COL 0 - Comp 1')\n", "# text2 = gr.Text('ROW 0 COL 0 - Comp 2')\n", "# with gr.Column(scale=1):\n", "# text3 = gr.Text('ROW 1 COL 1')\n", "# with gr.Row():\n", "# text5 = gr.Text(value='BOTTOM ROW')\n", "\n", "# demo.launch()" ], "metadata": { "id": "g3xkbBWhJlXb" }, "execution_count": 7, "outputs": [] }, { "cell_type": "code", "source": [ "# with gr.Blocks() as demo:\n", "# with gr.Tab('Tab One'):\n", "# with gr.Row():\n", "# with gr.Column(scale=2):\n", "# text1 = gr.Text('ROW 0 COL 0 - Comp 1')\n", "# text2 = gr.Text('ROW 0 COL 0 - Comp 2')\n", "# with gr.Column(scale=1):\n", "# text3 = gr.Text('ROW 1 COL 1')\n", "# with gr.Row():\n", "# text5 = gr.Text(value='BOTTOM ROW')\n", "# with gr.Tab('Tab Two'):\n", "# gr.Text('Welcome to new tab')\n", "\n", "# demo.launch()" ], "metadata": { "id": "XpfTjcZkOFvt" }, "execution_count": 8, "outputs": [] }, { "cell_type": "code", "source": [ "# with gr.Blocks() as demo:\n", "# gr.Label(\"Label Here\")\n", "# with gr.Accordion(\"Accordion Here\", open=False):\n", "# gr.Image()\n", "\n", "# demo.launch()" ], "metadata": { "id": "s5-UTgZOO7R8" }, "execution_count": 9, "outputs": [] }, { "cell_type": "markdown", "source": [ "### Gradio Components and Layouts - Part Two" ], "metadata": { "id": "8zDgHemnPiT0" } }, { "cell_type": "code", "source": [ "# with gr.Blocks() as demo:\n", "# with gr.Group():\n", "# gr.Button(\"Button Comp One\")\n", "# gr.Button(\"Button Comp Two\")\n", "# gr.Image()\n", "\n", "# gr.Image()\n", "\n", "# demo.launch()" ], "metadata": { "id": "EK4LgEpTPTV6" }, "execution_count": 10, "outputs": [] }, { "cell_type": "code", "source": [ "# css = \"\"\"\n", "# .yourclass {\n", "# height: 1000px;\n", "# background-color: red;\n", "# }\n", "# \"\"\"\n", "\n", "# with gr.Blocks(css=css) as demo:\n", "# with gr.Row(elem_classes=['yourclass']):\n", "# gr.Image()\n", "\n", "# demo.launch()" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 645 }, "id": "ER7ebRQ2QEK-", "outputId": "bfbfc194-5eae-41bc-e66f-15babc11c9f7" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Setting queue=True in a Colab notebook requires sharing enabled. Setting `share=True` (you can turn this off by setting `share=False` in `launch()` explicitly).\n", "\n", "Colab notebook detected. To show errors in colab notebook, set debug=True in launch()\n", "Running on public URL: https://601aa413e787e14a8a.gradio.live\n", "\n", "This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "" ], "text/html": [ "
" ] }, "metadata": {} }, { "output_type": "execute_result", "data": { "text/plain": [] }, "metadata": {}, "execution_count": 27 } ] }, { "cell_type": "markdown", "source": [ "### Gradio Interactions" ], "metadata": { "id": "5jVoDwbbTYv1" } }, { "cell_type": "code", "source": [ "#FUNCTION\n", "\n", "def multiply(x,y):\n", " return x*y" ], "metadata": { "id": "mlsZo258ThGJ" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# with gr.Blocks() as app:\n", "# with gr.Row():\n", "# x_slider = gr.Slider(label='X')\n", "# y_slider = gr.Slider(label='Y')\n", "# with gr.Row():\n", "# result = gr.Text()\n", "\n", "# x_slider.change(fn=multiply, inputs=[x_slider, y_slider], outputs=result)\n", "# y_slider.change(fn=multiply, inputs=[x_slider, y_slider], outputs=result)\n", "\n", "# app.launch()" ], "metadata": { "id": "reZg7wVcUGMq" }, "execution_count": 11, "outputs": [] }, { "cell_type": "code", "source": [ "with gr.Blocks() as app:\n", " with gr.Row():\n", " x_slider = gr.Slider(label='X')\n", " y_slider = gr.Slider(label='Y')\n", " with gr.Row():\n", " result = gr.Text()\n", " with gr.Row():\n", " button = gr.Button(\"Multiply\")\n", "\n", " button.click(fn=multiply, inputs=[x_slider, y_slider], outputs=[result])\n", "\n", "app.launch()" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 645 }, "id": "KrYp0GDJVBRr", "outputId": "95ceb122-7dd7-483a-d0b2-f85be24bfdf3" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Setting queue=True in a Colab notebook requires sharing enabled. Setting `share=True` (you can turn this off by setting `share=False` in `launch()` explicitly).\n", "\n", "Colab notebook detected. To show errors in colab notebook, set debug=True in launch()\n", "Running on public URL: https://b3180d4e201052c103.gradio.live\n", "\n", "This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "" ], "text/html": [ "
" ] }, "metadata": {} }, { "output_type": "execute_result", "data": { "text/plain": [] }, "metadata": {}, "execution_count": 7 } ] }, { "cell_type": "markdown", "source": [ "### Interactions Part Two" ], "metadata": { "id": "h3j7S9naWwSV" } }, { "cell_type": "code", "source": [ "from PIL import Image\n", "\n", "def make_grayscale(image_path):\n", " image = Image.open(image_path)\n", " image_grayscale = image.convert(\"L\")\n", "\n", " return image_grayscale, 'Image Converted'" ], "metadata": { "id": "bD2CwATsWzNL" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "image, log = make_grayscale(\"images.png\")" ], "metadata": { "id": "DUIVwzceXeqN" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "image" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 242 }, "id": "jSYaxwXPXkBo", "outputId": "8d928f3d-d1f8-4d73-900a-85e5c07581da" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "" ], "image/png": "iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAAAAAAb2I2mAAAfk0lEQVR4nO19aYxlx3Xed+q++16/vfee7uGQHHEoUR6TEhlKsmxSoikbVogYNhAjMZwfCaAggIE4yC8JiJAgDmIgUJAgAQQkQGL9SoIYCOJFWWzZHlMSA2ooiBzKIkWK5qbZ2NPre92vX9+lTuVH1V3ffXfp7hmyhTl/Zt7tW8tXdepsdaouKfyEk3i/O3Db6S7C0093EZ5+uovw9NNdhKef7iI8/XQX4emnuwhPP91FePrpJx9h7U415Lmu60EyICzMWPW6fYcavv0IR/vDvdGul2IXBuzZbr/Va97u9ul2RqLGW5vbuxCgKWuBFVgszC/eVpi3DaG3fuuqFLCK35Rg+9zq/O3i2tuDcHT16p6YNnNZxIpnz5+5LVN5GxCO333DE5lzxyL5b5Ikdy/cc/IzeeIIr/1odxIeQ8GCRZppJZRkRRmqSvLKhZUT7tDJIhy/9UZq5TGU1bCpblmUfJXZ99ShLyklYxV95IETnciTRDj84fXE9LGyGvV6nQCV0QxBEcCe6zoysWQl3//RE1yRJ4dw5wcbVqyjjGa9aassbKkOEPzx2I1PJcuzP90+qX6dFMLhyxsx3mLRbDVQumpShMPxOCaAWJ595ITm8WQQeleuhvPHQLvVQHl8QU9wODqI2JXlhy6eyHo8EYSvvRrxp6y3utXhmc7waE+GK1niY+dPoHMngHD9hVivWp0ZPk5lYjx0otran+odpzIAJ4DQe/F6yEyy07OOOH1Rh8gbHIQYvQ99/HjVHR/h+vPh0pGdnnUSPE/wI4zSemLumNUdr0/fvWomkFVr9kTwAQDB3w551fvIxeNVdpxeDb8ZrEC2ZxsnaR0RjbcD5SHbTxxHcRwH4dsvBSuQ+z110gYu7e2G0/hzxzBWj4Ew5FDZmqP8V49EJLdcM43H4dQjI/SeHQVDPN88loKYTmI4MMacXHjyqJUcFeHoz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nSk8CmEHTPtrUTVbquq4nAVh2vV4/zoDh+Ag/+HSE+MQpo7sITz/dRXj66S7C0093EZ5+uovw9NNdhKef7iI8/XQX4emnuwhPP91FePrpJx/h/wcwRv3+aQgiTgAAAABJRU5ErkJggg==\n" }, "metadata": {}, "execution_count": 11 } ] }, { "cell_type": "code", "source": [ "# with gr.Blocks() as demo:\n", "# with gr.Row():\n", "# input_image = gr.Image(type='filepath')\n", "# output_image = gr.Image()\n", "# with gr.Row():\n", "# log = gr.Text()\n", "# submit = gr.Button(value = \"Convert to Grayscale\")\n", "\n", "# submit.click(fn=make_grayscale, inputs=input_image, outputs=[output_image, log])\n", "\n", "# demo.launch()" ], "metadata": { "id": "kUH7M2sCXpt5" }, "execution_count": 12, "outputs": [] }, { "cell_type": "code", "source": [ "class Operations():\n", " def __init__(self):\n", " print(\"Operations class ready\")\n", "\n", " def add(self, x,y):\n", " return x+y\n", "\n", " def multiply(self, x,y):\n", " return x*y" ], "metadata": { "id": "yoLc5ltMCHns" }, "execution_count": 16, "outputs": [] }, { "cell_type": "code", "source": [ "operations_object = Operations()" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "dtnvA307CRe0", "outputId": "2439be98-98c7-45c6-d2bc-a9ed57527028" }, "execution_count": 17, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Operations class ready\n" ] } ] }, { "cell_type": "code", "source": [ "with gr.Blocks() as demo:\n", " with gr.Row():\n", " x = gr.Slider()\n", " y = gr.Slider()\n", "\n", " with gr.Row():\n", " add_result = gr.Text(\"Add\")\n", " multiply_result = gr.Text(\"Multiply\")\n", "\n", " with gr.Row():\n", " add_btn = gr.Button(\"Add\")\n", " multiply_btn = gr.Button(\"Multiply\")\n", "\n", "\n", " add_btn.click(fn=operations_object.add, inputs=[x,y], outputs=add_result)\n", " multiply_btn.click(fn=operations_object.multiply, inputs=[x,y], outputs=multiply_result)\n", "\n", "demo.launch()" ], "metadata": { "id": "hwmVn2nDYcan", "colab": { "base_uri": "https://localhost:8080/", "height": 645 }, "outputId": "7417f0ee-3a01-46f4-c031-cf3c863a5bd5" }, "execution_count": 18, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Setting queue=True in a Colab notebook requires sharing enabled. Setting `share=True` (you can turn this off by setting `share=False` in `launch()` explicitly).\n", "\n", "Colab notebook detected. To show errors in colab notebook, set debug=True in launch()\n", "Running on public URL: https://5311b7d46d41078fd5.gradio.live\n", "\n", "This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "" ], "text/html": [ "
" ] }, "metadata": {} }, { "output_type": "execute_result", "data": { "text/plain": [] }, "metadata": {}, "execution_count": 18 } ] }, { "cell_type": "markdown", "source": [ "### Gradio ML GUI Example ML Integration" ], "metadata": { "id": "roiJNbfdEdNm" } }, { "cell_type": "code", "source": [ "# Load model directly\n", "from transformers import AutoImageProcessor, AutoModelForImageClassification\n", "\n", "processor = AutoImageProcessor.from_pretrained(\"microsoft/resnet-50\")\n", "model = AutoModelForImageClassification.from_pretrained(\"microsoft/resnet-50\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 237, "referenced_widgets": [ "ae323dbe1a464e348fddf60b6cae7181", "38725e3450f340deb3d807f8b8fa5281", "a01ea19b883f4322852252dc4e59761f", "4ba9a1dda2d24987a59765a42364e05d", "669f52cb678c466382444f36e5b914d0", "4d1b22d254fe4502b151b67a8b27d384", "523b5c5952f3498ba1c69d4b3d5bdcf8", "c3770228dd13461496690eefaf918ee6", "6784388a77f5491bb7b867931ab342b3", "12474dc62e6f429ab55c82d9b1d30ee4", "e42c82a3e6c74b36a89bcd9794cc7730", "94fe94b7f9a74e0caa6f54f8a3f8c0cf", "6f40c975179f4f759df2052e89e9b236", "5e7b1a2417ef44a78f5659906b527d8f", "fab2fe2bf9fc43009f57611bb924f1d6", "1a347eacc39443f8b13a499268eb2b71", "9ffb25685adc4b69a461ee6d6dbaad11", "23719cc21c9e49a7b4781454a83ded9c", "1f83698710e3423db5c96828c611a665", "ee4ee6b9f44e4609b6936f1cc672df5a", "20288382b2444e00a7da6fa8b5b9c35f", "343af96deeda429194b13460455731c3", "1bfedbd135ac47f197ee622ce91e4ac2", "506b1e0ce0a248d5b98a3d843d7e78a9", "c72b1e6b69a142298a1ed258e80f2760", "b6fdd9cd8f4a4fc085b1ab08ca216a46", "73be00c1b1df49c4a9a177740c8321e3", "46d74949b09e47c79357d4f882e2dbba", "4f9e7454b0f94b4ca0038e934ab375da", "3ec02d00546f4a09a3e0d1676185ebcc", "8a987131cbc94c6c8b248fed3fb3390e", "5280e8c01342499fb90e62ec9588e824", "e0931c9e945a42c9af45aa766668699c" ] }, "id": "DeiRhCzyChJ4", "outputId": "d973d9b8-71c0-4576-d3ff-b93effda018c" }, "execution_count": 19, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_token.py:89: UserWarning: \n", "The secret `HF_TOKEN` does not exist in your Colab secrets.\n", "To authenticate with the Hugging Face Hub, create a token in your settings tab (https://huggingface.co/settings/tokens), set it as secret in your Google Colab and restart your session.\n", "You will be able to reuse this secret in all of your notebooks.\n", "Please note that authentication is recommended but still optional to access public models or datasets.\n", " warnings.warn(\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "preprocessor_config.json: 0%| | 0.00/266 [00:00 transformers.modeling_outputs.ImageClassifierOutputWithNoAttention\n", " | The [`ResNetForImageClassification`] forward method, overrides the `__call__` special method.\n", " | \n", " | \n", " | \n", " | Although the recipe for forward pass needs to be defined within this function, one should call the [`Module`]\n", " | instance afterwards instead of this since the former takes care of running the pre and post processing steps while\n", " | the latter silently ignores them.\n", " | \n", " | \n", " | \n", " | Args:\n", " | pixel_values (`torch.FloatTensor` of shape `(batch_size, num_channels, height, width)`):\n", " | Pixel values. Pixel values can be obtained using [`AutoImageProcessor`]. See\n", " | [`ConvNextImageProcessor.__call__`] for details.\n", " | \n", " | output_hidden_states (`bool`, *optional*):\n", " | Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for\n", " | more detail.\n", " | return_dict (`bool`, *optional*):\n", " | Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.\n", " | \n", " | labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):\n", " | Labels for computing the image classification/regression loss. Indices should be in `[0, ...,\n", " | config.num_labels - 1]`. If `config.num_labels > 1` a classification loss is computed (Cross-Entropy).\n", " | \n", " | Returns:\n", " | [`transformers.modeling_outputs.ImageClassifierOutputWithNoAttention`] or `tuple(torch.FloatTensor)`: A [`transformers.modeling_outputs.ImageClassifierOutputWithNoAttention`] or a tuple of\n", " | `torch.FloatTensor` (if `return_dict=False` is passed or when `config.return_dict=False`) comprising various\n", " | elements depending on the configuration ([`ResNetConfig`]) and inputs.\n", " | \n", " | - **loss** (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided) -- Classification (or regression if config.num_labels==1) loss.\n", " | - **logits** (`torch.FloatTensor` of shape `(batch_size, config.num_labels)`) -- Classification (or regression if config.num_labels==1) scores (before SoftMax).\n", " | - **hidden_states** (`tuple(torch.FloatTensor)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`) -- Tuple of `torch.FloatTensor` (one for the output of the embeddings, if the model has an embedding layer, +\n", " | one for the output of each stage) of shape `(batch_size, num_channels, height, width)`. Hidden-states (also\n", " | called feature maps) of the model at the output of each stage.\n", " | \n", " | Example:\n", " | \n", " | ```python\n", " | >>> from transformers import AutoImageProcessor, ResNetForImageClassification\n", " | >>> import torch\n", " | >>> from datasets import load_dataset\n", " | \n", " | >>> dataset = load_dataset(\"huggingface/cats-image\")\n", " | >>> image = dataset[\"test\"][\"image\"][0]\n", " | \n", " | >>> image_processor = AutoImageProcessor.from_pretrained(\"microsoft/resnet-50\")\n", " | >>> model = ResNetForImageClassification.from_pretrained(\"microsoft/resnet-50\")\n", " | \n", " | >>> inputs = image_processor(image, return_tensors=\"pt\")\n", " | \n", " | >>> with torch.no_grad():\n", " | ... logits = model(**inputs).logits\n", " | \n", " | >>> # model predicts one of the 1000 ImageNet classes\n", " | >>> predicted_label = logits.argmax(-1).item()\n", " | >>> print(model.config.id2label[predicted_label])\n", " | tiger cat\n", " | ```\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data and other attributes defined here:\n", " | \n", " | __annotations__ = {}\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data and other attributes inherited from ResNetPreTrainedModel:\n", " | \n", " | base_model_prefix = 'resnet'\n", " | \n", " | config_class = >> from transformers import ResNetConfig, ResNetModel\n", " | \n", " | >>> # Initializing a ResNet resnet-50 style configuration\n", " | >>> configuration = ResNetConfig()\n", " | \n", " | >>> # Initializing a model (with random weights) from the resnet-50 style configuration\n", " | >>> model = ResNetModel(configuration)\n", " | \n", " | >>> # Accessing the model configuration\n", " | >>> configuration = model.config\n", " | ```\n", " | \n", " | \n", " | main_input_name = 'pixel_values'\n", " | \n", " | ----------------------------------------------------------------------\n", " | Methods inherited from transformers.modeling_utils.PreTrainedModel:\n", " | \n", " | add_model_tags(self, tags: Union[List[str], str]) -> None\n", " | Add custom tags into the model that gets pushed to the Hugging Face Hub. Will\n", " | not overwrite existing tags in the model.\n", " | \n", " | Args:\n", " | tags (`Union[List[str], str]`):\n", " | The desired tags to inject in the model\n", " | \n", " | Examples:\n", " | \n", " | ```python\n", " | from transformers import AutoModel\n", " | \n", " | model = AutoModel.from_pretrained(\"google-bert/bert-base-cased\")\n", " | \n", " | model.add_model_tags([\"custom\", \"custom-bert\"])\n", " | \n", " | # Push the model to your namespace with the name \"my-custom-bert\".\n", " | model.push_to_hub(\"my-custom-bert\")\n", " | ```\n", " | \n", " | cuda(self: ~T, device: Union[int, torch.device, NoneType] = None) -> ~T\n", " | Move all model parameters and buffers to the GPU.\n", " | \n", " | This also makes associated parameters and buffers different objects. So\n", " | it should be called before constructing optimizer if the module will\n", " | live on GPU while being optimized.\n", " | \n", " | .. note::\n", " | This method modifies the module in-place.\n", " | \n", " | Args:\n", " | device (int, optional): if specified, all parameters will be\n", " | copied to that device\n", " | \n", " | Returns:\n", " | Module: self\n", " | \n", " | dequantize(self)\n", " | Potentially dequantize the model in case it has been quantized by a quantization method that support\n", " | dequantization.\n", " | \n", " | disable_input_require_grads(self)\n", " | Removes the `_require_grads_hook`.\n", " | \n", " | enable_input_require_grads(self)\n", " | Enables the gradients for the input embeddings. This is useful for fine-tuning adapter weights while keeping\n", " | the model weights fixed.\n", " | \n", " | float(self, *args)\n", " | Casts all floating point parameters and buffers to ``float`` datatype.\n", " | \n", " | .. note::\n", " | This method modifies the module in-place.\n", " | \n", " | Returns:\n", " | Module: self\n", " | \n", " | get_input_embeddings(self) -> torch.nn.modules.module.Module\n", " | Returns the model's input embeddings.\n", " | \n", " | Returns:\n", " | `nn.Module`: A torch module mapping vocabulary to hidden states.\n", " | \n", " | get_memory_footprint(self, return_buffers=True)\n", " | Get the memory footprint of a model. This will return the memory footprint of the current model in bytes.\n", " | Useful to benchmark the memory footprint of the current model and design some tests. Solution inspired from the\n", " | PyTorch discussions: https://discuss.pytorch.org/t/gpu-memory-that-model-uses/56822/2\n", " | \n", " | Arguments:\n", " | return_buffers (`bool`, *optional*, defaults to `True`):\n", " | Whether to return the size of the buffer tensors in the computation of the memory footprint. Buffers\n", " | are tensors that do not require gradients and not registered as parameters. E.g. mean and std in batch\n", " | norm layers. Please see: https://discuss.pytorch.org/t/what-pytorch-means-by-buffers/120266/2\n", " | \n", " | get_output_embeddings(self) -> torch.nn.modules.module.Module\n", " | Returns the model's output embeddings.\n", " | \n", " | Returns:\n", " | `nn.Module`: A torch module mapping hidden states to vocabulary.\n", " | \n", " | get_position_embeddings(self) -> Union[torch.nn.modules.sparse.Embedding, Tuple[torch.nn.modules.sparse.Embedding]]\n", " | \n", " | gradient_checkpointing_disable(self)\n", " | Deactivates gradient checkpointing for the current model.\n", " | \n", " | Note that in other frameworks this feature can be referred to as \"activation checkpointing\" or \"checkpoint\n", " | activations\".\n", " | \n", " | gradient_checkpointing_enable(self, gradient_checkpointing_kwargs=None)\n", " | Activates gradient checkpointing for the current model.\n", " | \n", " | Note that in other frameworks this feature can be referred to as \"activation checkpointing\" or \"checkpoint\n", " | activations\".\n", " | \n", " | We pass the `__call__` method of the modules instead of `forward` because `__call__` attaches all the hooks of\n", " | the module. https://discuss.pytorch.org/t/any-different-between-model-input-and-model-forward-input/3690/2\n", " | \n", " | Args:\n", " | gradient_checkpointing_kwargs (dict, *optional*):\n", " | Additional keyword arguments passed along to the `torch.utils.checkpoint.checkpoint` function.\n", " | \n", " | half(self, *args)\n", " | Casts all floating point parameters and buffers to ``half`` datatype.\n", " | \n", " | .. note::\n", " | This method modifies the module in-place.\n", " | \n", " | Returns:\n", " | Module: self\n", " | \n", " | init_weights(self)\n", " | If needed prunes and maybe initializes weights. If using a custom `PreTrainedModel`, you need to implement any\n", " | initialization logic in `_init_weights`.\n", " | \n", " | post_init(self)\n", " | A method executed at the end of each Transformer model initialization, to execute code that needs the model's\n", " | modules properly initialized (such as weight initialization).\n", " | \n", " | prune_heads(self, heads_to_prune: Dict[int, List[int]])\n", " | Prunes heads of the base model.\n", " | \n", " | Arguments:\n", " | heads_to_prune (`Dict[int, List[int]]`):\n", " | Dictionary with keys being selected layer indices (`int`) and associated values being the list of heads\n", " | to prune in said layer (list of `int`). For instance {1: [0, 2], 2: [2, 3]} will prune heads 0 and 2 on\n", " | layer 1 and heads 2 and 3 on layer 2.\n", " | \n", " | push_to_hub(self, repo_id: str, use_temp_dir: Optional[bool] = None, commit_message: Optional[str] = None, private: Optional[bool] = None, token: Union[bool, str, NoneType] = None, max_shard_size: Union[int, str, NoneType] = '5GB', create_pr: bool = False, safe_serialization: bool = True, revision: str = None, commit_description: str = None, tags: Optional[List[str]] = None, **deprecated_kwargs) -> str\n", " | Upload the model file to the 🤗 Model Hub.\n", " | \n", " | Parameters:\n", " | repo_id (`str`):\n", " | The name of the repository you want to push your model to. It should contain your organization name\n", " | when pushing to a given organization.\n", " | use_temp_dir (`bool`, *optional*):\n", " | Whether or not to use a temporary directory to store the files saved before they are pushed to the Hub.\n", " | Will default to `True` if there is no directory named like `repo_id`, `False` otherwise.\n", " | commit_message (`str`, *optional*):\n", " | Message to commit while pushing. Will default to `\"Upload model\"`.\n", " | private (`bool`, *optional*):\n", " | Whether or not the repository created should be private.\n", " | token (`bool` or `str`, *optional*):\n", " | The token to use as HTTP bearer authorization for remote files. If `True`, will use the token generated\n", " | when running `huggingface-cli login` (stored in `~/.huggingface`). Will default to `True` if `repo_url`\n", " | is not specified.\n", " | max_shard_size (`int` or `str`, *optional*, defaults to `\"5GB\"`):\n", " | Only applicable for models. The maximum size for a checkpoint before being sharded. Checkpoints shard\n", " | will then be each of size lower than this size. If expressed as a string, needs to be digits followed\n", " | by a unit (like `\"5MB\"`). We default it to `\"5GB\"` so that users can easily load models on free-tier\n", " | Google Colab instances without any CPU OOM issues.\n", " | create_pr (`bool`, *optional*, defaults to `False`):\n", " | Whether or not to create a PR with the uploaded files or directly commit.\n", " | safe_serialization (`bool`, *optional*, defaults to `True`):\n", " | Whether or not to convert the model weights in safetensors format for safer serialization.\n", " | revision (`str`, *optional*):\n", " | Branch to push the uploaded files to.\n", " | commit_description (`str`, *optional*):\n", " | The description of the commit that will be created\n", " | tags (`List[str]`, *optional*):\n", " | List of tags to push on the Hub.\n", " | \n", " | Examples:\n", " | \n", " | ```python\n", " | from transformers import AutoModel\n", " | \n", " | model = AutoModel.from_pretrained(\"google-bert/bert-base-cased\")\n", " | \n", " | # Push the model to your namespace with the name \"my-finetuned-bert\".\n", " | model.push_to_hub(\"my-finetuned-bert\")\n", " | \n", " | # Push the model to an organization with the name \"my-finetuned-bert\".\n", " | model.push_to_hub(\"huggingface/my-finetuned-bert\")\n", " | ```\n", " | \n", " | resize_position_embeddings(self, new_num_position_embeddings: int)\n", " | \n", " | resize_token_embeddings(self, new_num_tokens: Optional[int] = None, pad_to_multiple_of: Optional[int] = None) -> torch.nn.modules.sparse.Embedding\n", " | Resizes input token embeddings matrix of the model if `new_num_tokens != config.vocab_size`.\n", " | \n", " | Takes care of tying weights embeddings afterwards if the model class has a `tie_weights()` method.\n", " | \n", " | Arguments:\n", " | new_num_tokens (`int`, *optional*):\n", " | The new number of tokens in the embedding matrix. Increasing the size will add newly initialized\n", " | vectors at the end. Reducing the size will remove vectors from the end. If not provided or `None`, just\n", " | returns a pointer to the input tokens `torch.nn.Embedding` module of the model without doing anything.\n", " | pad_to_multiple_of (`int`, *optional*):\n", " | If set will pad the embedding matrix to a multiple of the provided value.If `new_num_tokens` is set to\n", " | `None` will just pad the embedding to a multiple of `pad_to_multiple_of`.\n", " | \n", " | This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability\n", " | `>= 7.5` (Volta), or on TPUs which benefit from having sequence lengths be a multiple of 128. For more\n", " | details about this, or help on choosing the correct value for resizing, refer to this guide:\n", " | https://docs.nvidia.com/deeplearning/performance/dl-performance-matrix-multiplication/index.html#requirements-tc\n", " | \n", " | Return:\n", " | `torch.nn.Embedding`: Pointer to the input tokens Embeddings Module of the model.\n", " | \n", " | retrieve_modules_from_names(self, names, add_prefix=False, remove_prefix=False)\n", " | \n", " | reverse_bettertransformer(self)\n", " | Reverts the transformation from [`~PreTrainedModel.to_bettertransformer`] so that the original modeling is\n", " | used, for example in order to save the model.\n", " | \n", " | Returns:\n", " | [`PreTrainedModel`]: The model converted back to the original modeling.\n", " | \n", " | save_pretrained(self, save_directory: Union[str, os.PathLike], is_main_process: bool = True, state_dict: Optional[dict] = None, save_function: Callable = , push_to_hub: bool = False, max_shard_size: Union[int, str] = '5GB', safe_serialization: bool = True, variant: Optional[str] = None, token: Union[str, bool, NoneType] = None, save_peft_format: bool = True, **kwargs)\n", " | Save a model and its configuration file to a directory, so that it can be re-loaded using the\n", " | [`~PreTrainedModel.from_pretrained`] class method.\n", " | \n", " | Arguments:\n", " | save_directory (`str` or `os.PathLike`):\n", " | Directory to which to save. Will be created if it doesn't exist.\n", " | is_main_process (`bool`, *optional*, defaults to `True`):\n", " | Whether the process calling this is the main process or not. Useful when in distributed training like\n", " | TPUs and need to call this function on all processes. In this case, set `is_main_process=True` only on\n", " | the main process to avoid race conditions.\n", " | state_dict (nested dictionary of `torch.Tensor`):\n", " | The state dictionary of the model to save. Will default to `self.state_dict()`, but can be used to only\n", " | save parts of the model or if special precautions need to be taken when recovering the state dictionary\n", " | of a model (like when using model parallelism).\n", " | save_function (`Callable`):\n", " | The function to use to save the state dictionary. Useful on distributed training like TPUs when one\n", " | need to replace `torch.save` by another method.\n", " | push_to_hub (`bool`, *optional*, defaults to `False`):\n", " | Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the\n", " | repository you want to push to with `repo_id` (will default to the name of `save_directory` in your\n", " | namespace).\n", " | max_shard_size (`int` or `str`, *optional*, defaults to `\"5GB\"`):\n", " | The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size\n", " | lower than this size. If expressed as a string, needs to be digits followed by a unit (like `\"5MB\"`).\n", " | We default it to 5GB in order for models to be able to run easily on free-tier google colab instances\n", " | without CPU OOM issues.\n", " | \n", " | \n", " | \n", " | If a single weight of the model is bigger than `max_shard_size`, it will be in its own checkpoint shard\n", " | which will be bigger than `max_shard_size`.\n", " | \n", " | \n", " | \n", " | safe_serialization (`bool`, *optional*, defaults to `True`):\n", " | Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).\n", " | variant (`str`, *optional*):\n", " | If specified, weights are saved in the format pytorch_model..bin.\n", " | token (`str` or `bool`, *optional*):\n", " | The token to use as HTTP bearer authorization for remote files. If `True`, or not specified, will use\n", " | the token generated when running `huggingface-cli login` (stored in `~/.huggingface`).\n", " | save_peft_format (`bool`, *optional*, defaults to `True`):\n", " | For backward compatibility with PEFT library, in case adapter weights are attached to the model, all\n", " | keys of the state dict of adapters needs to be pre-pended with `base_model.model`. Advanced users can\n", " | disable this behaviours by setting `save_peft_format` to `False`.\n", " | kwargs (`Dict[str, Any]`, *optional*):\n", " | Additional key word arguments passed along to the [`~utils.PushToHubMixin.push_to_hub`] method.\n", " | \n", " | set_input_embeddings(self, value: torch.nn.modules.module.Module)\n", " | Set model's input embeddings.\n", " | \n", " | Args:\n", " | value (`nn.Module`): A module mapping vocabulary to hidden states.\n", " | \n", " | tie_weights(self)\n", " | Tie the weights between the input embeddings and the output embeddings.\n", " | \n", " | If the `torchscript` flag is set in the configuration, can't handle parameter sharing so we are cloning the\n", " | weights instead.\n", " | \n", " | to(self, *args, **kwargs)\n", " | Move and/or cast the parameters and buffers.\n", " | \n", " | This can be called as\n", " | \n", " | .. function:: to(device=None, dtype=None, non_blocking=False)\n", " | :noindex:\n", " | \n", " | .. function:: to(dtype, non_blocking=False)\n", " | :noindex:\n", " | \n", " | .. function:: to(tensor, non_blocking=False)\n", " | :noindex:\n", " | \n", " | .. function:: to(memory_format=torch.channels_last)\n", " | :noindex:\n", " | \n", " | Its signature is similar to :meth:`torch.Tensor.to`, but only accepts\n", " | floating point or complex :attr:`dtype`\\ s. In addition, this method will\n", " | only cast the floating point or complex parameters and buffers to :attr:`dtype`\n", " | (if given). The integral parameters and buffers will be moved\n", " | :attr:`device`, if that is given, but with dtypes unchanged. When\n", " | :attr:`non_blocking` is set, it tries to convert/move asynchronously\n", " | with respect to the host if possible, e.g., moving CPU Tensors with\n", " | pinned memory to CUDA devices.\n", " | \n", " | See below for examples.\n", " | \n", " | .. note::\n", " | This method modifies the module in-place.\n", " | \n", " | Args:\n", " | device (:class:`torch.device`): the desired device of the parameters\n", " | and buffers in this module\n", " | dtype (:class:`torch.dtype`): the desired floating point or complex dtype of\n", " | the parameters and buffers in this module\n", " | tensor (torch.Tensor): Tensor whose dtype and device are the desired\n", " | dtype and device for all parameters and buffers in this module\n", " | memory_format (:class:`torch.memory_format`): the desired memory\n", " | format for 4D parameters and buffers in this module (keyword\n", " | only argument)\n", " | \n", " | Returns:\n", " | Module: self\n", " | \n", " | Examples::\n", " | \n", " | >>> # xdoctest: +IGNORE_WANT(\"non-deterministic\")\n", " | >>> linear = nn.Linear(2, 2)\n", " | >>> linear.weight\n", " | Parameter containing:\n", " | tensor([[ 0.1913, -0.3420],\n", " | [-0.5113, -0.2325]])\n", " | >>> linear.to(torch.double)\n", " | Linear(in_features=2, out_features=2, bias=True)\n", " | >>> linear.weight\n", " | Parameter containing:\n", " | tensor([[ 0.1913, -0.3420],\n", " | [-0.5113, -0.2325]], dtype=torch.float64)\n", " | >>> # xdoctest: +REQUIRES(env:TORCH_DOCTEST_CUDA1)\n", " | >>> gpu1 = torch.device(\"cuda:1\")\n", " | >>> linear.to(gpu1, dtype=torch.half, non_blocking=True)\n", " | Linear(in_features=2, out_features=2, bias=True)\n", " | >>> linear.weight\n", " | Parameter containing:\n", " | tensor([[ 0.1914, -0.3420],\n", " | [-0.5112, -0.2324]], dtype=torch.float16, device='cuda:1')\n", " | >>> cpu = torch.device(\"cpu\")\n", " | >>> linear.to(cpu)\n", " | Linear(in_features=2, out_features=2, bias=True)\n", " | >>> linear.weight\n", " | Parameter containing:\n", " | tensor([[ 0.1914, -0.3420],\n", " | [-0.5112, -0.2324]], dtype=torch.float16)\n", " | \n", " | >>> linear = nn.Linear(2, 2, bias=None).to(torch.cdouble)\n", " | >>> linear.weight\n", " | Parameter containing:\n", " | tensor([[ 0.3741+0.j, 0.2382+0.j],\n", " | [ 0.5593+0.j, -0.4443+0.j]], dtype=torch.complex128)\n", " | >>> linear(torch.ones(3, 2, dtype=torch.cdouble))\n", " | tensor([[0.6122+0.j, 0.1150+0.j],\n", " | [0.6122+0.j, 0.1150+0.j],\n", " | [0.6122+0.j, 0.1150+0.j]], dtype=torch.complex128)\n", " | \n", " | to_bettertransformer(self) -> 'PreTrainedModel'\n", " | Converts the model to use [PyTorch's native attention\n", " | implementation](https://pytorch.org/docs/stable/generated/torch.nn.MultiheadAttention.html), integrated to\n", " | Transformers through [Optimum library](https://huggingface.co/docs/optimum/bettertransformer/overview). Only a\n", " | subset of all Transformers models are supported.\n", " | \n", " | PyTorch's attention fastpath allows to speed up inference through kernel fusions and the use of [nested\n", " | tensors](https://pytorch.org/docs/stable/nested.html). Detailed benchmarks can be found in [this blog\n", " | post](https://medium.com/pytorch/bettertransformer-out-of-the-box-performance-for-huggingface-transformers-3fbe27d50ab2).\n", " | \n", " | Returns:\n", " | [`PreTrainedModel`]: The model converted to BetterTransformer.\n", " | \n", " | warn_if_padding_and_no_attention_mask(self, input_ids, attention_mask)\n", " | Shows a one-time warning if the input_ids appear to contain padding and no attention mask was given.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Class methods inherited from transformers.modeling_utils.PreTrainedModel:\n", " | \n", " | can_generate() -> bool from builtins.type\n", " | Returns whether this model can generate sequences with `.generate()`.\n", " | \n", " | Returns:\n", " | `bool`: Whether this model can generate sequences with `.generate()`.\n", " | \n", " | from_pretrained(pretrained_model_name_or_path: Union[str, os.PathLike, NoneType], *model_args, config: Union[transformers.configuration_utils.PretrainedConfig, str, os.PathLike, NoneType] = None, cache_dir: Union[str, os.PathLike, NoneType] = None, ignore_mismatched_sizes: bool = False, force_download: bool = False, local_files_only: bool = False, token: Union[str, bool, NoneType] = None, revision: str = 'main', use_safetensors: bool = None, **kwargs) from builtins.type\n", " | Instantiate a pretrained pytorch model from a pre-trained model configuration.\n", " | \n", " | The model is set in evaluation mode by default using `model.eval()` (Dropout modules are deactivated). To train\n", " | the model, you should first set it back in training mode with `model.train()`.\n", " | \n", " | The warning *Weights from XXX not initialized from pretrained model* means that the weights of XXX do not come\n", " | pretrained with the rest of the model. It is up to you to train those weights with a downstream fine-tuning\n", " | task.\n", " | \n", " | The warning *Weights from XXX not used in YYY* means that the layer XXX is not used by YYY, therefore those\n", " | weights are discarded.\n", " | \n", " | Parameters:\n", " | pretrained_model_name_or_path (`str` or `os.PathLike`, *optional*):\n", " | Can be either:\n", " | \n", " | - A string, the *model id* of a pretrained model hosted inside a model repo on huggingface.co.\n", " | - A path to a *directory* containing model weights saved using\n", " | [`~PreTrainedModel.save_pretrained`], e.g., `./my_model_directory/`.\n", " | - A path or url to a *tensorflow index checkpoint file* (e.g, `./tf_model/model.ckpt.index`). In\n", " | this case, `from_tf` should be set to `True` and a configuration object should be provided as\n", " | `config` argument. This loading path is slower than converting the TensorFlow checkpoint in a\n", " | PyTorch model using the provided conversion scripts and loading the PyTorch model afterwards.\n", " | - A path or url to a model folder containing a *flax checkpoint file* in *.msgpack* format (e.g,\n", " | `./flax_model/` containing `flax_model.msgpack`). In this case, `from_flax` should be set to\n", " | `True`.\n", " | - `None` if you are both providing the configuration and state dictionary (resp. with keyword\n", " | arguments `config` and `state_dict`).\n", " | model_args (sequence of positional arguments, *optional*):\n", " | All remaining positional arguments will be passed to the underlying model's `__init__` method.\n", " | config (`Union[PretrainedConfig, str, os.PathLike]`, *optional*):\n", " | Can be either:\n", " | \n", " | - an instance of a class derived from [`PretrainedConfig`],\n", " | - a string or path valid as input to [`~PretrainedConfig.from_pretrained`].\n", " | \n", " | Configuration for the model to use instead of an automatically loaded configuration. Configuration can\n", " | be automatically loaded when:\n", " | \n", " | - The model is a model provided by the library (loaded with the *model id* string of a pretrained\n", " | model).\n", " | - The model was saved using [`~PreTrainedModel.save_pretrained`] and is reloaded by supplying the\n", " | save directory.\n", " | - The model is loaded by supplying a local directory as `pretrained_model_name_or_path` and a\n", " | configuration JSON file named *config.json* is found in the directory.\n", " | state_dict (`Dict[str, torch.Tensor]`, *optional*):\n", " | A state dictionary to use instead of a state dictionary loaded from saved weights file.\n", " | \n", " | This option can be used if you want to create a model from a pretrained configuration but load your own\n", " | weights. In this case though, you should check if using [`~PreTrainedModel.save_pretrained`] and\n", " | [`~PreTrainedModel.from_pretrained`] is not a simpler option.\n", " | cache_dir (`Union[str, os.PathLike]`, *optional*):\n", " | Path to a directory in which a downloaded pretrained model configuration should be cached if the\n", " | standard cache should not be used.\n", " | from_tf (`bool`, *optional*, defaults to `False`):\n", " | Load the model weights from a TensorFlow checkpoint save file (see docstring of\n", " | `pretrained_model_name_or_path` argument).\n", " | from_flax (`bool`, *optional*, defaults to `False`):\n", " | Load the model weights from a Flax checkpoint save file (see docstring of\n", " | `pretrained_model_name_or_path` argument).\n", " | ignore_mismatched_sizes (`bool`, *optional*, defaults to `False`):\n", " | Whether or not to raise an error if some of the weights from the checkpoint do not have the same size\n", " | as the weights of the model (if for instance, you are instantiating a model with 10 labels from a\n", " | checkpoint with 3 labels).\n", " | force_download (`bool`, *optional*, defaults to `False`):\n", " | Whether or not to force the (re-)download of the model weights and configuration files, overriding the\n", " | cached versions if they exist.\n", " | resume_download:\n", " | Deprecated and ignored. All downloads are now resumed by default when possible.\n", " | Will be removed in v5 of Transformers.\n", " | proxies (`Dict[str, str]`, *optional*):\n", " | A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',\n", " | 'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.\n", " | output_loading_info(`bool`, *optional*, defaults to `False`):\n", " | Whether ot not to also return a dictionary containing missing keys, unexpected keys and error messages.\n", " | local_files_only(`bool`, *optional*, defaults to `False`):\n", " | Whether or not to only look at local files (i.e., do not try to download the model).\n", " | token (`str` or `bool`, *optional*):\n", " | The token to use as HTTP bearer authorization for remote files. If `True`, or not specified, will use\n", " | the token generated when running `huggingface-cli login` (stored in `~/.huggingface`).\n", " | revision (`str`, *optional*, defaults to `\"main\"`):\n", " | The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a\n", " | git-based system for storing models and other artifacts on huggingface.co, so `revision` can be any\n", " | identifier allowed by git.\n", " | \n", " | \n", " | \n", " | To test a pull request you made on the Hub, you can pass `revision=\"refs/pr/\".\n", " | \n", " | \n", " | \n", " | mirror (`str`, *optional*):\n", " | Mirror source to accelerate downloads in China. If you are from China and have an accessibility\n", " | problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.\n", " | Please refer to the mirror site for more information.\n", " | _fast_init(`bool`, *optional*, defaults to `True`):\n", " | Whether or not to disable fast initialization.\n", " | \n", " | \n", " | \n", " | One should only disable *_fast_init* to ensure backwards compatibility with `transformers.__version__ <\n", " | 4.6.0` for seeded model initialization. This argument will be removed at the next major version. See\n", " | [pull request 11471](https://github.com/huggingface/transformers/pull/11471) for more information.\n", " | \n", " | \n", " | attn_implementation (`str`, *optional*):\n", " | The attention implementation to use in the model (if relevant). Can be any of `\"eager\"` (manual implementation of the attention), `\"sdpa\"` (using [`F.scaled_dot_product_attention`](https://pytorch.org/docs/master/generated/torch.nn.functional.scaled_dot_product_attention.html)), or `\"flash_attention_2\"` (using [Dao-AILab/flash-attention](https://github.com/Dao-AILab/flash-attention)). By default, if available, SDPA will be used for torch>=2.1.1. The default is otherwise the manual `\"eager\"` implementation.\n", " | \n", " | > Parameters for big model inference\n", " | \n", " | low_cpu_mem_usage(`bool`, *optional*):\n", " | Tries to not use more than 1x model size in CPU memory (including peak memory) while loading the model.\n", " | This is an experimental feature and a subject to change at any moment.\n", " | torch_dtype (`str` or `torch.dtype`, *optional*):\n", " | Override the default `torch.dtype` and load the model under a specific `dtype`. The different options\n", " | are:\n", " | \n", " | 1. `torch.float16` or `torch.bfloat16` or `torch.float`: load in a specified\n", " | `dtype`, ignoring the model's `config.torch_dtype` if one exists. If not specified\n", " | - the model will get loaded in `torch.float` (fp32).\n", " | \n", " | 2. `\"auto\"` - A `torch_dtype` entry in the `config.json` file of the model will be\n", " | attempted to be used. If this entry isn't found then next check the `dtype` of the first weight in\n", " | the checkpoint that's of a floating point type and use that as `dtype`. This will load the model\n", " | using the `dtype` it was saved in at the end of the training. It can't be used as an indicator of how\n", " | the model was trained. Since it could be trained in one of half precision dtypes, but saved in fp32.\n", " | \n", " | \n", " | \n", " | For some models the `dtype` they were trained in is unknown - you may try to check the model's paper or\n", " | reach out to the authors and ask them to add this information to the model's card and to insert the\n", " | `torch_dtype` entry in `config.json` on the hub.\n", " | \n", " | \n", " | \n", " | device_map (`str` or `Dict[str, Union[int, str, torch.device]]` or `int` or `torch.device`, *optional*):\n", " | A map that specifies where each submodule should go. It doesn't need to be refined to each\n", " | parameter/buffer name, once a given module name is inside, every submodule of it will be sent to the\n", " | same device. If we only pass the device (*e.g.*, `\"cpu\"`, `\"cuda:1\"`, `\"mps\"`, or a GPU ordinal rank\n", " | like `1`) on which the model will be allocated, the device map will map the entire model to this\n", " | device. Passing `device_map = 0` means put the whole model on GPU 0.\n", " | \n", " | To have Accelerate compute the most optimized `device_map` automatically, set `device_map=\"auto\"`. For\n", " | more information about each option see [designing a device\n", " | map](https://hf.co/docs/accelerate/main/en/usage_guides/big_modeling#designing-a-device-map).\n", " | max_memory (`Dict`, *optional*):\n", " | A dictionary device identifier to maximum memory. Will default to the maximum memory available for each\n", " | GPU and the available CPU RAM if unset.\n", " | offload_folder (`str` or `os.PathLike`, *optional*):\n", " | If the `device_map` contains any value `\"disk\"`, the folder where we will offload weights.\n", " | offload_state_dict (`bool`, *optional*):\n", " | If `True`, will temporarily offload the CPU state dict to the hard drive to avoid getting out of CPU\n", " | RAM if the weight of the CPU state dict + the biggest shard of the checkpoint does not fit. Defaults to\n", " | `True` when there is some disk offload.\n", " | offload_buffers (`bool`, *optional*):\n", " | Whether or not to offload the buffers with the model parameters.\n", " | quantization_config (`Union[QuantizationConfigMixin,Dict]`, *optional*):\n", " | A dictionary of configuration parameters or a QuantizationConfigMixin object for quantization (e.g\n", " | bitsandbytes, gptq). There may be other quantization-related kwargs, including `load_in_4bit` and\n", " | `load_in_8bit`, which are parsed by QuantizationConfigParser. Supported only for bitsandbytes\n", " | quantizations and not preferred. consider inserting all such arguments into quantization_config\n", " | instead.\n", " | subfolder (`str`, *optional*, defaults to `\"\"`):\n", " | In case the relevant files are located inside a subfolder of the model repo on huggingface.co, you can\n", " | specify the folder name here.\n", " | variant (`str`, *optional*):\n", " | If specified load weights from `variant` filename, *e.g.* pytorch_model..bin. `variant` is\n", " | ignored when using `from_tf` or `from_flax`.\n", " | use_safetensors (`bool`, *optional*, defaults to `None`):\n", " | Whether or not to use `safetensors` checkpoints. Defaults to `None`. If not specified and `safetensors`\n", " | is not installed, it will be set to `False`.\n", " | \n", " | kwargs (remaining dictionary of keyword arguments, *optional*):\n", " | Can be used to update the configuration object (after it being loaded) and initiate the model (e.g.,\n", " | `output_attentions=True`). Behaves differently depending on whether a `config` is provided or\n", " | automatically loaded:\n", " | \n", " | - If a configuration is provided with `config`, `**kwargs` will be directly passed to the\n", " | underlying model's `__init__` method (we assume all relevant updates to the configuration have\n", " | already been done)\n", " | - If a configuration is not provided, `kwargs` will be first passed to the configuration class\n", " | initialization function ([`~PretrainedConfig.from_pretrained`]). Each key of `kwargs` that\n", " | corresponds to a configuration attribute will be used to override said attribute with the\n", " | supplied `kwargs` value. Remaining keys that do not correspond to any configuration attribute\n", " | will be passed to the underlying model's `__init__` function.\n", " | \n", " | \n", " | \n", " | Activate the special [\"offline-mode\"](https://huggingface.co/transformers/installation.html#offline-mode) to\n", " | use this method in a firewalled environment.\n", " | \n", " | \n", " | \n", " | Examples:\n", " | \n", " | ```python\n", " | >>> from transformers import BertConfig, BertModel\n", " | \n", " | >>> # Download model and configuration from huggingface.co and cache.\n", " | >>> model = BertModel.from_pretrained(\"google-bert/bert-base-uncased\")\n", " | >>> # Model was saved using *save_pretrained('./test/saved_model/')* (for example purposes, not runnable).\n", " | >>> model = BertModel.from_pretrained(\"./test/saved_model/\")\n", " | >>> # Update configuration during loading.\n", " | >>> model = BertModel.from_pretrained(\"google-bert/bert-base-uncased\", output_attentions=True)\n", " | >>> assert model.config.output_attentions == True\n", " | >>> # Loading from a TF checkpoint file instead of a PyTorch model (slower, for example purposes, not runnable).\n", " | >>> config = BertConfig.from_json_file(\"./tf_model/my_tf_model_config.json\")\n", " | >>> model = BertModel.from_pretrained(\"./tf_model/my_tf_checkpoint.ckpt.index\", from_tf=True, config=config)\n", " | >>> # Loading from a Flax checkpoint file instead of a PyTorch model (slower)\n", " | >>> model = BertModel.from_pretrained(\"google-bert/bert-base-uncased\", from_flax=True)\n", " | ```\n", " | \n", " | * `low_cpu_mem_usage` algorithm:\n", " | \n", " | This is an experimental function that loads the model using ~1x model size CPU memory\n", " | \n", " | Here is how it works:\n", " | \n", " | 1. save which state_dict keys we have\n", " | 2. drop state_dict before the model is created, since the latter takes 1x model size CPU memory\n", " | 3. after the model has been instantiated switch to the meta device all params/buffers that\n", " | are going to be replaced from the loaded state_dict\n", " | 4. load state_dict 2nd time\n", " | 5. replace the params/buffers from the state_dict\n", " | \n", " | Currently, it can't handle deepspeed ZeRO stage 3 and ignores loading errors\n", " | \n", " | register_for_auto_class(auto_class='AutoModel') from builtins.type\n", " | Register this class with a given auto class. This should only be used for custom models as the ones in the\n", " | library are already mapped with an auto class.\n", " | \n", " | \n", " | \n", " | This API is experimental and may have some slight breaking changes in the next releases.\n", " | \n", " | \n", " | \n", " | Args:\n", " | auto_class (`str` or `type`, *optional*, defaults to `\"AutoModel\"`):\n", " | The auto class to register this new model with.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Readonly properties inherited from transformers.modeling_utils.PreTrainedModel:\n", " | \n", " | base_model\n", " | `torch.nn.Module`: The main body of the model.\n", " | \n", " | dummy_inputs\n", " | `Dict[str, torch.Tensor]`: Dummy inputs to do a forward pass in the network.\n", " | \n", " | framework\n", " | :str: Identifies that this is a PyTorch model.\n", " | \n", " | is_gradient_checkpointing\n", " | Whether gradient checkpointing is activated for this model or not.\n", " | \n", " | Note that in other frameworks this feature can be referred to as \"activation checkpointing\" or \"checkpoint\n", " | activations\".\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data and other attributes inherited from transformers.modeling_utils.PreTrainedModel:\n", " | \n", " | is_parallelizable = False\n", " | \n", " | model_tags = None\n", " | \n", " | supports_gradient_checkpointing = False\n", " | \n", " | ----------------------------------------------------------------------\n", " | Methods inherited from torch.nn.modules.module.Module:\n", " | \n", " | __call__ = _wrapped_call_impl(self, *args, **kwargs)\n", " | \n", " | __delattr__(self, name)\n", " | Implement delattr(self, name).\n", " | \n", " | __dir__(self)\n", " | Default dir() implementation.\n", " | \n", " | __getattr__(self, name: str) -> Any\n", " | # On the return type:\n", " | # We choose to return `Any` in the `__getattr__` type signature instead of a more strict `Union[Tensor, Module]`.\n", " | # This is done for better interop with various type checkers for the end users.\n", " | # Having a stricter return type doesn't play nicely with `register_buffer()` and forces\n", " | # people to excessively use type-ignores, asserts, casts, etc.\n", " | # See full discussion on the problems with returning `Union` here\n", " | # https://github.com/microsoft/pyright/issues/4213\n", " | \n", " | __getstate__(self)\n", " | \n", " | __repr__(self)\n", " | Return repr(self).\n", " | \n", " | __setattr__(self, name: str, value: Union[torch.Tensor, ForwardRef('Module')]) -> None\n", " | Implement setattr(self, name, value).\n", " | \n", " | __setstate__(self, state)\n", " | \n", " | add_module(self, name: str, module: Optional[ForwardRef('Module')]) -> None\n", " | Add a child module to the current module.\n", " | \n", " | The module can be accessed as an attribute using the given name.\n", " | \n", " | Args:\n", " | name (str): name of the child module. The child module can be\n", " | accessed from this module using the given name\n", " | module (Module): child module to be added to the module.\n", " | \n", " | apply(self: ~T, fn: Callable[[ForwardRef('Module')], NoneType]) -> ~T\n", " | Apply ``fn`` recursively to every submodule (as returned by ``.children()``) as well as self.\n", " | \n", " | Typical use includes initializing the parameters of a model\n", " | (see also :ref:`nn-init-doc`).\n", " | \n", " | Args:\n", " | fn (:class:`Module` -> None): function to be applied to each submodule\n", " | \n", " | Returns:\n", " | Module: self\n", " | \n", " | Example::\n", " | \n", " | >>> @torch.no_grad()\n", " | >>> def init_weights(m):\n", " | >>> print(m)\n", " | >>> if type(m) == nn.Linear:\n", " | >>> m.weight.fill_(1.0)\n", " | >>> print(m.weight)\n", " | >>> net = nn.Sequential(nn.Linear(2, 2), nn.Linear(2, 2))\n", " | >>> net.apply(init_weights)\n", " | Linear(in_features=2, out_features=2, bias=True)\n", " | Parameter containing:\n", " | tensor([[1., 1.],\n", " | [1., 1.]], requires_grad=True)\n", " | Linear(in_features=2, out_features=2, bias=True)\n", " | Parameter containing:\n", " | tensor([[1., 1.],\n", " | [1., 1.]], requires_grad=True)\n", " | Sequential(\n", " | (0): Linear(in_features=2, out_features=2, bias=True)\n", " | (1): Linear(in_features=2, out_features=2, bias=True)\n", " | )\n", " | \n", " | bfloat16(self: ~T) -> ~T\n", " | Casts all floating point parameters and buffers to ``bfloat16`` datatype.\n", " | \n", " | .. note::\n", " | This method modifies the module in-place.\n", " | \n", " | Returns:\n", " | Module: self\n", " | \n", " | buffers(self, recurse: bool = True) -> Iterator[torch.Tensor]\n", " | Return an iterator over module buffers.\n", " | \n", " | Args:\n", " | recurse (bool): if True, then yields buffers of this module\n", " | and all submodules. Otherwise, yields only buffers that\n", " | are direct members of this module.\n", " | \n", " | Yields:\n", " | torch.Tensor: module buffer\n", " | \n", " | Example::\n", " | \n", " | >>> # xdoctest: +SKIP(\"undefined vars\")\n", " | >>> for buf in model.buffers():\n", " | >>> print(type(buf), buf.size())\n", " | (20L,)\n", " | (20L, 1L, 5L, 5L)\n", " | \n", " | children(self) -> Iterator[ForwardRef('Module')]\n", " | Return an iterator over immediate children modules.\n", " | \n", " | Yields:\n", " | Module: a child module\n", " | \n", " | compile(self, *args, **kwargs)\n", " | Compile this Module's forward using :func:`torch.compile`.\n", " | \n", " | This Module's `__call__` method is compiled and all arguments are passed as-is\n", " | to :func:`torch.compile`.\n", " | \n", " | See :func:`torch.compile` for details on the arguments for this function.\n", " | \n", " | cpu(self: ~T) -> ~T\n", " | Move all model parameters and buffers to the CPU.\n", " | \n", " | .. note::\n", " | This method modifies the module in-place.\n", " | \n", " | Returns:\n", " | Module: self\n", " | \n", " | double(self: ~T) -> ~T\n", " | Casts all floating point parameters and buffers to ``double`` datatype.\n", " | \n", " | .. note::\n", " | This method modifies the module in-place.\n", " | \n", " | Returns:\n", " | Module: self\n", " | \n", " | eval(self: ~T) -> ~T\n", " | Set the module in evaluation mode.\n", " | \n", " | This has any effect only on certain modules. See documentations of\n", " | particular modules for details of their behaviors in training/evaluation\n", " | mode, if they are affected, e.g. :class:`Dropout`, :class:`BatchNorm`,\n", " | etc.\n", " | \n", " | This is equivalent with :meth:`self.train(False) `.\n", " | \n", " | See :ref:`locally-disable-grad-doc` for a comparison between\n", " | `.eval()` and several similar mechanisms that may be confused with it.\n", " | \n", " | Returns:\n", " | Module: self\n", " | \n", " | extra_repr(self) -> str\n", " | Set the extra representation of the module.\n", " | \n", " | To print customized extra information, you should re-implement\n", " | this method in your own modules. Both single-line and multi-line\n", " | strings are acceptable.\n", " | \n", " | get_buffer(self, target: str) -> 'Tensor'\n", " | Return the buffer given by ``target`` if it exists, otherwise throw an error.\n", " | \n", " | See the docstring for ``get_submodule`` for a more detailed\n", " | explanation of this method's functionality as well as how to\n", " | correctly specify ``target``.\n", " | \n", " | Args:\n", " | target: The fully-qualified string name of the buffer\n", " | to look for. (See ``get_submodule`` for how to specify a\n", " | fully-qualified string.)\n", " | \n", " | Returns:\n", " | torch.Tensor: The buffer referenced by ``target``\n", " | \n", " | Raises:\n", " | AttributeError: If the target string references an invalid\n", " | path or resolves to something that is not a\n", " | buffer\n", " | \n", " | get_extra_state(self) -> Any\n", " | Return any extra state to include in the module's state_dict.\n", " | \n", " | Implement this and a corresponding :func:`set_extra_state` for your module\n", " | if you need to store extra state. This function is called when building the\n", " | module's `state_dict()`.\n", " | \n", " | Note that extra state should be picklable to ensure working serialization\n", " | of the state_dict. We only provide provide backwards compatibility guarantees\n", " | for serializing Tensors; other objects may break backwards compatibility if\n", " | their serialized pickled form changes.\n", " | \n", " | Returns:\n", " | object: Any extra state to store in the module's state_dict\n", " | \n", " | get_parameter(self, target: str) -> 'Parameter'\n", " | Return the parameter given by ``target`` if it exists, otherwise throw an error.\n", " | \n", " | See the docstring for ``get_submodule`` for a more detailed\n", " | explanation of this method's functionality as well as how to\n", " | correctly specify ``target``.\n", " | \n", " | Args:\n", " | target: The fully-qualified string name of the Parameter\n", " | to look for. (See ``get_submodule`` for how to specify a\n", " | fully-qualified string.)\n", " | \n", " | Returns:\n", " | torch.nn.Parameter: The Parameter referenced by ``target``\n", " | \n", " | Raises:\n", " | AttributeError: If the target string references an invalid\n", " | path or resolves to something that is not an\n", " | ``nn.Parameter``\n", " | \n", " | get_submodule(self, target: str) -> 'Module'\n", " | Return the submodule given by ``target`` if it exists, otherwise throw an error.\n", " | \n", " | For example, let's say you have an ``nn.Module`` ``A`` that\n", " | looks like this:\n", " | \n", " | .. code-block:: text\n", " | \n", " | A(\n", " | (net_b): Module(\n", " | (net_c): Module(\n", " | (conv): Conv2d(16, 33, kernel_size=(3, 3), stride=(2, 2))\n", " | )\n", " | (linear): Linear(in_features=100, out_features=200, bias=True)\n", " | )\n", " | )\n", " | \n", " | (The diagram shows an ``nn.Module`` ``A``. ``A`` has a nested\n", " | submodule ``net_b``, which itself has two submodules ``net_c``\n", " | and ``linear``. ``net_c`` then has a submodule ``conv``.)\n", " | \n", " | To check whether or not we have the ``linear`` submodule, we\n", " | would call ``get_submodule(\"net_b.linear\")``. To check whether\n", " | we have the ``conv`` submodule, we would call\n", " | ``get_submodule(\"net_b.net_c.conv\")``.\n", " | \n", " | The runtime of ``get_submodule`` is bounded by the degree\n", " | of module nesting in ``target``. A query against\n", " | ``named_modules`` achieves the same result, but it is O(N) in\n", " | the number of transitive modules. So, for a simple check to see\n", " | if some submodule exists, ``get_submodule`` should always be\n", " | used.\n", " | \n", " | Args:\n", " | target: The fully-qualified string name of the submodule\n", " | to look for. (See above example for how to specify a\n", " | fully-qualified string.)\n", " | \n", " | Returns:\n", " | torch.nn.Module: The submodule referenced by ``target``\n", " | \n", " | Raises:\n", " | AttributeError: If the target string references an invalid\n", " | path or resolves to something that is not an\n", " | ``nn.Module``\n", " | \n", " | ipu(self: ~T, device: Union[int, torch.device, NoneType] = None) -> ~T\n", " | Move all model parameters and buffers to the IPU.\n", " | \n", " | This also makes associated parameters and buffers different objects. So\n", " | it should be called before constructing optimizer if the module will\n", " | live on IPU while being optimized.\n", " | \n", " | .. note::\n", " | This method modifies the module in-place.\n", " | \n", " | Arguments:\n", " | device (int, optional): if specified, all parameters will be\n", " | copied to that device\n", " | \n", " | Returns:\n", " | Module: self\n", " | \n", " | load_state_dict(self, state_dict: Mapping[str, Any], strict: bool = True, assign: bool = False)\n", " | Copy parameters and buffers from :attr:`state_dict` into this module and its descendants.\n", " | \n", " | If :attr:`strict` is ``True``, then\n", " | the keys of :attr:`state_dict` must exactly match the keys returned\n", " | by this module's :meth:`~torch.nn.Module.state_dict` function.\n", " | \n", " | .. warning::\n", " | If :attr:`assign` is ``True`` the optimizer must be created after\n", " | the call to :attr:`load_state_dict` unless\n", " | :func:`~torch.__future__.get_swap_module_params_on_conversion` is ``True``.\n", " | \n", " | Args:\n", " | state_dict (dict): a dict containing parameters and\n", " | persistent buffers.\n", " | strict (bool, optional): whether to strictly enforce that the keys\n", " | in :attr:`state_dict` match the keys returned by this module's\n", " | :meth:`~torch.nn.Module.state_dict` function. Default: ``True``\n", " | assign (bool, optional): When ``False``, the properties of the tensors\n", " | in the current module are preserved while when ``True``, the\n", " | properties of the Tensors in the state dict are preserved. The only\n", " | exception is the ``requires_grad`` field of :class:`~torch.nn.Parameter`s\n", " | for which the value from the module is preserved.\n", " | Default: ``False``\n", " | \n", " | Returns:\n", " | ``NamedTuple`` with ``missing_keys`` and ``unexpected_keys`` fields:\n", " | * **missing_keys** is a list of str containing the missing keys\n", " | * **unexpected_keys** is a list of str containing the unexpected keys\n", " | \n", " | Note:\n", " | If a parameter or buffer is registered as ``None`` and its corresponding key\n", " | exists in :attr:`state_dict`, :meth:`load_state_dict` will raise a\n", " | ``RuntimeError``.\n", " | \n", " | modules(self) -> Iterator[ForwardRef('Module')]\n", " | Return an iterator over all modules in the network.\n", " | \n", " | Yields:\n", " | Module: a module in the network\n", " | \n", " | Note:\n", " | Duplicate modules are returned only once. In the following\n", " | example, ``l`` will be returned only once.\n", " | \n", " | Example::\n", " | \n", " | >>> l = nn.Linear(2, 2)\n", " | >>> net = nn.Sequential(l, l)\n", " | >>> for idx, m in enumerate(net.modules()):\n", " | ... print(idx, '->', m)\n", " | \n", " | 0 -> Sequential(\n", " | (0): Linear(in_features=2, out_features=2, bias=True)\n", " | (1): Linear(in_features=2, out_features=2, bias=True)\n", " | )\n", " | 1 -> Linear(in_features=2, out_features=2, bias=True)\n", " | \n", " | named_buffers(self, prefix: str = '', recurse: bool = True, remove_duplicate: bool = True) -> Iterator[Tuple[str, torch.Tensor]]\n", " | Return an iterator over module buffers, yielding both the name of the buffer as well as the buffer itself.\n", " | \n", " | Args:\n", " | prefix (str): prefix to prepend to all buffer names.\n", " | recurse (bool, optional): if True, then yields buffers of this module\n", " | and all submodules. Otherwise, yields only buffers that\n", " | are direct members of this module. Defaults to True.\n", " | remove_duplicate (bool, optional): whether to remove the duplicated buffers in the result. Defaults to True.\n", " | \n", " | Yields:\n", " | (str, torch.Tensor): Tuple containing the name and buffer\n", " | \n", " | Example::\n", " | \n", " | >>> # xdoctest: +SKIP(\"undefined vars\")\n", " | >>> for name, buf in self.named_buffers():\n", " | >>> if name in ['running_var']:\n", " | >>> print(buf.size())\n", " | \n", " | named_children(self) -> Iterator[Tuple[str, ForwardRef('Module')]]\n", " | Return an iterator over immediate children modules, yielding both the name of the module as well as the module itself.\n", " | \n", " | Yields:\n", " | (str, Module): Tuple containing a name and child module\n", " | \n", " | Example::\n", " | \n", " | >>> # xdoctest: +SKIP(\"undefined vars\")\n", " | >>> for name, module in model.named_children():\n", " | >>> if name in ['conv4', 'conv5']:\n", " | >>> print(module)\n", " | \n", " | named_modules(self, memo: Optional[Set[ForwardRef('Module')]] = None, prefix: str = '', remove_duplicate: bool = True)\n", " | Return an iterator over all modules in the network, yielding both the name of the module as well as the module itself.\n", " | \n", " | Args:\n", " | memo: a memo to store the set of modules already added to the result\n", " | prefix: a prefix that will be added to the name of the module\n", " | remove_duplicate: whether to remove the duplicated module instances in the result\n", " | or not\n", " | \n", " | Yields:\n", " | (str, Module): Tuple of name and module\n", " | \n", " | Note:\n", " | Duplicate modules are returned only once. In the following\n", " | example, ``l`` will be returned only once.\n", " | \n", " | Example::\n", " | \n", " | >>> l = nn.Linear(2, 2)\n", " | >>> net = nn.Sequential(l, l)\n", " | >>> for idx, m in enumerate(net.named_modules()):\n", " | ... print(idx, '->', m)\n", " | \n", " | 0 -> ('', Sequential(\n", " | (0): Linear(in_features=2, out_features=2, bias=True)\n", " | (1): Linear(in_features=2, out_features=2, bias=True)\n", " | ))\n", " | 1 -> ('0', Linear(in_features=2, out_features=2, bias=True))\n", " | \n", " | named_parameters(self, prefix: str = '', recurse: bool = True, remove_duplicate: bool = True) -> Iterator[Tuple[str, torch.nn.parameter.Parameter]]\n", " | Return an iterator over module parameters, yielding both the name of the parameter as well as the parameter itself.\n", " | \n", " | Args:\n", " | prefix (str): prefix to prepend to all parameter names.\n", " | recurse (bool): if True, then yields parameters of this module\n", " | and all submodules. Otherwise, yields only parameters that\n", " | are direct members of this module.\n", " | remove_duplicate (bool, optional): whether to remove the duplicated\n", " | parameters in the result. Defaults to True.\n", " | \n", " | Yields:\n", " | (str, Parameter): Tuple containing the name and parameter\n", " | \n", " | Example::\n", " | \n", " | >>> # xdoctest: +SKIP(\"undefined vars\")\n", " | >>> for name, param in self.named_parameters():\n", " | >>> if name in ['bias']:\n", " | >>> print(param.size())\n", " | \n", " | parameters(self, recurse: bool = True) -> Iterator[torch.nn.parameter.Parameter]\n", " | Return an iterator over module parameters.\n", " | \n", " | This is typically passed to an optimizer.\n", " | \n", " | Args:\n", " | recurse (bool): if True, then yields parameters of this module\n", " | and all submodules. Otherwise, yields only parameters that\n", " | are direct members of this module.\n", " | \n", " | Yields:\n", " | Parameter: module parameter\n", " | \n", " | Example::\n", " | \n", " | >>> # xdoctest: +SKIP(\"undefined vars\")\n", " | >>> for param in model.parameters():\n", " | >>> print(type(param), param.size())\n", " | (20L,)\n", " | (20L, 1L, 5L, 5L)\n", " | \n", " | register_backward_hook(self, hook: Callable[[ForwardRef('Module'), Union[Tuple[torch.Tensor, ...], torch.Tensor], Union[Tuple[torch.Tensor, ...], torch.Tensor]], Union[NoneType, Tuple[torch.Tensor, ...], torch.Tensor]]) -> torch.utils.hooks.RemovableHandle\n", " | Register a backward hook on the module.\n", " | \n", " | This function is deprecated in favor of :meth:`~torch.nn.Module.register_full_backward_hook` and\n", " | the behavior of this function will change in future versions.\n", " | \n", " | Returns:\n", " | :class:`torch.utils.hooks.RemovableHandle`:\n", " | a handle that can be used to remove the added hook by calling\n", " | ``handle.remove()``\n", " | \n", " | register_buffer(self, name: str, tensor: Optional[torch.Tensor], persistent: bool = True) -> None\n", " | Add a buffer to the module.\n", " | \n", " | This is typically used to register a buffer that should not to be\n", " | considered a model parameter. For example, BatchNorm's ``running_mean``\n", " | is not a parameter, but is part of the module's state. Buffers, by\n", " | default, are persistent and will be saved alongside parameters. This\n", " | behavior can be changed by setting :attr:`persistent` to ``False``. The\n", " | only difference between a persistent buffer and a non-persistent buffer\n", " | is that the latter will not be a part of this module's\n", " | :attr:`state_dict`.\n", " | \n", " | Buffers can be accessed as attributes using given names.\n", " | \n", " | Args:\n", " | name (str): name of the buffer. The buffer can be accessed\n", " | from this module using the given name\n", " | tensor (Tensor or None): buffer to be registered. If ``None``, then operations\n", " | that run on buffers, such as :attr:`cuda`, are ignored. If ``None``,\n", " | the buffer is **not** included in the module's :attr:`state_dict`.\n", " | persistent (bool): whether the buffer is part of this module's\n", " | :attr:`state_dict`.\n", " | \n", " | Example::\n", " | \n", " | >>> # xdoctest: +SKIP(\"undefined vars\")\n", " | >>> self.register_buffer('running_mean', torch.zeros(num_features))\n", " | \n", " | register_forward_hook(self, hook: Union[Callable[[~T, Tuple[Any, ...], Any], Optional[Any]], Callable[[~T, Tuple[Any, ...], Dict[str, Any], Any], Optional[Any]]], *, prepend: bool = False, with_kwargs: bool = False, always_call: bool = False) -> torch.utils.hooks.RemovableHandle\n", " | Register a forward hook on the module.\n", " | \n", " | The hook will be called every time after :func:`forward` has computed an output.\n", " | \n", " | If ``with_kwargs`` is ``False`` or not specified, the input contains only\n", " | the positional arguments given to the module. Keyword arguments won't be\n", " | passed to the hooks and only to the ``forward``. The hook can modify the\n", " | output. It can modify the input inplace but it will not have effect on\n", " | forward since this is called after :func:`forward` is called. The hook\n", " | should have the following signature::\n", " | \n", " | hook(module, args, output) -> None or modified output\n", " | \n", " | If ``with_kwargs`` is ``True``, the forward hook will be passed the\n", " | ``kwargs`` given to the forward function and be expected to return the\n", " | output possibly modified. The hook should have the following signature::\n", " | \n", " | hook(module, args, kwargs, output) -> None or modified output\n", " | \n", " | Args:\n", " | hook (Callable): The user defined hook to be registered.\n", " | prepend (bool): If ``True``, the provided ``hook`` will be fired\n", " | before all existing ``forward`` hooks on this\n", " | :class:`torch.nn.modules.Module`. Otherwise, the provided\n", " | ``hook`` will be fired after all existing ``forward`` hooks on\n", " | this :class:`torch.nn.modules.Module`. Note that global\n", " | ``forward`` hooks registered with\n", " | :func:`register_module_forward_hook` will fire before all hooks\n", " | registered by this method.\n", " | Default: ``False``\n", " | with_kwargs (bool): If ``True``, the ``hook`` will be passed the\n", " | kwargs given to the forward function.\n", " | Default: ``False``\n", " | always_call (bool): If ``True`` the ``hook`` will be run regardless of\n", " | whether an exception is raised while calling the Module.\n", " | Default: ``False``\n", " | \n", " | Returns:\n", " | :class:`torch.utils.hooks.RemovableHandle`:\n", " | a handle that can be used to remove the added hook by calling\n", " | ``handle.remove()``\n", " | \n", " | register_forward_pre_hook(self, hook: Union[Callable[[~T, Tuple[Any, ...]], Optional[Any]], Callable[[~T, Tuple[Any, ...], Dict[str, Any]], Optional[Tuple[Any, Dict[str, Any]]]]], *, prepend: bool = False, with_kwargs: bool = False) -> torch.utils.hooks.RemovableHandle\n", " | Register a forward pre-hook on the module.\n", " | \n", " | The hook will be called every time before :func:`forward` is invoked.\n", " | \n", " | \n", " | If ``with_kwargs`` is false or not specified, the input contains only\n", " | the positional arguments given to the module. Keyword arguments won't be\n", " | passed to the hooks and only to the ``forward``. The hook can modify the\n", " | input. User can either return a tuple or a single modified value in the\n", " | hook. We will wrap the value into a tuple if a single value is returned\n", " | (unless that value is already a tuple). The hook should have the\n", " | following signature::\n", " | \n", " | hook(module, args) -> None or modified input\n", " | \n", " | If ``with_kwargs`` is true, the forward pre-hook will be passed the\n", " | kwargs given to the forward function. And if the hook modifies the\n", " | input, both the args and kwargs should be returned. The hook should have\n", " | the following signature::\n", " | \n", " | hook(module, args, kwargs) -> None or a tuple of modified input and kwargs\n", " | \n", " | Args:\n", " | hook (Callable): The user defined hook to be registered.\n", " | prepend (bool): If true, the provided ``hook`` will be fired before\n", " | all existing ``forward_pre`` hooks on this\n", " | :class:`torch.nn.modules.Module`. Otherwise, the provided\n", " | ``hook`` will be fired after all existing ``forward_pre`` hooks\n", " | on this :class:`torch.nn.modules.Module`. Note that global\n", " | ``forward_pre`` hooks registered with\n", " | :func:`register_module_forward_pre_hook` will fire before all\n", " | hooks registered by this method.\n", " | Default: ``False``\n", " | with_kwargs (bool): If true, the ``hook`` will be passed the kwargs\n", " | given to the forward function.\n", " | Default: ``False``\n", " | \n", " | Returns:\n", " | :class:`torch.utils.hooks.RemovableHandle`:\n", " | a handle that can be used to remove the added hook by calling\n", " | ``handle.remove()``\n", " | \n", " | register_full_backward_hook(self, hook: Callable[[ForwardRef('Module'), Union[Tuple[torch.Tensor, ...], torch.Tensor], Union[Tuple[torch.Tensor, ...], torch.Tensor]], Union[NoneType, Tuple[torch.Tensor, ...], torch.Tensor]], prepend: bool = False) -> torch.utils.hooks.RemovableHandle\n", " | Register a backward hook on the module.\n", " | \n", " | The hook will be called every time the gradients with respect to a module\n", " | are computed, i.e. the hook will execute if and only if the gradients with\n", " | respect to module outputs are computed. The hook should have the following\n", " | signature::\n", " | \n", " | hook(module, grad_input, grad_output) -> tuple(Tensor) or None\n", " | \n", " | The :attr:`grad_input` and :attr:`grad_output` are tuples that contain the gradients\n", " | with respect to the inputs and outputs respectively. The hook should\n", " | not modify its arguments, but it can optionally return a new gradient with\n", " | respect to the input that will be used in place of :attr:`grad_input` in\n", " | subsequent computations. :attr:`grad_input` will only correspond to the inputs given\n", " | as positional arguments and all kwarg arguments are ignored. Entries\n", " | in :attr:`grad_input` and :attr:`grad_output` will be ``None`` for all non-Tensor\n", " | arguments.\n", " | \n", " | For technical reasons, when this hook is applied to a Module, its forward function will\n", " | receive a view of each Tensor passed to the Module. Similarly the caller will receive a view\n", " | of each Tensor returned by the Module's forward function.\n", " | \n", " | .. warning ::\n", " | Modifying inputs or outputs inplace is not allowed when using backward hooks and\n", " | will raise an error.\n", " | \n", " | Args:\n", " | hook (Callable): The user-defined hook to be registered.\n", " | prepend (bool): If true, the provided ``hook`` will be fired before\n", " | all existing ``backward`` hooks on this\n", " | :class:`torch.nn.modules.Module`. Otherwise, the provided\n", " | ``hook`` will be fired after all existing ``backward`` hooks on\n", " | this :class:`torch.nn.modules.Module`. Note that global\n", " | ``backward`` hooks registered with\n", " | :func:`register_module_full_backward_hook` will fire before\n", " | all hooks registered by this method.\n", " | \n", " | Returns:\n", " | :class:`torch.utils.hooks.RemovableHandle`:\n", " | a handle that can be used to remove the added hook by calling\n", " | ``handle.remove()``\n", " | \n", " | register_full_backward_pre_hook(self, hook: Callable[[ForwardRef('Module'), Union[Tuple[torch.Tensor, ...], torch.Tensor]], Union[NoneType, Tuple[torch.Tensor, ...], torch.Tensor]], prepend: bool = False) -> torch.utils.hooks.RemovableHandle\n", " | Register a backward pre-hook on the module.\n", " | \n", " | The hook will be called every time the gradients for the module are computed.\n", " | The hook should have the following signature::\n", " | \n", " | hook(module, grad_output) -> tuple[Tensor] or None\n", " | \n", " | The :attr:`grad_output` is a tuple. The hook should\n", " | not modify its arguments, but it can optionally return a new gradient with\n", " | respect to the output that will be used in place of :attr:`grad_output` in\n", " | subsequent computations. Entries in :attr:`grad_output` will be ``None`` for\n", " | all non-Tensor arguments.\n", " | \n", " | For technical reasons, when this hook is applied to a Module, its forward function will\n", " | receive a view of each Tensor passed to the Module. Similarly the caller will receive a view\n", " | of each Tensor returned by the Module's forward function.\n", " | \n", " | .. warning ::\n", " | Modifying inputs inplace is not allowed when using backward hooks and\n", " | will raise an error.\n", " | \n", " | Args:\n", " | hook (Callable): The user-defined hook to be registered.\n", " | prepend (bool): If true, the provided ``hook`` will be fired before\n", " | all existing ``backward_pre`` hooks on this\n", " | :class:`torch.nn.modules.Module`. Otherwise, the provided\n", " | ``hook`` will be fired after all existing ``backward_pre`` hooks\n", " | on this :class:`torch.nn.modules.Module`. Note that global\n", " | ``backward_pre`` hooks registered with\n", " | :func:`register_module_full_backward_pre_hook` will fire before\n", " | all hooks registered by this method.\n", " | \n", " | Returns:\n", " | :class:`torch.utils.hooks.RemovableHandle`:\n", " | a handle that can be used to remove the added hook by calling\n", " | ``handle.remove()``\n", " | \n", " | register_load_state_dict_post_hook(self, hook)\n", " | Register a post hook to be run after module's ``load_state_dict`` is called.\n", " | \n", " | It should have the following signature::\n", " | hook(module, incompatible_keys) -> None\n", " | \n", " | The ``module`` argument is the current module that this hook is registered\n", " | on, and the ``incompatible_keys`` argument is a ``NamedTuple`` consisting\n", " | of attributes ``missing_keys`` and ``unexpected_keys``. ``missing_keys``\n", " | is a ``list`` of ``str`` containing the missing keys and\n", " | ``unexpected_keys`` is a ``list`` of ``str`` containing the unexpected keys.\n", " | \n", " | The given incompatible_keys can be modified inplace if needed.\n", " | \n", " | Note that the checks performed when calling :func:`load_state_dict` with\n", " | ``strict=True`` are affected by modifications the hook makes to\n", " | ``missing_keys`` or ``unexpected_keys``, as expected. Additions to either\n", " | set of keys will result in an error being thrown when ``strict=True``, and\n", " | clearing out both missing and unexpected keys will avoid an error.\n", " | \n", " | Returns:\n", " | :class:`torch.utils.hooks.RemovableHandle`:\n", " | a handle that can be used to remove the added hook by calling\n", " | ``handle.remove()``\n", " | \n", " | register_module(self, name: str, module: Optional[ForwardRef('Module')]) -> None\n", " | Alias for :func:`add_module`.\n", " | \n", " | register_parameter(self, name: str, param: Optional[torch.nn.parameter.Parameter]) -> None\n", " | Add a parameter to the module.\n", " | \n", " | The parameter can be accessed as an attribute using given name.\n", " | \n", " | Args:\n", " | name (str): name of the parameter. The parameter can be accessed\n", " | from this module using the given name\n", " | param (Parameter or None): parameter to be added to the module. If\n", " | ``None``, then operations that run on parameters, such as :attr:`cuda`,\n", " | are ignored. If ``None``, the parameter is **not** included in the\n", " | module's :attr:`state_dict`.\n", " | \n", " | register_state_dict_pre_hook(self, hook)\n", " | Register a pre-hook for the :meth:`~torch.nn.Module.state_dict` method.\n", " | \n", " | These hooks will be called with arguments: ``self``, ``prefix``,\n", " | and ``keep_vars`` before calling ``state_dict`` on ``self``. The registered\n", " | hooks can be used to perform pre-processing before the ``state_dict``\n", " | call is made.\n", " | \n", " | requires_grad_(self: ~T, requires_grad: bool = True) -> ~T\n", " | Change if autograd should record operations on parameters in this module.\n", " | \n", " | This method sets the parameters' :attr:`requires_grad` attributes\n", " | in-place.\n", " | \n", " | This method is helpful for freezing part of the module for finetuning\n", " | or training parts of a model individually (e.g., GAN training).\n", " | \n", " | See :ref:`locally-disable-grad-doc` for a comparison between\n", " | `.requires_grad_()` and several similar mechanisms that may be confused with it.\n", " | \n", " | Args:\n", " | requires_grad (bool): whether autograd should record operations on\n", " | parameters in this module. Default: ``True``.\n", " | \n", " | Returns:\n", " | Module: self\n", " | \n", " | set_extra_state(self, state: Any) -> None\n", " | Set extra state contained in the loaded `state_dict`.\n", " | \n", " | This function is called from :func:`load_state_dict` to handle any extra state\n", " | found within the `state_dict`. Implement this function and a corresponding\n", " | :func:`get_extra_state` for your module if you need to store extra state within its\n", " | `state_dict`.\n", " | \n", " | Args:\n", " | state (dict): Extra state from the `state_dict`\n", " | \n", " | share_memory(self: ~T) -> ~T\n", " | See :meth:`torch.Tensor.share_memory_`.\n", " | \n", " | state_dict(self, *args, destination=None, prefix='', keep_vars=False)\n", " | Return a dictionary containing references to the whole state of the module.\n", " | \n", " | Both parameters and persistent buffers (e.g. running averages) are\n", " | included. Keys are corresponding parameter and buffer names.\n", " | Parameters and buffers set to ``None`` are not included.\n", " | \n", " | .. note::\n", " | The returned object is a shallow copy. It contains references\n", " | to the module's parameters and buffers.\n", " | \n", " | .. warning::\n", " | Currently ``state_dict()`` also accepts positional arguments for\n", " | ``destination``, ``prefix`` and ``keep_vars`` in order. However,\n", " | this is being deprecated and keyword arguments will be enforced in\n", " | future releases.\n", " | \n", " | .. warning::\n", " | Please avoid the use of argument ``destination`` as it is not\n", " | designed for end-users.\n", " | \n", " | Args:\n", " | destination (dict, optional): If provided, the state of module will\n", " | be updated into the dict and the same object is returned.\n", " | Otherwise, an ``OrderedDict`` will be created and returned.\n", " | Default: ``None``.\n", " | prefix (str, optional): a prefix added to parameter and buffer\n", " | names to compose the keys in state_dict. Default: ``''``.\n", " | keep_vars (bool, optional): by default the :class:`~torch.Tensor` s\n", " | returned in the state dict are detached from autograd. If it's\n", " | set to ``True``, detaching will not be performed.\n", " | Default: ``False``.\n", " | \n", " | Returns:\n", " | dict:\n", " | a dictionary containing a whole state of the module\n", " | \n", " | Example::\n", " | \n", " | >>> # xdoctest: +SKIP(\"undefined vars\")\n", " | >>> module.state_dict().keys()\n", " | ['bias', 'weight']\n", " | \n", " | to_empty(self: ~T, *, device: Union[int, str, torch.device, NoneType], recurse: bool = True) -> ~T\n", " | Move the parameters and buffers to the specified device without copying storage.\n", " | \n", " | Args:\n", " | device (:class:`torch.device`): The desired device of the parameters\n", " | and buffers in this module.\n", " | recurse (bool): Whether parameters and buffers of submodules should\n", " | be recursively moved to the specified device.\n", " | \n", " | Returns:\n", " | Module: self\n", " | \n", " | train(self: ~T, mode: bool = True) -> ~T\n", " | Set the module in training mode.\n", " | \n", " | This has any effect only on certain modules. See documentations of\n", " | particular modules for details of their behaviors in training/evaluation\n", " | mode, if they are affected, e.g. :class:`Dropout`, :class:`BatchNorm`,\n", " | etc.\n", " | \n", " | Args:\n", " | mode (bool): whether to set training mode (``True``) or evaluation\n", " | mode (``False``). Default: ``True``.\n", " | \n", " | Returns:\n", " | Module: self\n", " | \n", " | type(self: ~T, dst_type: Union[torch.dtype, str]) -> ~T\n", " | Casts all parameters and buffers to :attr:`dst_type`.\n", " | \n", " | .. note::\n", " | This method modifies the module in-place.\n", " | \n", " | Args:\n", " | dst_type (type or string): the desired type\n", " | \n", " | Returns:\n", " | Module: self\n", " | \n", " | xpu(self: ~T, device: Union[int, torch.device, NoneType] = None) -> ~T\n", " | Move all model parameters and buffers to the XPU.\n", " | \n", " | This also makes associated parameters and buffers different objects. So\n", " | it should be called before constructing optimizer if the module will\n", " | live on XPU while being optimized.\n", " | \n", " | .. note::\n", " | This method modifies the module in-place.\n", " | \n", " | Arguments:\n", " | device (int, optional): if specified, all parameters will be\n", " | copied to that device\n", " | \n", " | Returns:\n", " | Module: self\n", " | \n", " | zero_grad(self, set_to_none: bool = True) -> None\n", " | Reset gradients of all model parameters.\n", " | \n", " | See similar function under :class:`torch.optim.Optimizer` for more context.\n", " | \n", " | Args:\n", " | set_to_none (bool): instead of setting to zero, set the grads to None.\n", " | See :meth:`torch.optim.Optimizer.zero_grad` for details.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors inherited from torch.nn.modules.module.Module:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data and other attributes inherited from torch.nn.modules.module.Module:\n", " | \n", " | T_destination = ~T_destination\n", " | \n", " | call_super_init = False\n", " | \n", " | dump_patches = False\n", " | \n", " | ----------------------------------------------------------------------\n", " | Methods inherited from transformers.modeling_utils.ModuleUtilsMixin:\n", " | \n", " | add_memory_hooks(self)\n", " | Add a memory hook before and after each sub-module forward pass to record increase in memory consumption.\n", " | \n", " | Increase in memory consumption is stored in a `mem_rss_diff` attribute for each module and can be reset to zero\n", " | with `model.reset_memory_hooks_state()`.\n", " | \n", " | estimate_tokens(self, input_dict: Dict[str, Union[torch.Tensor, Any]]) -> int\n", " | Helper function to estimate the total number of tokens from the model inputs.\n", " | \n", " | Args:\n", " | inputs (`dict`): The model inputs.\n", " | \n", " | Returns:\n", " | `int`: The total number of tokens.\n", " | \n", " | floating_point_ops(self, input_dict: Dict[str, Union[torch.Tensor, Any]], exclude_embeddings: bool = True) -> int\n", " | Get number of (optionally, non-embeddings) floating-point operations for the forward and backward passes of a\n", " | batch with this transformer model. Default approximation neglects the quadratic dependency on the number of\n", " | tokens (valid if `12 * d_model << sequence_length`) as laid out in [this\n", " | paper](https://arxiv.org/pdf/2001.08361.pdf) section 2.1. Should be overridden for transformers with parameter\n", " | re-use e.g. Albert or Universal Transformers, or if doing long-range modeling with very high sequence lengths.\n", " | \n", " | Args:\n", " | batch_size (`int`):\n", " | The batch size for the forward pass.\n", " | \n", " | sequence_length (`int`):\n", " | The number of tokens in each line of the batch.\n", " | \n", " | exclude_embeddings (`bool`, *optional*, defaults to `True`):\n", " | Whether or not to count embedding and softmax operations.\n", " | \n", " | Returns:\n", " | `int`: The number of floating-point operations.\n", " | \n", " | get_extended_attention_mask(self, attention_mask: torch.Tensor, input_shape: Tuple[int], device: torch.device = None, dtype: torch.float32 = None) -> torch.Tensor\n", " | Makes broadcastable attention and causal masks so that future and masked tokens are ignored.\n", " | \n", " | Arguments:\n", " | attention_mask (`torch.Tensor`):\n", " | Mask with ones indicating tokens to attend to, zeros for tokens to ignore.\n", " | input_shape (`Tuple[int]`):\n", " | The shape of the input to the model.\n", " | \n", " | Returns:\n", " | `torch.Tensor` The extended attention mask, with a the same dtype as `attention_mask.dtype`.\n", " | \n", " | get_head_mask(self, head_mask: Optional[torch.Tensor], num_hidden_layers: int, is_attention_chunked: bool = False) -> torch.Tensor\n", " | Prepare the head mask if needed.\n", " | \n", " | Args:\n", " | head_mask (`torch.Tensor` with shape `[num_heads]` or `[num_hidden_layers x num_heads]`, *optional*):\n", " | The mask indicating if we should keep the heads or not (1.0 for keep, 0.0 for discard).\n", " | num_hidden_layers (`int`):\n", " | The number of hidden layers in the model.\n", " | is_attention_chunked (`bool`, *optional*, defaults to `False`):\n", " | Whether or not the attentions scores are computed by chunks or not.\n", " | \n", " | Returns:\n", " | `torch.Tensor` with shape `[num_hidden_layers x batch x num_heads x seq_length x seq_length]` or list with\n", " | `[None]` for each layer.\n", " | \n", " | invert_attention_mask(self, encoder_attention_mask: torch.Tensor) -> torch.Tensor\n", " | Invert an attention mask (e.g., switches 0. and 1.).\n", " | \n", " | Args:\n", " | encoder_attention_mask (`torch.Tensor`): An attention mask.\n", " | \n", " | Returns:\n", " | `torch.Tensor`: The inverted attention mask.\n", " | \n", " | num_parameters(self, only_trainable: bool = False, exclude_embeddings: bool = False) -> int\n", " | Get number of (optionally, trainable or non-embeddings) parameters in the module.\n", " | \n", " | Args:\n", " | only_trainable (`bool`, *optional*, defaults to `False`):\n", " | Whether or not to return only the number of trainable parameters\n", " | \n", " | exclude_embeddings (`bool`, *optional*, defaults to `False`):\n", " | Whether or not to return only the number of non-embeddings parameters\n", " | \n", " | Returns:\n", " | `int`: The number of parameters.\n", " | \n", " | reset_memory_hooks_state(self)\n", " | Reset the `mem_rss_diff` attribute of each module (see [`~modeling_utils.ModuleUtilsMixin.add_memory_hooks`]).\n", " | \n", " | ----------------------------------------------------------------------\n", " | Static methods inherited from transformers.modeling_utils.ModuleUtilsMixin:\n", " | \n", " | create_extended_attention_mask_for_decoder(input_shape, attention_mask, device=None)\n", " | \n", " | ----------------------------------------------------------------------\n", " | Readonly properties inherited from transformers.modeling_utils.ModuleUtilsMixin:\n", " | \n", " | device\n", " | `torch.device`: The device on which the module is (assuming that all the module parameters are on the same\n", " | device).\n", " | \n", " | dtype\n", " | `torch.dtype`: The dtype of the module (assuming that all the module parameters have the same dtype).\n", " | \n", " | ----------------------------------------------------------------------\n", " | Methods inherited from transformers.generation.utils.GenerationMixin:\n", " | \n", " | compute_transition_scores(self, sequences: torch.Tensor, scores: Tuple[torch.Tensor], beam_indices: Optional[torch.Tensor] = None, normalize_logits: bool = False) -> torch.Tensor\n", " | Computes the transition scores of sequences given the generation scores (and beam indices, if beam search was\n", " | used). This is a convenient method to quicky obtain the scores of the selected tokens at generation time.\n", " | \n", " | Parameters:\n", " | sequences (`torch.LongTensor`):\n", " | The generated sequences. The second dimension (sequence_length) is either equal to `max_length` or\n", " | shorter if all batches finished early due to the `eos_token_id`.\n", " | scores (`tuple(torch.FloatTensor)`):\n", " | Transition scores for each vocabulary token at each generation step. Beam transition scores consisting\n", " | of log probabilities of tokens conditioned on log softmax of previously generated tokens in this beam.\n", " | Tuple of `torch.FloatTensor` with up to `max_new_tokens` elements (one element for each generated token),\n", " | with each tensor of shape `(batch_size*num_beams, config.vocab_size)`.\n", " | beam_indices (`torch.LongTensor`, *optional*):\n", " | Beam indices of generated token id at each generation step. `torch.LongTensor` of shape\n", " | `(batch_size*num_return_sequences, sequence_length)`. Only required if a `num_beams>1` at\n", " | generate-time.\n", " | normalize_logits (`bool`, *optional*, defaults to `False`):\n", " | Whether to normalize the logits (which, for legacy reasons, may be unnormalized).\n", " | \n", " | Return:\n", " | `torch.Tensor`: A `torch.Tensor` of shape `(batch_size*num_return_sequences, sequence_length)` containing\n", " | the transition scores (logits)\n", " | \n", " | Examples:\n", " | \n", " | ```python\n", " | >>> from transformers import GPT2Tokenizer, AutoModelForCausalLM\n", " | >>> import numpy as np\n", " | \n", " | >>> tokenizer = GPT2Tokenizer.from_pretrained(\"gpt2\")\n", " | >>> model = AutoModelForCausalLM.from_pretrained(\"openai-community/gpt2\")\n", " | >>> tokenizer.pad_token_id = tokenizer.eos_token_id\n", " | >>> inputs = tokenizer([\"Today is\"], return_tensors=\"pt\")\n", " | \n", " | >>> # Example 1: Print the scores for each token generated with Greedy Search\n", " | >>> outputs = model.generate(**inputs, max_new_tokens=5, return_dict_in_generate=True, output_scores=True)\n", " | >>> transition_scores = model.compute_transition_scores(\n", " | ... outputs.sequences, outputs.scores, normalize_logits=True\n", " | ... )\n", " | >>> # input_length is the length of the input prompt for decoder-only models, like the GPT family, and 1 for\n", " | >>> # encoder-decoder models, like BART or T5.\n", " | >>> input_length = 1 if model.config.is_encoder_decoder else inputs.input_ids.shape[1]\n", " | >>> generated_tokens = outputs.sequences[:, input_length:]\n", " | >>> for tok, score in zip(generated_tokens[0], transition_scores[0]):\n", " | ... # | token | token string | log probability | probability\n", " | ... print(f\"| {tok:5d} | {tokenizer.decode(tok):8s} | {score.numpy():.3f} | {np.exp(score.numpy()):.2%}\")\n", " | | 262 | the | -1.414 | 24.33%\n", " | | 1110 | day | -2.609 | 7.36%\n", " | | 618 | when | -2.010 | 13.40%\n", " | | 356 | we | -1.859 | 15.58%\n", " | | 460 | can | -2.508 | 8.14%\n", " | \n", " | >>> # Example 2: Reconstruct the sequence scores from Beam Search\n", " | >>> outputs = model.generate(\n", " | ... **inputs,\n", " | ... max_new_tokens=5,\n", " | ... num_beams=4,\n", " | ... num_return_sequences=4,\n", " | ... return_dict_in_generate=True,\n", " | ... output_scores=True,\n", " | ... )\n", " | >>> transition_scores = model.compute_transition_scores(\n", " | ... outputs.sequences, outputs.scores, outputs.beam_indices, normalize_logits=False\n", " | ... )\n", " | >>> # If you sum the generated tokens' scores and apply the length penalty, you'll get the sequence scores.\n", " | >>> # Tip 1: recomputing the scores is only guaranteed to match with `normalize_logits=False`. Depending on the\n", " | >>> # use case, you might want to recompute it with `normalize_logits=True`.\n", " | >>> # Tip 2: the output length does NOT include the input length\n", " | >>> output_length = np.sum(transition_scores.numpy() < 0, axis=1)\n", " | >>> length_penalty = model.generation_config.length_penalty\n", " | >>> reconstructed_scores = transition_scores.sum(axis=1) / (output_length**length_penalty)\n", " | >>> print(np.allclose(outputs.sequences_scores, reconstructed_scores))\n", " | True\n", " | ```\n", " | \n", " | generate(self, inputs: Optional[torch.Tensor] = None, generation_config: Optional[transformers.generation.configuration_utils.GenerationConfig] = None, logits_processor: Optional[transformers.generation.logits_process.LogitsProcessorList] = None, stopping_criteria: Optional[transformers.generation.stopping_criteria.StoppingCriteriaList] = None, prefix_allowed_tokens_fn: Optional[Callable[[int, torch.Tensor], List[int]]] = None, synced_gpus: Optional[bool] = None, assistant_model: Optional[ForwardRef('PreTrainedModel')] = None, streamer: Optional[ForwardRef('BaseStreamer')] = None, negative_prompt_ids: Optional[torch.Tensor] = None, negative_prompt_attention_mask: Optional[torch.Tensor] = None, **kwargs) -> Union[transformers.generation.utils.GenerateDecoderOnlyOutput, transformers.generation.utils.GenerateEncoderDecoderOutput, transformers.generation.utils.GenerateBeamDecoderOnlyOutput, transformers.generation.utils.GenerateBeamEncoderDecoderOutput, torch.LongTensor]\n", " | Generates sequences of token ids for models with a language modeling head.\n", " | \n", " | \n", " | \n", " | Most generation-controlling parameters are set in `generation_config` which, if not passed, will be set to the\n", " | model's default generation configuration. You can override any `generation_config` by passing the corresponding\n", " | parameters to generate(), e.g. `.generate(inputs, num_beams=4, do_sample=True)`.\n", " | \n", " | For an overview of generation strategies and code examples, check out the [following\n", " | guide](../generation_strategies).\n", " | \n", " | \n", " | \n", " | Parameters:\n", " | inputs (`torch.Tensor` of varying shape depending on the modality, *optional*):\n", " | The sequence used as a prompt for the generation or as model inputs to the encoder. If `None` the\n", " | method initializes it with `bos_token_id` and a batch size of 1. For decoder-only models `inputs`\n", " | should be in the format of `input_ids`. For encoder-decoder models *inputs* can represent any of\n", " | `input_ids`, `input_values`, `input_features`, or `pixel_values`.\n", " | generation_config ([`~generation.GenerationConfig`], *optional*):\n", " | The generation configuration to be used as base parametrization for the generation call. `**kwargs`\n", " | passed to generate matching the attributes of `generation_config` will override them. If\n", " | `generation_config` is not provided, the default will be used, which has the following loading\n", " | priority: 1) from the `generation_config.json` model file, if it exists; 2) from the model\n", " | configuration. Please note that unspecified parameters will inherit [`~generation.GenerationConfig`]'s\n", " | default values, whose documentation should be checked to parameterize generation.\n", " | logits_processor (`LogitsProcessorList`, *optional*):\n", " | Custom logits processors that complement the default logits processors built from arguments and\n", " | generation config. If a logit processor is passed that is already created with the arguments or a\n", " | generation config an error is thrown. This feature is intended for advanced users.\n", " | stopping_criteria (`StoppingCriteriaList`, *optional*):\n", " | Custom stopping criteria that complements the default stopping criteria built from arguments and a\n", " | generation config. If a stopping criteria is passed that is already created with the arguments or a\n", " | generation config an error is thrown. If your stopping criteria depends on the `scores` input, make\n", " | sure you pass `return_dict_in_generate=True, output_scores=True` to `generate`. This feature is\n", " | intended for advanced users.\n", " | prefix_allowed_tokens_fn (`Callable[[int, torch.Tensor], List[int]]`, *optional*):\n", " | If provided, this function constraints the beam search to allowed tokens only at each step. If not\n", " | provided no constraint is applied. This function takes 2 arguments: the batch ID `batch_id` and\n", " | `input_ids`. It has to return a list with the allowed tokens for the next generation step conditioned\n", " | on the batch ID `batch_id` and the previously generated tokens `inputs_ids`. This argument is useful\n", " | for constrained generation conditioned on the prefix, as described in [Autoregressive Entity\n", " | Retrieval](https://arxiv.org/abs/2010.00904).\n", " | synced_gpus (`bool`, *optional*):\n", " | Whether to continue running the while loop until max_length. Unless overridden this flag will be set to\n", " | `True` under DeepSpeed ZeRO Stage 3 multiple GPUs environment to avoid hanging if one GPU finished\n", " | generating before other GPUs. Otherwise it'll be set to `False`.\n", " | assistant_model (`PreTrainedModel`, *optional*):\n", " | An assistant model that can be used to accelerate generation. The assistant model must have the exact\n", " | same tokenizer. The acceleration is achieved when forecasting candidate tokens with the assistent model\n", " | is much faster than running generation with the model you're calling generate from. As such, the\n", " | assistant model should be much smaller.\n", " | streamer (`BaseStreamer`, *optional*):\n", " | Streamer object that will be used to stream the generated sequences. Generated tokens are passed\n", " | through `streamer.put(token_ids)` and the streamer is responsible for any further processing.\n", " | negative_prompt_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):\n", " | The negative prompt needed for some processors such as CFG. The batch size must match the input batch\n", " | size. This is an experimental feature, subject to breaking API changes in future versions.\n", " | negative_prompt_attention_mask (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):\n", " | Attention_mask for `negative_prompt_ids`.\n", " | kwargs (`Dict[str, Any]`, *optional*):\n", " | Ad hoc parametrization of `generation_config` and/or additional model-specific kwargs that will be\n", " | forwarded to the `forward` function of the model. If the model is an encoder-decoder model, encoder\n", " | specific kwargs should not be prefixed and decoder specific kwargs should be prefixed with *decoder_*.\n", " | \n", " | Return:\n", " | [`~utils.ModelOutput`] or `torch.LongTensor`: A [`~utils.ModelOutput`] (if `return_dict_in_generate=True`\n", " | or when `config.return_dict_in_generate=True`) or a `torch.LongTensor`.\n", " | \n", " | If the model is *not* an encoder-decoder model (`model.config.is_encoder_decoder=False`), the possible\n", " | [`~utils.ModelOutput`] types are:\n", " | \n", " | - [`~generation.GenerateDecoderOnlyOutput`],\n", " | - [`~generation.GenerateBeamDecoderOnlyOutput`]\n", " | \n", " | If the model is an encoder-decoder model (`model.config.is_encoder_decoder=True`), the possible\n", " | [`~utils.ModelOutput`] types are:\n", " | \n", " | - [`~generation.GenerateEncoderDecoderOutput`],\n", " | - [`~generation.GenerateBeamEncoderDecoderOutput`]\n", " | \n", " | prepare_inputs_for_generation(self, *args, **kwargs)\n", " | \n", " | ----------------------------------------------------------------------\n", " | Methods inherited from transformers.integrations.peft.PeftAdapterMixin:\n", " | \n", " | active_adapter(self) -> str\n", " | \n", " | active_adapters(self) -> List[str]\n", " | If you are not familiar with adapters and PEFT methods, we invite you to read more about them on the PEFT\n", " | official documentation: https://huggingface.co/docs/peft\n", " | \n", " | Gets the current active adapters of the model. In case of multi-adapter inference (combining multiple adapters\n", " | for inference) returns the list of all active adapters so that users can deal with them accordingly.\n", " | \n", " | For previous PEFT versions (that does not support multi-adapter inference), `module.active_adapter` will return\n", " | a single string.\n", " | \n", " | add_adapter(self, adapter_config, adapter_name: Optional[str] = None) -> None\n", " | If you are not familiar with adapters and PEFT methods, we invite you to read more about them on the PEFT\n", " | official documentation: https://huggingface.co/docs/peft\n", " | \n", " | Adds a fresh new adapter to the current model for training purpose. If no adapter name is passed, a default\n", " | name is assigned to the adapter to follow the convention of PEFT library (in PEFT we use \"default\" as the\n", " | default adapter name).\n", " | \n", " | Args:\n", " | adapter_config (`~peft.PeftConfig`):\n", " | The configuration of the adapter to add, supported adapters are non-prefix tuning and adaption prompts\n", " | methods\n", " | adapter_name (`str`, *optional*, defaults to `\"default\"`):\n", " | The name of the adapter to add. If no name is passed, a default name is assigned to the adapter.\n", " | \n", " | disable_adapters(self) -> None\n", " | If you are not familiar with adapters and PEFT methods, we invite you to read more about them on the PEFT\n", " | official documentation: https://huggingface.co/docs/peft\n", " | \n", " | Disable all adapters that are attached to the model. This leads to inferring with the base model only.\n", " | \n", " | enable_adapters(self) -> None\n", " | If you are not familiar with adapters and PEFT methods, we invite you to read more about them on the PEFT\n", " | official documentation: https://huggingface.co/docs/peft\n", " | \n", " | Enable adapters that are attached to the model. The model will use `self.active_adapter()`\n", " | \n", " | get_adapter_state_dict(self, adapter_name: Optional[str] = None) -> dict\n", " | If you are not familiar with adapters and PEFT methods, we invite you to read more about them on the PEFT\n", " | official documentation: https://huggingface.co/docs/peft\n", " | \n", " | Gets the adapter state dict that should only contain the weights tensors of the specified adapter_name adapter.\n", " | If no adapter_name is passed, the active adapter is used.\n", " | \n", " | Args:\n", " | adapter_name (`str`, *optional*):\n", " | The name of the adapter to get the state dict from. If no name is passed, the active adapter is used.\n", " | \n", " | load_adapter(self, peft_model_id: Optional[str] = None, adapter_name: Optional[str] = None, revision: Optional[str] = None, token: Optional[str] = None, device_map: Optional[str] = 'auto', max_memory: Optional[str] = None, offload_folder: Optional[str] = None, offload_index: Optional[int] = None, peft_config: Dict[str, Any] = None, adapter_state_dict: Optional[Dict[str, ForwardRef('torch.Tensor')]] = None, adapter_kwargs: Optional[Dict[str, Any]] = None) -> None\n", " | Load adapter weights from file or remote Hub folder. If you are not familiar with adapters and PEFT methods, we\n", " | invite you to read more about them on PEFT official documentation: https://huggingface.co/docs/peft\n", " | \n", " | Requires peft as a backend to load the adapter weights.\n", " | \n", " | Args:\n", " | peft_model_id (`str`, *optional*):\n", " | The identifier of the model to look for on the Hub, or a local path to the saved adapter config file\n", " | and adapter weights.\n", " | adapter_name (`str`, *optional*):\n", " | The adapter name to use. If not set, will use the default adapter.\n", " | revision (`str`, *optional*, defaults to `\"main\"`):\n", " | The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a\n", " | git-based system for storing models and other artifacts on huggingface.co, so `revision` can be any\n", " | identifier allowed by git.\n", " | \n", " | \n", " | \n", " | To test a pull request you made on the Hub, you can pass `revision=\"refs/pr/\".\n", " | \n", " | \n", " | \n", " | token (`str`, `optional`):\n", " | Whether to use authentication token to load the remote folder. Userful to load private repositories\n", " | that are on HuggingFace Hub. You might need to call `huggingface-cli login` and paste your tokens to\n", " | cache it.\n", " | device_map (`str` or `Dict[str, Union[int, str, torch.device]]` or `int` or `torch.device`, *optional*):\n", " | A map that specifies where each submodule should go. It doesn't need to be refined to each\n", " | parameter/buffer name, once a given module name is inside, every submodule of it will be sent to the\n", " | same device. If we only pass the device (*e.g.*, `\"cpu\"`, `\"cuda:1\"`, `\"mps\"`, or a GPU ordinal rank\n", " | like `1`) on which the model will be allocated, the device map will map the entire model to this\n", " | device. Passing `device_map = 0` means put the whole model on GPU 0.\n", " | \n", " | To have Accelerate compute the most optimized `device_map` automatically, set `device_map=\"auto\"`. For\n", " | more information about each option see [designing a device\n", " | map](https://hf.co/docs/accelerate/main/en/usage_guides/big_modeling#designing-a-device-map).\n", " | max_memory (`Dict`, *optional*):\n", " | A dictionary device identifier to maximum memory. Will default to the maximum memory available for each\n", " | GPU and the available CPU RAM if unset.\n", " | offload_folder (`str` or `os.PathLike`, `optional`):\n", " | If the `device_map` contains any value `\"disk\"`, the folder where we will offload weights.\n", " | offload_index (`int`, `optional`):\n", " | `offload_index` argument to be passed to `accelerate.dispatch_model` method.\n", " | peft_config (`Dict[str, Any]`, *optional*):\n", " | The configuration of the adapter to add, supported adapters are non-prefix tuning and adaption prompts\n", " | methods. This argument is used in case users directly pass PEFT state dicts\n", " | adapter_state_dict (`Dict[str, torch.Tensor]`, *optional*):\n", " | The state dict of the adapter to load. This argument is used in case users directly pass PEFT state\n", " | dicts\n", " | adapter_kwargs (`Dict[str, Any]`, *optional*):\n", " | Additional keyword arguments passed along to the `from_pretrained` method of the adapter config and\n", " | `find_adapter_config_file` method.\n", " | \n", " | set_adapter(self, adapter_name: Union[List[str], str]) -> None\n", " | If you are not familiar with adapters and PEFT methods, we invite you to read more about them on the PEFT\n", " | official documentation: https://huggingface.co/docs/peft\n", " | \n", " | Sets a specific adapter by forcing the model to use a that adapter and disable the other adapters.\n", " | \n", " | Args:\n", " | adapter_name (`Union[List[str], str]`):\n", " | The name of the adapter to set. Can be also a list of strings to set multiple adapters.\n", "\n" ] } ] }, { "cell_type": "code", "source": [ "def classify(image):\n", " image = processor(image, return_tensors=\"pt\")['pixel_values']\n", " logits = model(image).logits\n", " predicted_label = logits.argmax(-1).item()\n", " return model.config.id2label[predicted_label]" ], "metadata": { "id": "JkJZGyfAFlXy" }, "execution_count": 21, "outputs": [] }, { "cell_type": "code", "source": [ "iface = gr.Interface(fn=classify, inputs=gr.Image(), outputs=gr.Label(), title='RES NET 18', description='upload an image')\n", "iface.launch()" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 645 }, "id": "OqWmSgbMGvut", "outputId": "c1250b72-a137-48bf-8c0d-a0fca4366fdd" }, "execution_count": 22, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Setting queue=True in a Colab notebook requires sharing enabled. Setting `share=True` (you can turn this off by setting `share=False` in `launch()` explicitly).\n", "\n", "Colab notebook detected. To show errors in colab notebook, set debug=True in launch()\n", "Running on public URL: https://88df876de7ee0349fc.gradio.live\n", "\n", "This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "" ], "text/html": [ "
" ] }, "metadata": {} }, { "output_type": "execute_result", "data": { "text/plain": [] }, "metadata": {}, "execution_count": 22 } ] }, { "cell_type": "markdown", "source": [ "### Gradio Pipeline Integration" ], "metadata": { "id": "QpvartECHTQt" } }, { "cell_type": "code", "source": [ "from transformers import pipeline" ], "metadata": { "id": "tY7nXVUNHVuD" }, "execution_count": 23, "outputs": [] }, { "cell_type": "code", "source": [ "sentimenet_analysis = pipeline(\"sentiment-analysis\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 234, "referenced_widgets": [ "e99d8993a3de4335acfd88a916cec1bd", "870db462077d41c4994136b83133eedd", "951b722980b4498fbf4d7c7372b171cd", "ba71825d3cc54da5af833ea6b4f9d6e3", "72693d2d0010433182e008e724d1e770", "ce0a0a69a02946898b85a80ec0586cc4", "1686adf30b4440de8b0f6393895b2af3", "b180cfd6bc6a465bafe585251f5edb01", "285ecdbaa68341d1b2cecd40c77e11b6", "eddb2459839f4108bc3425e49c9dad3d", "88e88bca01754cdc9ba2821c6d616a56", "5b05f4a2d10b43529e4cbac04fb4b4bd", "22b410db4cfb4dcebea1fa62b1fe525d", "09ca1345826247ceb467224ec6036755", "9ce892afbd7147d4940c9e123a61d734", "b140aeaff5914630b340c281e8cf8b7b", "4a2c2c7efe8a41a0960cf8cf4c66c597", "a963388490bd4984a33493d5afec3f4d", "4f794bf9f8f045cba1e7f024cf96cfb3", "76ddd37781664c5d810245c2378bb3fa", "78e31616065e4af9b10abfe1545362a0", "bddbde48046b4a99856105fe5f404d3c", "22ce43b857c84b4aa45e6f66e0e89380", "13c699e0a1ae4848b307b06872a44ab9", "de533dbd5b9d489a84ed225ff875b9eb", "a2b18eff1e084b1aaff6e46b614fe8ae", "bffcae4563804c4cb0ca583c4fd242df", "70b8a3617b9840e293de99aee3181505", "24ca25272e2144e9b6c45c4549b1d191", "aa285a657c97403780a3c879738d2d53", "0c12ede2e96b4774b1aab90832b02ec1", "e9f3d794824041938616310f04597375", "6ea3d7a37d014926801ff53e98c70858", "dcf13204571740e19778b60387d551b4", "bdaa3cb1b58846bc92303eb02c3cb3e5", "29c67b9701884e80b23e2fce6b3fb432", "bf3e47f63e3e48e38a438972cd278a1a", "ecc76cd452df470dac87b4d29059981c", "664f8b46de1a483baf7dbbda27ceec1f", "6cd5857383174e71b286a1bafefa3a03", "75bdbecaf20e4cb5aa5303fecfe7665c", "94894035b9cc433c86d5687da1a65806", "a668ab36c91f4d36a47a54e45ba3cc79", "3c665998e79d4ec9b19b4c5f47e0301d" ] }, "id": "XDMeyj8sH9Tz", "outputId": "e2d3a3dd-8d44-4c98-e230-5316a811a121" }, "execution_count": 24, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ "No model was supplied, defaulted to distilbert/distilbert-base-uncased-finetuned-sst-2-english and revision af0f99b (https://huggingface.co/distilbert/distilbert-base-uncased-finetuned-sst-2-english).\n", "Using a pipeline without specifying a model name and revision in production is not recommended.\n", "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.\n", " warnings.warn(\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "config.json: 0%| | 0.00/629 [00:00, secondary_hue: 'colors.Color | str' = , neutral_hue: 'colors.Color | str' = , text_size: 'sizes.Size | str' = , spacing_size: 'sizes.Size | str' = , radius_size: 'sizes.Size | str' = , font: 'fonts.Font | str | Iterable[fonts.Font | str]' = (, 'ui-sans-serif', 'system-ui', 'sans-serif'), font_mono: 'fonts.Font | str | Iterable[fonts.Font | str]' = (, 'ui-monospace', 'Consolas', 'monospace'))\n", " | \n", " | Method resolution order:\n", " | Base\n", " | ThemeClass\n", " | builtins.object\n", " | \n", " | Methods defined here:\n", " | \n", " | __init__(self, *, primary_hue: 'colors.Color | str' = , secondary_hue: 'colors.Color | str' = , neutral_hue: 'colors.Color | str' = , text_size: 'sizes.Size | str' = , spacing_size: 'sizes.Size | str' = , radius_size: 'sizes.Size | str' = , font: 'fonts.Font | str | Iterable[fonts.Font | str]' = (, 'ui-sans-serif', 'system-ui', 'sans-serif'), font_mono: 'fonts.Font | str | Iterable[fonts.Font | str]' = (, 'ui-monospace', 'Consolas', 'monospace'))\n", " | Parameters:\n", " | primary_hue: The primary hue of the theme. Load a preset, like gradio.themes.colors.green (or just the string \"green\"), or pass your own gradio.themes.utils.Color object.\n", " | secondary_hue: The secondary hue of the theme. Load a preset, like gradio.themes.colors.green (or just the string \"green\"), or pass your own gradio.themes.utils.Color object.\n", " | neutral_hue: The neutral hue of the theme, used . Load a preset, like gradio.themes.colors.green (or just the string \"green\"), or pass your own gradio.themes.utils.Color object.\n", " | text_size: The size of the text. Load a preset, like gradio.themes.sizes.text_sm (or just the string \"sm\"), or pass your own gradio.themes.utils.Size object.\n", " | spacing_size: The size of the spacing. Load a preset, like gradio.themes.sizes.spacing_sm (or just the string \"sm\"), or pass your own gradio.themes.utils.Size object.\n", " | radius_size: The radius size of corners. Load a preset, like gradio.themes.sizes.radius_sm (or just the string \"sm\"), or pass your own gradio.themes.utils.Size object.\n", " | font: The primary font to use for the theme. Pass a string for a system font, or a gradio.themes.font.GoogleFont object to load a font from Google Fonts. Pass a list of fonts for fallbacks.\n", " | font_mono: The monospace font to use for the theme, applies to code. Pass a string for a system font, or a gradio.themes.font.GoogleFont object to load a font from Google Fonts. Pass a list of fonts for fallbacks.\n", " | \n", " | set(self, *, body_background_fill=None, body_background_fill_dark=None, body_text_color=None, body_text_color_dark=None, body_text_size=None, body_text_color_subdued=None, body_text_color_subdued_dark=None, body_text_weight=None, embed_radius=None, background_fill_primary=None, background_fill_primary_dark=None, background_fill_secondary=None, background_fill_secondary_dark=None, border_color_accent=None, border_color_accent_dark=None, border_color_accent_subdued=None, border_color_accent_subdued_dark=None, border_color_primary=None, border_color_primary_dark=None, color_accent=None, color_accent_soft=None, color_accent_soft_dark=None, link_text_color=None, link_text_color_dark=None, link_text_color_active=None, link_text_color_active_dark=None, link_text_color_hover=None, link_text_color_hover_dark=None, link_text_color_visited=None, link_text_color_visited_dark=None, prose_text_size=None, prose_text_weight=None, prose_header_text_weight=None, code_background_fill=None, code_background_fill_dark=None, shadow_drop=None, shadow_drop_lg=None, shadow_inset=None, shadow_spread=None, shadow_spread_dark=None, block_background_fill=None, block_background_fill_dark=None, block_border_color=None, block_border_color_dark=None, block_border_width=None, block_border_width_dark=None, block_info_text_color=None, block_info_text_color_dark=None, block_info_text_size=None, block_info_text_weight=None, block_label_background_fill=None, block_label_background_fill_dark=None, block_label_border_color=None, block_label_border_color_dark=None, block_label_border_width=None, block_label_border_width_dark=None, block_label_shadow=None, block_label_text_color=None, block_label_text_color_dark=None, block_label_margin=None, block_label_padding=None, block_label_radius=None, block_label_right_radius=None, block_label_text_size=None, block_label_text_weight=None, block_padding=None, block_radius=None, block_shadow=None, block_shadow_dark=None, block_title_background_fill=None, block_title_background_fill_dark=None, block_title_border_color=None, block_title_border_color_dark=None, block_title_border_width=None, block_title_border_width_dark=None, block_title_text_color=None, block_title_text_color_dark=None, block_title_padding=None, block_title_radius=None, block_title_text_size=None, block_title_text_weight=None, container_radius=None, form_gap_width=None, layout_gap=None, panel_background_fill=None, panel_background_fill_dark=None, panel_border_color=None, panel_border_color_dark=None, panel_border_width=None, panel_border_width_dark=None, section_header_text_size=None, section_header_text_weight=None, accordion_text_color=None, accordion_text_color_dark=None, table_text_color=None, table_text_color_dark=None, checkbox_background_color=None, checkbox_background_color_dark=None, checkbox_background_color_focus=None, checkbox_background_color_focus_dark=None, checkbox_background_color_hover=None, checkbox_background_color_hover_dark=None, checkbox_background_color_selected=None, checkbox_background_color_selected_dark=None, checkbox_border_color=None, checkbox_border_color_dark=None, checkbox_border_color_focus=None, checkbox_border_color_focus_dark=None, checkbox_border_color_hover=None, checkbox_border_color_hover_dark=None, checkbox_border_color_selected=None, checkbox_border_color_selected_dark=None, checkbox_border_radius=None, checkbox_border_width=None, checkbox_border_width_dark=None, checkbox_check=None, radio_circle=None, checkbox_shadow=None, checkbox_label_background_fill=None, checkbox_label_background_fill_dark=None, checkbox_label_background_fill_hover=None, checkbox_label_background_fill_hover_dark=None, checkbox_label_background_fill_selected=None, checkbox_label_background_fill_selected_dark=None, checkbox_label_border_color=None, checkbox_label_border_color_dark=None, checkbox_label_border_color_hover=None, checkbox_label_border_color_hover_dark=None, checkbox_label_border_width=None, checkbox_label_border_width_dark=None, checkbox_label_gap=None, checkbox_label_padding=None, checkbox_label_shadow=None, checkbox_label_text_size=None, checkbox_label_text_weight=None, checkbox_label_text_color=None, checkbox_label_text_color_dark=None, checkbox_label_text_color_selected=None, checkbox_label_text_color_selected_dark=None, error_background_fill=None, error_background_fill_dark=None, error_border_color=None, error_border_color_dark=None, error_border_width=None, error_border_width_dark=None, error_text_color=None, error_text_color_dark=None, error_icon_color=None, error_icon_color_dark=None, input_background_fill=None, input_background_fill_dark=None, input_background_fill_focus=None, input_background_fill_focus_dark=None, input_background_fill_hover=None, input_background_fill_hover_dark=None, input_border_color=None, input_border_color_dark=None, input_border_color_focus=None, input_border_color_focus_dark=None, input_border_color_hover=None, input_border_color_hover_dark=None, input_border_width=None, input_border_width_dark=None, input_padding=None, input_placeholder_color=None, input_placeholder_color_dark=None, input_radius=None, input_shadow=None, input_shadow_dark=None, input_shadow_focus=None, input_shadow_focus_dark=None, input_text_size=None, input_text_weight=None, loader_color=None, loader_color_dark=None, slider_color=None, slider_color_dark=None, stat_background_fill=None, stat_background_fill_dark=None, table_border_color=None, table_border_color_dark=None, table_even_background_fill=None, table_even_background_fill_dark=None, table_odd_background_fill=None, table_odd_background_fill_dark=None, table_radius=None, table_row_focus=None, table_row_focus_dark=None, button_border_width=None, button_border_width_dark=None, button_shadow=None, button_shadow_active=None, button_shadow_hover=None, button_transition=None, button_large_padding=None, button_large_radius=None, button_large_text_size=None, button_large_text_weight=None, button_small_padding=None, button_small_radius=None, button_small_text_size=None, button_small_text_weight=None, button_primary_background_fill=None, button_primary_background_fill_dark=None, button_primary_background_fill_hover=None, button_primary_background_fill_hover_dark=None, button_primary_border_color=None, button_primary_border_color_dark=None, button_primary_border_color_hover=None, button_primary_border_color_hover_dark=None, button_primary_text_color=None, button_primary_text_color_dark=None, button_primary_text_color_hover=None, button_primary_text_color_hover_dark=None, button_secondary_background_fill=None, button_secondary_background_fill_dark=None, button_secondary_background_fill_hover=None, button_secondary_background_fill_hover_dark=None, button_secondary_border_color=None, button_secondary_border_color_dark=None, button_secondary_border_color_hover=None, button_secondary_border_color_hover_dark=None, button_secondary_text_color=None, button_secondary_text_color_dark=None, button_secondary_text_color_hover=None, button_secondary_text_color_hover_dark=None, button_cancel_background_fill=None, button_cancel_background_fill_dark=None, button_cancel_background_fill_hover=None, button_cancel_background_fill_hover_dark=None, button_cancel_border_color=None, button_cancel_border_color_dark=None, button_cancel_border_color_hover=None, button_cancel_border_color_hover_dark=None, button_cancel_text_color=None, button_cancel_text_color_dark=None, button_cancel_text_color_hover=None, button_cancel_text_color_hover_dark=None) -> 'Base'\n", " | Parameters:\n", " | body_background_fill: The background of the entire app.\n", " | body_background_fill_dark: The background of the entire app in dark mode.\n", " | body_text_color: The default text color.\n", " | body_text_color_dark: The default text color in dark mode.\n", " | body_text_size: The default text size.\n", " | body_text_color_subdued: The text color used for softer, less important text.\n", " | body_text_color_subdued_dark: The text color used for softer, less important text in dark mode.\n", " | body_text_weight: The default text weight.\n", " | embed_radius: The corner radius used for embedding when the app is embedded within a page.\n", " | background_fill_primary: The background primarily used for items placed directly on the page.\n", " | background_fill_primary_dark: The background primarily used for items placed directly on the page in dark mode.\n", " | background_fill_secondary: The background primarily used for items placed on top of another item.\n", " | background_fill_secondary_dark: The background primarily used for items placed on top of another item in dark mode.\n", " | border_color_accent: The border color used for accented items.\n", " | border_color_accent_dark: The border color used for accented items in dark mode.\n", " | border_color_accent_subdued: The subdued border color for accented items.\n", " | border_color_accent_subdued_dark: The subdued border color for accented items in dark mode.\n", " | border_color_primary: The border color primarily used for items placed directly on the page.\n", " | border_color_primary_dark: The border color primarily used for items placed directly on the page in dark mode.\n", " | color_accent: The color used for accented items.\n", " | color_accent_soft: The softer color used for accented items.\n", " | color_accent_soft_dark: The softer color used for accented items in dark mode.\n", " | link_text_color: The text color used for links.\n", " | link_text_color_dark: The text color used for links in dark mode.\n", " | link_text_color_active: The text color used for links when they are active.\n", " | link_text_color_active_dark: The text color used for links when they are active in dark mode.\n", " | link_text_color_hover: The text color used for links when they are hovered over.\n", " | link_text_color_hover_dark: The text color used for links when they are hovered over in dark mode.\n", " | link_text_color_visited: The text color used for links when they have been visited.\n", " | link_text_color_visited_dark: The text color used for links when they have been visited in dark mode.\n", " | prose_text_size: The text size used for markdown and other prose.\n", " | prose_text_weight: The text weight used for markdown and other prose.\n", " | prose_header_text_weight: The text weight of a header used for markdown and other prose.\n", " | code_background_fill: The background color of code blocks.\n", " | code_background_fill_dark: The background color of code blocks in dark mode.\n", " | shadow_drop: Drop shadow used by other shadowed items.\n", " | shadow_drop_lg: Larger drop shadow used by other shadowed items.\n", " | shadow_inset: Inset shadow used by other shadowed items.\n", " | shadow_spread: Size of shadow spread used by shadowed items.\n", " | shadow_spread_dark: Size of shadow spread used by shadowed items in dark mode.\n", " | block_background_fill: The background around an item.\n", " | block_background_fill_dark: The background around an item in dark mode.\n", " | block_border_color: The border color around an item.\n", " | block_border_color_dark: The border color around an item in dark mode.\n", " | block_border_width: The border width around an item.\n", " | block_border_width_dark: The border width around an item in dark mode.\n", " | block_info_text_color: The color of the info text.\n", " | block_info_text_color_dark: The color of the info text in dark mode.\n", " | block_info_text_size: The size of the info text.\n", " | block_info_text_weight: The weight of the info text.\n", " | block_label_background_fill: The background of the title label of a media element (e.g. image).\n", " | block_label_background_fill_dark: The background of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_border_color: The border color of the title label of a media element (e.g. image).\n", " | block_label_border_color_dark: The border color of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_border_width: The border width of the title label of a media element (e.g. image).\n", " | block_label_border_width_dark: The border width of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_shadow: The shadow of the title label of a media element (e.g. image).\n", " | block_label_text_color: The text color of the title label of a media element (e.g. image).\n", " | block_label_text_color_dark: The text color of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_margin: The margin of the title label of a media element (e.g. image) from its surrounding container.\n", " | block_label_padding: The padding of the title label of a media element (e.g. image).\n", " | block_label_radius: The corner radius of the title label of a media element (e.g. image).\n", " | block_label_right_radius: The corner radius of a right-aligned helper label.\n", " | block_label_text_size: The text size of the title label of a media element (e.g. image).\n", " | block_label_text_weight: The text weight of the title label of a media element (e.g. image).\n", " | block_padding: The padding around an item.\n", " | block_radius: The corner radius around an item.\n", " | block_shadow: The shadow under an item.\n", " | block_shadow_dark: The shadow under an item in dark mode.\n", " | block_title_background_fill: The background of the title of a form element (e.g. textbox).\n", " | block_title_background_fill_dark: The background of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_border_color: The border color of the title of a form element (e.g. textbox).\n", " | block_title_border_color_dark: The border color of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_border_width: The border width of the title of a form element (e.g. textbox).\n", " | block_title_border_width_dark: The border width of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_text_color: The text color of the title of a form element (e.g. textbox).\n", " | block_title_text_color_dark: The text color of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_padding: The padding of the title of a form element (e.g. textbox).\n", " | block_title_radius: The corner radius of the title of a form element (e.g. textbox).\n", " | block_title_text_size: The text size of the title of a form element (e.g. textbox).\n", " | block_title_text_weight: The text weight of the title of a form element (e.g. textbox).\n", " | container_radius: The corner radius of a layout component that holds other content.\n", " | form_gap_width: The border gap between form elements, (e.g. consecutive textboxes).\n", " | layout_gap: The gap between items within a row or column.\n", " | panel_background_fill: The background of a panel.\n", " | panel_background_fill_dark: The background of a panel in dark mode.\n", " | panel_border_color: The border color of a panel.\n", " | panel_border_color_dark: The border color of a panel in dark mode.\n", " | panel_border_width: The border width of a panel.\n", " | panel_border_width_dark: The border width of a panel in dark mode.\n", " | accordion_text_color: The body text color in the accordion.\n", " | accordion_text_color_dark: The body text color in the accordion in dark mode.\n", " | table_text_color: The body text color in the table.\n", " | table_text_color_dark: The body text color in the table in dark mode.\n", " | section_header_text_size: The text size of a section header (e.g. tab name).\n", " | section_header_text_weight: The text weight of a section header (e.g. tab name).\n", " | checkbox_background_color: The background of a checkbox square or radio circle.\n", " | checkbox_background_color_dark: The background of a checkbox square or radio circle in dark mode.\n", " | checkbox_background_color_focus: The background of a checkbox square or radio circle when focused.\n", " | checkbox_background_color_focus_dark: The background of a checkbox square or radio circle when focused in dark mode.\n", " | checkbox_background_color_hover: The background of a checkbox square or radio circle when hovered over.\n", " | checkbox_background_color_hover_dark: The background of a checkbox square or radio circle when hovered over in dark mode.\n", " | checkbox_background_color_selected: The background of a checkbox square or radio circle when selected.\n", " | checkbox_background_color_selected_dark: The background of a checkbox square or radio circle when selected in dark mode.\n", " | checkbox_border_color: The border color of a checkbox square or radio circle.\n", " | checkbox_border_color_dark: The border color of a checkbox square or radio circle in dark mode.\n", " | checkbox_border_color_focus: The border color of a checkbox square or radio circle when focused.\n", " | checkbox_border_color_focus_dark: The border color of a checkbox square or radio circle when focused in dark mode.\n", " | checkbox_border_color_hover: The border color of a checkbox square or radio circle when hovered over.\n", " | checkbox_border_color_hover_dark: The border color of a checkbox square or radio circle when hovered over in dark mode.\n", " | checkbox_border_color_selected: The border color of a checkbox square or radio circle when selected.\n", " | checkbox_border_color_selected_dark: The border color of a checkbox square or radio circle when selected in dark mode.\n", " | checkbox_border_radius: The corner radius of a checkbox square.\n", " | checkbox_border_width: The border width of a checkbox square or radio circle.\n", " | checkbox_border_width_dark: The border width of a checkbox square or radio circle in dark mode.\n", " | checkbox_check: The checkmark visual of a checkbox square.\n", " | radio_circle: The circle visual of a radio circle.\n", " | checkbox_shadow: The shadow of a checkbox square or radio circle.\n", " | checkbox_label_background_fill: The background of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_background_fill_dark: The background of the surrounding button of a checkbox or radio element in dark mode.\n", " | checkbox_label_background_fill_hover: The background of the surrounding button of a checkbox or radio element when hovered over.\n", " | checkbox_label_background_fill_hover_dark: The background of the surrounding button of a checkbox or radio element when hovered over in dark mode.\n", " | checkbox_label_background_fill_selected: The background of the surrounding button of a checkbox or radio element when selected.\n", " | checkbox_label_background_fill_selected_dark: The background of the surrounding button of a checkbox or radio element when selected in dark mode.\n", " | checkbox_label_border_color: The border color of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_border_color_dark: The border color of the surrounding button of a checkbox or radio element in dark mode.\n", " | checkbox_label_border_color_hover: The border color of the surrounding button of a checkbox or radio element when hovered over.\n", " | checkbox_label_border_color_hover_dark: The border color of the surrounding button of a checkbox or radio element when hovered over in dark mode.\n", " | checkbox_label_border_width: The border width of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_border_width_dark: The border width of the surrounding button of a checkbox or radio element in dark mode.\n", " | checkbox_label_gap: The gap consecutive checkbox or radio elements.\n", " | checkbox_label_padding: The padding of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_shadow: The shadow of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_text_size: The text size of the label accompanying a checkbox or radio element.\n", " | checkbox_label_text_weight: The text weight of the label accompanying a checkbox or radio element.\n", " | checkbox_label_text_color: The text color of the label accompanying a checkbox or radio element.\n", " | checkbox_label_text_color_dark: The text color of the label accompanying a checkbox or radio element in dark mode.\n", " | checkbox_label_text_color_selected: The text color of the label accompanying a checkbox or radio element when selected.\n", " | checkbox_label_text_color_selected_dark: The text color of the label accompanying a checkbox or radio element when selected in dark mode.\n", " | error_background_fill: The background of an error message.\n", " | error_background_fill_dark: The background of an error message in dark mode.\n", " | error_border_color: The border color of an error message.\n", " | error_border_color_dark: The border color of an error message in dark mode.\n", " | error_border_width: The border width of an error message.\n", " | error_border_width_dark: The border width of an error message in dark mode.\n", " | error_text_color: The text color of an error message.\n", " | error_text_color_dark: The text color of an error message in dark mode.\n", " | input_background_fill: The background of an input field.\n", " | input_background_fill_dark: The background of an input field in dark mode.\n", " | input_background_fill_focus: The background of an input field when focused.\n", " | input_background_fill_focus_dark: The background of an input field when focused in dark mode.\n", " | input_background_fill_hover: The background of an input field when hovered over.\n", " | input_background_fill_hover_dark: The background of an input field when hovered over in dark mode.\n", " | input_border_color: The border color of an input field.\n", " | input_border_color_dark: The border color of an input field in dark mode.\n", " | input_border_color_focus: The border color of an input field when focused.\n", " | input_border_color_focus_dark: The border color of an input field when focused in dark mode.\n", " | input_border_color_hover: The border color of an input field when hovered over.\n", " | input_border_color_hover_dark: The border color of an input field when hovered over in dark mode.\n", " | input_border_width: The border width of an input field.\n", " | input_border_width_dark: The border width of an input field in dark mode.\n", " | input_padding: The padding of an input field.\n", " | input_placeholder_color: The placeholder text color of an input field.\n", " | input_placeholder_color_dark: The placeholder text color of an input field in dark mode.\n", " | input_radius: The corner radius of an input field.\n", " | input_shadow: The shadow of an input field.\n", " | input_shadow_dark: The shadow of an input field in dark mode.\n", " | input_shadow_focus: The shadow of an input field when focused.\n", " | input_shadow_focus_dark: The shadow of an input field when focused in dark mode.\n", " | input_text_size: The text size of an input field.\n", " | input_text_weight: The text weight of an input field.\n", " | loader_color: The color of the loading animation while a request is pending.\n", " | loader_color_dark: The color of the loading animation while a request is pending in dark mode.\n", " | slider_color: The color of the slider in a range element.\n", " | slider_color_dark: The color of the slider in a range element in dark mode.\n", " | stat_background_fill: The background used for stats visuals (e.g. confidence bars in label).\n", " | stat_background_fill_dark: The background used for stats visuals (e.g. confidence bars in label) in dark mode.\n", " | table_border_color: The border color of a table.\n", " | table_border_color_dark: The border color of a table in dark mode.\n", " | table_even_background_fill: The background of even rows in a table.\n", " | table_even_background_fill_dark: The background of even rows in a table in dark mode.\n", " | table_odd_background_fill: The background of odd rows in a table.\n", " | table_odd_background_fill_dark: The background of odd rows in a table in dark mode.\n", " | table_radius: The corner radius of a table.\n", " | table_row_focus: The background of a focused row in a table.\n", " | table_row_focus_dark: The background of a focused row in a table in dark mode.\n", " | button_border_width: The border width of a button.\n", " | button_border_width_dark: The border width of a button in dark mode.\n", " | button_cancel_background_fill: The background of a button of \"cancel\" variant.\n", " | button_cancel_background_fill_dark: The background of a button of \"cancel\" variant in dark mode.\n", " | button_cancel_background_fill_hover: The background of a button of \"cancel\" variant when hovered over.\n", " | button_cancel_background_fill_hover_dark: The background of a button of \"cancel\" variant when hovered over in dark mode.\n", " | button_cancel_border_color: The border color of a button of \"cancel\" variant.\n", " | button_cancel_border_color_dark: The border color of a button of \"cancel\" variant in dark mode.\n", " | button_cancel_border_color_hover: The border color of a button of \"cancel\" variant when hovered over.\n", " | button_cancel_border_color_hover_dark: The border color of a button of \"cancel\" variant when hovered over in dark mode.\n", " | button_cancel_text_color: The text color of a button of \"cancel\" variant.\n", " | button_cancel_text_color_dark: The text color of a button of \"cancel\" variant in dark mode.\n", " | button_cancel_text_color_hover: The text color of a button of \"cancel\" variant when hovered over.\n", " | button_cancel_text_color_hover_dark: The text color of a button of \"cancel\" variant when hovered over in dark mode.\n", " | button_large_padding: The padding of a button with the default \"large\" size.\n", " | button_large_radius: The corner radius of a button with the default \"large\" size.\n", " | button_large_text_size: The text size of a button with the default \"large\" size.\n", " | button_large_text_weight: The text weight of a button with the default \"large\" size.\n", " | button_primary_background_fill: The background of a button of \"primary\" variant.\n", " | button_primary_background_fill_dark: The background of a button of \"primary\" variant in dark mode.\n", " | button_primary_background_fill_hover: The background of a button of \"primary\" variant when hovered over.\n", " | button_primary_background_fill_hover_dark: The background of a button of \"primary\" variant when hovered over in dark mode.\n", " | button_primary_border_color: The border color of a button of \"primary\" variant.\n", " | button_primary_border_color_dark: The border color of a button of \"primary\" variant in dark mode.\n", " | button_primary_border_color_hover: The border color of a button of \"primary\" variant when hovered over.\n", " | button_primary_border_color_hover_dark: The border color of a button of \"primary\" variant when hovered over in dark mode.\n", " | button_primary_text_color: The text color of a button of \"primary\" variant.\n", " | button_primary_text_color_dark: The text color of a button of \"primary\" variant in dark mode.\n", " | button_primary_text_color_hover: The text color of a button of \"primary\" variant when hovered over.\n", " | button_primary_text_color_hover_dark: The text color of a button of \"primary\" variant when hovered over in dark mode.\n", " | button_secondary_background_fill: The background of a button of default \"secondary\" variant.\n", " | button_secondary_background_fill_dark: The background of a button of default \"secondary\" variant in dark mode.\n", " | button_secondary_background_fill_hover: The background of a button of default \"secondary\" variant when hovered over.\n", " | button_secondary_background_fill_hover_dark: The background of a button of default \"secondary\" variant when hovered over in dark mode.\n", " | button_secondary_border_color: The border color of a button of default \"secondary\" variant.\n", " | button_secondary_border_color_dark: The border color of a button of default \"secondary\" variant in dark mode.\n", " | button_secondary_border_color_hover: The border color of a button of default \"secondary\" variant when hovered over.\n", " | button_secondary_border_color_hover_dark: The border color of a button of default \"secondary\" variant when hovered over in dark mode.\n", " | button_secondary_text_color: The text color of a button of default \"secondary\" variant.\n", " | button_secondary_text_color_dark: The text color of a button of default \"secondary\" variant in dark mode.\n", " | button_secondary_text_color_hover: The text color of a button of default \"secondary\" variant when hovered over.\n", " | button_secondary_text_color_hover_dark: The text color of a button of default \"secondary\" variant when hovered over in dark mode.\n", " | button_shadow: The shadow under a button.\n", " | button_shadow_active: The shadow under a button when pressed.\n", " | button_shadow_hover: The shadow under a button when hovered over.\n", " | button_small_padding: The padding of a button set to \"small\" size.\n", " | button_small_radius: The corner radius of a button set to \"small\" size.\n", " | button_small_text_size: The text size of a button set to \"small\" size.\n", " | button_small_text_weight: The text weight of a button set to \"small\" size.\n", " | button_transition: The transition animation duration of a button between regular, hover, and focused states.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Methods inherited from ThemeClass:\n", " | \n", " | dump(self, filename: 'str')\n", " | Write the theme to a json file.\n", " | \n", " | Parameters:\n", " | filename: The path to write the theme too\n", " | \n", " | push_to_hub(self, repo_name: 'str', org_name: 'str | None' = None, version: 'str | None' = None, hf_token: 'str | None' = None, theme_name: 'str | None' = None, description: 'str | None' = None, private: 'bool' = False)\n", " | Upload a theme to the HuggingFace hub.\n", " | \n", " | This requires a HuggingFace account.\n", " | \n", " | Parameters:\n", " | repo_name: The name of the repository to store the theme assets, e.g. 'my_theme' or 'sunset'.\n", " | org_name: The name of the org to save the space in. If None (the default), the username corresponding to the logged in user, or hƒ_token is used.\n", " | version: A semantic version tag for theme. Bumping the version tag lets you publish updates to a theme without changing the look of applications that already loaded your theme.\n", " | hf_token: API token for your HuggingFace account\n", " | theme_name: Name for the name. If None, defaults to repo_name\n", " | description: A long form description to your theme.\n", " | \n", " | to_dict(self)\n", " | Convert the theme into a python dictionary.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Class methods inherited from ThemeClass:\n", " | \n", " | from_dict(theme: 'dict[str, dict[str, str]]') -> 'ThemeClass' from builtins.type\n", " | Create a theme instance from a dictionary representation.\n", " | \n", " | Parameters:\n", " | theme: The dictionary representation of the theme.\n", " | \n", " | from_hub(repo_name: 'str', hf_token: 'str | None' = None) from builtins.type\n", " | Load a theme from the hub.\n", " | \n", " | This DOES NOT require a HuggingFace account for downloading publicly available themes.\n", " | \n", " | Parameters:\n", " | repo_name: string of the form /@. If a semantic version expression is omitted, the latest version will be fetched.\n", " | hf_token: HuggingFace Token. Only needed to download private themes.\n", " | \n", " | load(path: 'str') -> 'ThemeClass' from builtins.type\n", " | Load a theme from a json file.\n", " | \n", " | Parameters:\n", " | path: The filepath to read.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors inherited from ThemeClass:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", " \n", " class Color(builtins.object)\n", " | Color(c50: 'str', c100: 'str', c200: 'str', c300: 'str', c400: 'str', c500: 'str', c600: 'str', c700: 'str', c800: 'str', c900: 'str', c950: 'str', name: 'str | None' = None)\n", " | \n", " | Methods defined here:\n", " | \n", " | __init__(self, c50: 'str', c100: 'str', c200: 'str', c300: 'str', c400: 'str', c500: 'str', c600: 'str', c700: 'str', c800: 'str', c900: 'str', c950: 'str', name: 'str | None' = None)\n", " | Initialize self. See help(type(self)) for accurate signature.\n", " | \n", " | expand(self) -> 'list[str]'\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors defined here:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data and other attributes defined here:\n", " | \n", " | all = [, , secondary_hue: 'colors.Color | str' = , neutral_hue: 'colors.Color | str' = , spacing_size: 'sizes.Size | str' = , radius_size: 'sizes.Size | str' = , text_size: 'sizes.Size | str' = , font: 'fonts.Font | str | Iterable[fonts.Font | str]' = (, 'ui-sans-serif', 'system-ui', 'sans-serif'), font_mono: 'fonts.Font | str | Iterable[fonts.Font | str]' = (, 'ui-monospace', 'Consolas', 'monospace'))\n", " | \n", " | Method resolution order:\n", " | Default\n", " | gradio.themes.base.Base\n", " | gradio.themes.base.ThemeClass\n", " | builtins.object\n", " | \n", " | Methods defined here:\n", " | \n", " | __init__(self, *, primary_hue: 'colors.Color | str' = , secondary_hue: 'colors.Color | str' = , neutral_hue: 'colors.Color | str' = , spacing_size: 'sizes.Size | str' = , radius_size: 'sizes.Size | str' = , text_size: 'sizes.Size | str' = , font: 'fonts.Font | str | Iterable[fonts.Font | str]' = (, 'ui-sans-serif', 'system-ui', 'sans-serif'), font_mono: 'fonts.Font | str | Iterable[fonts.Font | str]' = (, 'ui-monospace', 'Consolas', 'monospace'))\n", " | Parameters:\n", " | primary_hue: The primary hue of the theme. Load a preset, like gradio.themes.colors.green (or just the string \"green\"), or pass your own gradio.themes.utils.Color object.\n", " | secondary_hue: The secondary hue of the theme. Load a preset, like gradio.themes.colors.green (or just the string \"green\"), or pass your own gradio.themes.utils.Color object.\n", " | neutral_hue: The neutral hue of the theme, used . Load a preset, like gradio.themes.colors.green (or just the string \"green\"), or pass your own gradio.themes.utils.Color object.\n", " | text_size: The size of the text. Load a preset, like gradio.themes.sizes.text_sm (or just the string \"sm\"), or pass your own gradio.themes.utils.Size object.\n", " | spacing_size: The size of the spacing. Load a preset, like gradio.themes.sizes.spacing_sm (or just the string \"sm\"), or pass your own gradio.themes.utils.Size object.\n", " | radius_size: The radius size of corners. Load a preset, like gradio.themes.sizes.radius_sm (or just the string \"sm\"), or pass your own gradio.themes.utils.Size object.\n", " | font: The primary font to use for the theme. Pass a string for a system font, or a gradio.themes.font.GoogleFont object to load a font from Google Fonts. Pass a list of fonts for fallbacks.\n", " | font_mono: The monospace font to use for the theme, applies to code. Pass a string for a system font, or a gradio.themes.font.GoogleFont object to load a font from Google Fonts. Pass a list of fonts for fallbacks.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Methods inherited from gradio.themes.base.Base:\n", " | \n", " | set(self, *, body_background_fill=None, body_background_fill_dark=None, body_text_color=None, body_text_color_dark=None, body_text_size=None, body_text_color_subdued=None, body_text_color_subdued_dark=None, body_text_weight=None, embed_radius=None, background_fill_primary=None, background_fill_primary_dark=None, background_fill_secondary=None, background_fill_secondary_dark=None, border_color_accent=None, border_color_accent_dark=None, border_color_accent_subdued=None, border_color_accent_subdued_dark=None, border_color_primary=None, border_color_primary_dark=None, color_accent=None, color_accent_soft=None, color_accent_soft_dark=None, link_text_color=None, link_text_color_dark=None, link_text_color_active=None, link_text_color_active_dark=None, link_text_color_hover=None, link_text_color_hover_dark=None, link_text_color_visited=None, link_text_color_visited_dark=None, prose_text_size=None, prose_text_weight=None, prose_header_text_weight=None, code_background_fill=None, code_background_fill_dark=None, shadow_drop=None, shadow_drop_lg=None, shadow_inset=None, shadow_spread=None, shadow_spread_dark=None, block_background_fill=None, block_background_fill_dark=None, block_border_color=None, block_border_color_dark=None, block_border_width=None, block_border_width_dark=None, block_info_text_color=None, block_info_text_color_dark=None, block_info_text_size=None, block_info_text_weight=None, block_label_background_fill=None, block_label_background_fill_dark=None, block_label_border_color=None, block_label_border_color_dark=None, block_label_border_width=None, block_label_border_width_dark=None, block_label_shadow=None, block_label_text_color=None, block_label_text_color_dark=None, block_label_margin=None, block_label_padding=None, block_label_radius=None, block_label_right_radius=None, block_label_text_size=None, block_label_text_weight=None, block_padding=None, block_radius=None, block_shadow=None, block_shadow_dark=None, block_title_background_fill=None, block_title_background_fill_dark=None, block_title_border_color=None, block_title_border_color_dark=None, block_title_border_width=None, block_title_border_width_dark=None, block_title_text_color=None, block_title_text_color_dark=None, block_title_padding=None, block_title_radius=None, block_title_text_size=None, block_title_text_weight=None, container_radius=None, form_gap_width=None, layout_gap=None, panel_background_fill=None, panel_background_fill_dark=None, panel_border_color=None, panel_border_color_dark=None, panel_border_width=None, panel_border_width_dark=None, section_header_text_size=None, section_header_text_weight=None, accordion_text_color=None, accordion_text_color_dark=None, table_text_color=None, table_text_color_dark=None, checkbox_background_color=None, checkbox_background_color_dark=None, checkbox_background_color_focus=None, checkbox_background_color_focus_dark=None, checkbox_background_color_hover=None, checkbox_background_color_hover_dark=None, checkbox_background_color_selected=None, checkbox_background_color_selected_dark=None, checkbox_border_color=None, checkbox_border_color_dark=None, checkbox_border_color_focus=None, checkbox_border_color_focus_dark=None, checkbox_border_color_hover=None, checkbox_border_color_hover_dark=None, checkbox_border_color_selected=None, checkbox_border_color_selected_dark=None, checkbox_border_radius=None, checkbox_border_width=None, checkbox_border_width_dark=None, checkbox_check=None, radio_circle=None, checkbox_shadow=None, checkbox_label_background_fill=None, checkbox_label_background_fill_dark=None, checkbox_label_background_fill_hover=None, checkbox_label_background_fill_hover_dark=None, checkbox_label_background_fill_selected=None, checkbox_label_background_fill_selected_dark=None, checkbox_label_border_color=None, checkbox_label_border_color_dark=None, checkbox_label_border_color_hover=None, checkbox_label_border_color_hover_dark=None, checkbox_label_border_width=None, checkbox_label_border_width_dark=None, checkbox_label_gap=None, checkbox_label_padding=None, checkbox_label_shadow=None, checkbox_label_text_size=None, checkbox_label_text_weight=None, checkbox_label_text_color=None, checkbox_label_text_color_dark=None, checkbox_label_text_color_selected=None, checkbox_label_text_color_selected_dark=None, error_background_fill=None, error_background_fill_dark=None, error_border_color=None, error_border_color_dark=None, error_border_width=None, error_border_width_dark=None, error_text_color=None, error_text_color_dark=None, error_icon_color=None, error_icon_color_dark=None, input_background_fill=None, input_background_fill_dark=None, input_background_fill_focus=None, input_background_fill_focus_dark=None, input_background_fill_hover=None, input_background_fill_hover_dark=None, input_border_color=None, input_border_color_dark=None, input_border_color_focus=None, input_border_color_focus_dark=None, input_border_color_hover=None, input_border_color_hover_dark=None, input_border_width=None, input_border_width_dark=None, input_padding=None, input_placeholder_color=None, input_placeholder_color_dark=None, input_radius=None, input_shadow=None, input_shadow_dark=None, input_shadow_focus=None, input_shadow_focus_dark=None, input_text_size=None, input_text_weight=None, loader_color=None, loader_color_dark=None, slider_color=None, slider_color_dark=None, stat_background_fill=None, stat_background_fill_dark=None, table_border_color=None, table_border_color_dark=None, table_even_background_fill=None, table_even_background_fill_dark=None, table_odd_background_fill=None, table_odd_background_fill_dark=None, table_radius=None, table_row_focus=None, table_row_focus_dark=None, button_border_width=None, button_border_width_dark=None, button_shadow=None, button_shadow_active=None, button_shadow_hover=None, button_transition=None, button_large_padding=None, button_large_radius=None, button_large_text_size=None, button_large_text_weight=None, button_small_padding=None, button_small_radius=None, button_small_text_size=None, button_small_text_weight=None, button_primary_background_fill=None, button_primary_background_fill_dark=None, button_primary_background_fill_hover=None, button_primary_background_fill_hover_dark=None, button_primary_border_color=None, button_primary_border_color_dark=None, button_primary_border_color_hover=None, button_primary_border_color_hover_dark=None, button_primary_text_color=None, button_primary_text_color_dark=None, button_primary_text_color_hover=None, button_primary_text_color_hover_dark=None, button_secondary_background_fill=None, button_secondary_background_fill_dark=None, button_secondary_background_fill_hover=None, button_secondary_background_fill_hover_dark=None, button_secondary_border_color=None, button_secondary_border_color_dark=None, button_secondary_border_color_hover=None, button_secondary_border_color_hover_dark=None, button_secondary_text_color=None, button_secondary_text_color_dark=None, button_secondary_text_color_hover=None, button_secondary_text_color_hover_dark=None, button_cancel_background_fill=None, button_cancel_background_fill_dark=None, button_cancel_background_fill_hover=None, button_cancel_background_fill_hover_dark=None, button_cancel_border_color=None, button_cancel_border_color_dark=None, button_cancel_border_color_hover=None, button_cancel_border_color_hover_dark=None, button_cancel_text_color=None, button_cancel_text_color_dark=None, button_cancel_text_color_hover=None, button_cancel_text_color_hover_dark=None) -> 'Base'\n", " | Parameters:\n", " | body_background_fill: The background of the entire app.\n", " | body_background_fill_dark: The background of the entire app in dark mode.\n", " | body_text_color: The default text color.\n", " | body_text_color_dark: The default text color in dark mode.\n", " | body_text_size: The default text size.\n", " | body_text_color_subdued: The text color used for softer, less important text.\n", " | body_text_color_subdued_dark: The text color used for softer, less important text in dark mode.\n", " | body_text_weight: The default text weight.\n", " | embed_radius: The corner radius used for embedding when the app is embedded within a page.\n", " | background_fill_primary: The background primarily used for items placed directly on the page.\n", " | background_fill_primary_dark: The background primarily used for items placed directly on the page in dark mode.\n", " | background_fill_secondary: The background primarily used for items placed on top of another item.\n", " | background_fill_secondary_dark: The background primarily used for items placed on top of another item in dark mode.\n", " | border_color_accent: The border color used for accented items.\n", " | border_color_accent_dark: The border color used for accented items in dark mode.\n", " | border_color_accent_subdued: The subdued border color for accented items.\n", " | border_color_accent_subdued_dark: The subdued border color for accented items in dark mode.\n", " | border_color_primary: The border color primarily used for items placed directly on the page.\n", " | border_color_primary_dark: The border color primarily used for items placed directly on the page in dark mode.\n", " | color_accent: The color used for accented items.\n", " | color_accent_soft: The softer color used for accented items.\n", " | color_accent_soft_dark: The softer color used for accented items in dark mode.\n", " | link_text_color: The text color used for links.\n", " | link_text_color_dark: The text color used for links in dark mode.\n", " | link_text_color_active: The text color used for links when they are active.\n", " | link_text_color_active_dark: The text color used for links when they are active in dark mode.\n", " | link_text_color_hover: The text color used for links when they are hovered over.\n", " | link_text_color_hover_dark: The text color used for links when they are hovered over in dark mode.\n", " | link_text_color_visited: The text color used for links when they have been visited.\n", " | link_text_color_visited_dark: The text color used for links when they have been visited in dark mode.\n", " | prose_text_size: The text size used for markdown and other prose.\n", " | prose_text_weight: The text weight used for markdown and other prose.\n", " | prose_header_text_weight: The text weight of a header used for markdown and other prose.\n", " | code_background_fill: The background color of code blocks.\n", " | code_background_fill_dark: The background color of code blocks in dark mode.\n", " | shadow_drop: Drop shadow used by other shadowed items.\n", " | shadow_drop_lg: Larger drop shadow used by other shadowed items.\n", " | shadow_inset: Inset shadow used by other shadowed items.\n", " | shadow_spread: Size of shadow spread used by shadowed items.\n", " | shadow_spread_dark: Size of shadow spread used by shadowed items in dark mode.\n", " | block_background_fill: The background around an item.\n", " | block_background_fill_dark: The background around an item in dark mode.\n", " | block_border_color: The border color around an item.\n", " | block_border_color_dark: The border color around an item in dark mode.\n", " | block_border_width: The border width around an item.\n", " | block_border_width_dark: The border width around an item in dark mode.\n", " | block_info_text_color: The color of the info text.\n", " | block_info_text_color_dark: The color of the info text in dark mode.\n", " | block_info_text_size: The size of the info text.\n", " | block_info_text_weight: The weight of the info text.\n", " | block_label_background_fill: The background of the title label of a media element (e.g. image).\n", " | block_label_background_fill_dark: The background of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_border_color: The border color of the title label of a media element (e.g. image).\n", " | block_label_border_color_dark: The border color of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_border_width: The border width of the title label of a media element (e.g. image).\n", " | block_label_border_width_dark: The border width of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_shadow: The shadow of the title label of a media element (e.g. image).\n", " | block_label_text_color: The text color of the title label of a media element (e.g. image).\n", " | block_label_text_color_dark: The text color of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_margin: The margin of the title label of a media element (e.g. image) from its surrounding container.\n", " | block_label_padding: The padding of the title label of a media element (e.g. image).\n", " | block_label_radius: The corner radius of the title label of a media element (e.g. image).\n", " | block_label_right_radius: The corner radius of a right-aligned helper label.\n", " | block_label_text_size: The text size of the title label of a media element (e.g. image).\n", " | block_label_text_weight: The text weight of the title label of a media element (e.g. image).\n", " | block_padding: The padding around an item.\n", " | block_radius: The corner radius around an item.\n", " | block_shadow: The shadow under an item.\n", " | block_shadow_dark: The shadow under an item in dark mode.\n", " | block_title_background_fill: The background of the title of a form element (e.g. textbox).\n", " | block_title_background_fill_dark: The background of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_border_color: The border color of the title of a form element (e.g. textbox).\n", " | block_title_border_color_dark: The border color of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_border_width: The border width of the title of a form element (e.g. textbox).\n", " | block_title_border_width_dark: The border width of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_text_color: The text color of the title of a form element (e.g. textbox).\n", " | block_title_text_color_dark: The text color of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_padding: The padding of the title of a form element (e.g. textbox).\n", " | block_title_radius: The corner radius of the title of a form element (e.g. textbox).\n", " | block_title_text_size: The text size of the title of a form element (e.g. textbox).\n", " | block_title_text_weight: The text weight of the title of a form element (e.g. textbox).\n", " | container_radius: The corner radius of a layout component that holds other content.\n", " | form_gap_width: The border gap between form elements, (e.g. consecutive textboxes).\n", " | layout_gap: The gap between items within a row or column.\n", " | panel_background_fill: The background of a panel.\n", " | panel_background_fill_dark: The background of a panel in dark mode.\n", " | panel_border_color: The border color of a panel.\n", " | panel_border_color_dark: The border color of a panel in dark mode.\n", " | panel_border_width: The border width of a panel.\n", " | panel_border_width_dark: The border width of a panel in dark mode.\n", " | accordion_text_color: The body text color in the accordion.\n", " | accordion_text_color_dark: The body text color in the accordion in dark mode.\n", " | table_text_color: The body text color in the table.\n", " | table_text_color_dark: The body text color in the table in dark mode.\n", " | section_header_text_size: The text size of a section header (e.g. tab name).\n", " | section_header_text_weight: The text weight of a section header (e.g. tab name).\n", " | checkbox_background_color: The background of a checkbox square or radio circle.\n", " | checkbox_background_color_dark: The background of a checkbox square or radio circle in dark mode.\n", " | checkbox_background_color_focus: The background of a checkbox square or radio circle when focused.\n", " | checkbox_background_color_focus_dark: The background of a checkbox square or radio circle when focused in dark mode.\n", " | checkbox_background_color_hover: The background of a checkbox square or radio circle when hovered over.\n", " | checkbox_background_color_hover_dark: The background of a checkbox square or radio circle when hovered over in dark mode.\n", " | checkbox_background_color_selected: The background of a checkbox square or radio circle when selected.\n", " | checkbox_background_color_selected_dark: The background of a checkbox square or radio circle when selected in dark mode.\n", " | checkbox_border_color: The border color of a checkbox square or radio circle.\n", " | checkbox_border_color_dark: The border color of a checkbox square or radio circle in dark mode.\n", " | checkbox_border_color_focus: The border color of a checkbox square or radio circle when focused.\n", " | checkbox_border_color_focus_dark: The border color of a checkbox square or radio circle when focused in dark mode.\n", " | checkbox_border_color_hover: The border color of a checkbox square or radio circle when hovered over.\n", " | checkbox_border_color_hover_dark: The border color of a checkbox square or radio circle when hovered over in dark mode.\n", " | checkbox_border_color_selected: The border color of a checkbox square or radio circle when selected.\n", " | checkbox_border_color_selected_dark: The border color of a checkbox square or radio circle when selected in dark mode.\n", " | checkbox_border_radius: The corner radius of a checkbox square.\n", " | checkbox_border_width: The border width of a checkbox square or radio circle.\n", " | checkbox_border_width_dark: The border width of a checkbox square or radio circle in dark mode.\n", " | checkbox_check: The checkmark visual of a checkbox square.\n", " | radio_circle: The circle visual of a radio circle.\n", " | checkbox_shadow: The shadow of a checkbox square or radio circle.\n", " | checkbox_label_background_fill: The background of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_background_fill_dark: The background of the surrounding button of a checkbox or radio element in dark mode.\n", " | checkbox_label_background_fill_hover: The background of the surrounding button of a checkbox or radio element when hovered over.\n", " | checkbox_label_background_fill_hover_dark: The background of the surrounding button of a checkbox or radio element when hovered over in dark mode.\n", " | checkbox_label_background_fill_selected: The background of the surrounding button of a checkbox or radio element when selected.\n", " | checkbox_label_background_fill_selected_dark: The background of the surrounding button of a checkbox or radio element when selected in dark mode.\n", " | checkbox_label_border_color: The border color of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_border_color_dark: The border color of the surrounding button of a checkbox or radio element in dark mode.\n", " | checkbox_label_border_color_hover: The border color of the surrounding button of a checkbox or radio element when hovered over.\n", " | checkbox_label_border_color_hover_dark: The border color of the surrounding button of a checkbox or radio element when hovered over in dark mode.\n", " | checkbox_label_border_width: The border width of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_border_width_dark: The border width of the surrounding button of a checkbox or radio element in dark mode.\n", " | checkbox_label_gap: The gap consecutive checkbox or radio elements.\n", " | checkbox_label_padding: The padding of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_shadow: The shadow of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_text_size: The text size of the label accompanying a checkbox or radio element.\n", " | checkbox_label_text_weight: The text weight of the label accompanying a checkbox or radio element.\n", " | checkbox_label_text_color: The text color of the label accompanying a checkbox or radio element.\n", " | checkbox_label_text_color_dark: The text color of the label accompanying a checkbox or radio element in dark mode.\n", " | checkbox_label_text_color_selected: The text color of the label accompanying a checkbox or radio element when selected.\n", " | checkbox_label_text_color_selected_dark: The text color of the label accompanying a checkbox or radio element when selected in dark mode.\n", " | error_background_fill: The background of an error message.\n", " | error_background_fill_dark: The background of an error message in dark mode.\n", " | error_border_color: The border color of an error message.\n", " | error_border_color_dark: The border color of an error message in dark mode.\n", " | error_border_width: The border width of an error message.\n", " | error_border_width_dark: The border width of an error message in dark mode.\n", " | error_text_color: The text color of an error message.\n", " | error_text_color_dark: The text color of an error message in dark mode.\n", " | input_background_fill: The background of an input field.\n", " | input_background_fill_dark: The background of an input field in dark mode.\n", " | input_background_fill_focus: The background of an input field when focused.\n", " | input_background_fill_focus_dark: The background of an input field when focused in dark mode.\n", " | input_background_fill_hover: The background of an input field when hovered over.\n", " | input_background_fill_hover_dark: The background of an input field when hovered over in dark mode.\n", " | input_border_color: The border color of an input field.\n", " | input_border_color_dark: The border color of an input field in dark mode.\n", " | input_border_color_focus: The border color of an input field when focused.\n", " | input_border_color_focus_dark: The border color of an input field when focused in dark mode.\n", " | input_border_color_hover: The border color of an input field when hovered over.\n", " | input_border_color_hover_dark: The border color of an input field when hovered over in dark mode.\n", " | input_border_width: The border width of an input field.\n", " | input_border_width_dark: The border width of an input field in dark mode.\n", " | input_padding: The padding of an input field.\n", " | input_placeholder_color: The placeholder text color of an input field.\n", " | input_placeholder_color_dark: The placeholder text color of an input field in dark mode.\n", " | input_radius: The corner radius of an input field.\n", " | input_shadow: The shadow of an input field.\n", " | input_shadow_dark: The shadow of an input field in dark mode.\n", " | input_shadow_focus: The shadow of an input field when focused.\n", " | input_shadow_focus_dark: The shadow of an input field when focused in dark mode.\n", " | input_text_size: The text size of an input field.\n", " | input_text_weight: The text weight of an input field.\n", " | loader_color: The color of the loading animation while a request is pending.\n", " | loader_color_dark: The color of the loading animation while a request is pending in dark mode.\n", " | slider_color: The color of the slider in a range element.\n", " | slider_color_dark: The color of the slider in a range element in dark mode.\n", " | stat_background_fill: The background used for stats visuals (e.g. confidence bars in label).\n", " | stat_background_fill_dark: The background used for stats visuals (e.g. confidence bars in label) in dark mode.\n", " | table_border_color: The border color of a table.\n", " | table_border_color_dark: The border color of a table in dark mode.\n", " | table_even_background_fill: The background of even rows in a table.\n", " | table_even_background_fill_dark: The background of even rows in a table in dark mode.\n", " | table_odd_background_fill: The background of odd rows in a table.\n", " | table_odd_background_fill_dark: The background of odd rows in a table in dark mode.\n", " | table_radius: The corner radius of a table.\n", " | table_row_focus: The background of a focused row in a table.\n", " | table_row_focus_dark: The background of a focused row in a table in dark mode.\n", " | button_border_width: The border width of a button.\n", " | button_border_width_dark: The border width of a button in dark mode.\n", " | button_cancel_background_fill: The background of a button of \"cancel\" variant.\n", " | button_cancel_background_fill_dark: The background of a button of \"cancel\" variant in dark mode.\n", " | button_cancel_background_fill_hover: The background of a button of \"cancel\" variant when hovered over.\n", " | button_cancel_background_fill_hover_dark: The background of a button of \"cancel\" variant when hovered over in dark mode.\n", " | button_cancel_border_color: The border color of a button of \"cancel\" variant.\n", " | button_cancel_border_color_dark: The border color of a button of \"cancel\" variant in dark mode.\n", " | button_cancel_border_color_hover: The border color of a button of \"cancel\" variant when hovered over.\n", " | button_cancel_border_color_hover_dark: The border color of a button of \"cancel\" variant when hovered over in dark mode.\n", " | button_cancel_text_color: The text color of a button of \"cancel\" variant.\n", " | button_cancel_text_color_dark: The text color of a button of \"cancel\" variant in dark mode.\n", " | button_cancel_text_color_hover: The text color of a button of \"cancel\" variant when hovered over.\n", " | button_cancel_text_color_hover_dark: The text color of a button of \"cancel\" variant when hovered over in dark mode.\n", " | button_large_padding: The padding of a button with the default \"large\" size.\n", " | button_large_radius: The corner radius of a button with the default \"large\" size.\n", " | button_large_text_size: The text size of a button with the default \"large\" size.\n", " | button_large_text_weight: The text weight of a button with the default \"large\" size.\n", " | button_primary_background_fill: The background of a button of \"primary\" variant.\n", " | button_primary_background_fill_dark: The background of a button of \"primary\" variant in dark mode.\n", " | button_primary_background_fill_hover: The background of a button of \"primary\" variant when hovered over.\n", " | button_primary_background_fill_hover_dark: The background of a button of \"primary\" variant when hovered over in dark mode.\n", " | button_primary_border_color: The border color of a button of \"primary\" variant.\n", " | button_primary_border_color_dark: The border color of a button of \"primary\" variant in dark mode.\n", " | button_primary_border_color_hover: The border color of a button of \"primary\" variant when hovered over.\n", " | button_primary_border_color_hover_dark: The border color of a button of \"primary\" variant when hovered over in dark mode.\n", " | button_primary_text_color: The text color of a button of \"primary\" variant.\n", " | button_primary_text_color_dark: The text color of a button of \"primary\" variant in dark mode.\n", " | button_primary_text_color_hover: The text color of a button of \"primary\" variant when hovered over.\n", " | button_primary_text_color_hover_dark: The text color of a button of \"primary\" variant when hovered over in dark mode.\n", " | button_secondary_background_fill: The background of a button of default \"secondary\" variant.\n", " | button_secondary_background_fill_dark: The background of a button of default \"secondary\" variant in dark mode.\n", " | button_secondary_background_fill_hover: The background of a button of default \"secondary\" variant when hovered over.\n", " | button_secondary_background_fill_hover_dark: The background of a button of default \"secondary\" variant when hovered over in dark mode.\n", " | button_secondary_border_color: The border color of a button of default \"secondary\" variant.\n", " | button_secondary_border_color_dark: The border color of a button of default \"secondary\" variant in dark mode.\n", " | button_secondary_border_color_hover: The border color of a button of default \"secondary\" variant when hovered over.\n", " | button_secondary_border_color_hover_dark: The border color of a button of default \"secondary\" variant when hovered over in dark mode.\n", " | button_secondary_text_color: The text color of a button of default \"secondary\" variant.\n", " | button_secondary_text_color_dark: The text color of a button of default \"secondary\" variant in dark mode.\n", " | button_secondary_text_color_hover: The text color of a button of default \"secondary\" variant when hovered over.\n", " | button_secondary_text_color_hover_dark: The text color of a button of default \"secondary\" variant when hovered over in dark mode.\n", " | button_shadow: The shadow under a button.\n", " | button_shadow_active: The shadow under a button when pressed.\n", " | button_shadow_hover: The shadow under a button when hovered over.\n", " | button_small_padding: The padding of a button set to \"small\" size.\n", " | button_small_radius: The corner radius of a button set to \"small\" size.\n", " | button_small_text_size: The text size of a button set to \"small\" size.\n", " | button_small_text_weight: The text weight of a button set to \"small\" size.\n", " | button_transition: The transition animation duration of a button between regular, hover, and focused states.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Methods inherited from gradio.themes.base.ThemeClass:\n", " | \n", " | dump(self, filename: 'str')\n", " | Write the theme to a json file.\n", " | \n", " | Parameters:\n", " | filename: The path to write the theme too\n", " | \n", " | push_to_hub(self, repo_name: 'str', org_name: 'str | None' = None, version: 'str | None' = None, hf_token: 'str | None' = None, theme_name: 'str | None' = None, description: 'str | None' = None, private: 'bool' = False)\n", " | Upload a theme to the HuggingFace hub.\n", " | \n", " | This requires a HuggingFace account.\n", " | \n", " | Parameters:\n", " | repo_name: The name of the repository to store the theme assets, e.g. 'my_theme' or 'sunset'.\n", " | org_name: The name of the org to save the space in. If None (the default), the username corresponding to the logged in user, or hƒ_token is used.\n", " | version: A semantic version tag for theme. Bumping the version tag lets you publish updates to a theme without changing the look of applications that already loaded your theme.\n", " | hf_token: API token for your HuggingFace account\n", " | theme_name: Name for the name. If None, defaults to repo_name\n", " | description: A long form description to your theme.\n", " | \n", " | to_dict(self)\n", " | Convert the theme into a python dictionary.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Class methods inherited from gradio.themes.base.ThemeClass:\n", " | \n", " | from_dict(theme: 'dict[str, dict[str, str]]') -> 'ThemeClass' from builtins.type\n", " | Create a theme instance from a dictionary representation.\n", " | \n", " | Parameters:\n", " | theme: The dictionary representation of the theme.\n", " | \n", " | from_hub(repo_name: 'str', hf_token: 'str | None' = None) from builtins.type\n", " | Load a theme from the hub.\n", " | \n", " | This DOES NOT require a HuggingFace account for downloading publicly available themes.\n", " | \n", " | Parameters:\n", " | repo_name: string of the form /@. If a semantic version expression is omitted, the latest version will be fetched.\n", " | hf_token: HuggingFace Token. Only needed to download private themes.\n", " | \n", " | load(path: 'str') -> 'ThemeClass' from builtins.type\n", " | Load a theme from a json file.\n", " | \n", " | Parameters:\n", " | path: The filepath to read.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors inherited from gradio.themes.base.ThemeClass:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", " \n", " class Font(builtins.object)\n", " | Font(name: 'str')\n", " | \n", " | Methods defined here:\n", " | \n", " | __eq__(self, other: 'Font') -> 'bool'\n", " | Return self==value.\n", " | \n", " | __init__(self, name: 'str')\n", " | Initialize self. See help(type(self)) for accurate signature.\n", " | \n", " | __repr__(self) -> 'str'\n", " | Return repr(self).\n", " | \n", " | __str__(self) -> 'str'\n", " | Return str(self).\n", " | \n", " | stylesheet(self) -> 'str'\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors defined here:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data and other attributes defined here:\n", " | \n", " | __hash__ = None\n", " \n", " class Glass(gradio.themes.base.Base)\n", " | Glass(*, primary_hue: 'colors.Color | str' = , secondary_hue: 'colors.Color | str' = , neutral_hue: 'colors.Color | str' = , spacing_size: 'sizes.Size | str' = , radius_size: 'sizes.Size | str' = , text_size: 'sizes.Size | str' = , font: 'fonts.Font | str | Iterable[fonts.Font | str]' = ('Optima', 'Candara', 'Noto Sans', 'source-sans-pro', 'sans-serif'), font_mono: 'fonts.Font | str | Iterable[fonts.Font | str]' = (, 'ui-monospace', 'Consolas', 'monospace'))\n", " | \n", " | Method resolution order:\n", " | Glass\n", " | gradio.themes.base.Base\n", " | gradio.themes.base.ThemeClass\n", " | builtins.object\n", " | \n", " | Methods defined here:\n", " | \n", " | __init__(self, *, primary_hue: 'colors.Color | str' = , secondary_hue: 'colors.Color | str' = , neutral_hue: 'colors.Color | str' = , spacing_size: 'sizes.Size | str' = , radius_size: 'sizes.Size | str' = , text_size: 'sizes.Size | str' = , font: 'fonts.Font | str | Iterable[fonts.Font | str]' = ('Optima', 'Candara', 'Noto Sans', 'source-sans-pro', 'sans-serif'), font_mono: 'fonts.Font | str | Iterable[fonts.Font | str]' = (, 'ui-monospace', 'Consolas', 'monospace'))\n", " | Parameters:\n", " | primary_hue: The primary hue of the theme. Load a preset, like gradio.themes.colors.green (or just the string \"green\"), or pass your own gradio.themes.utils.Color object.\n", " | secondary_hue: The secondary hue of the theme. Load a preset, like gradio.themes.colors.green (or just the string \"green\"), or pass your own gradio.themes.utils.Color object.\n", " | neutral_hue: The neutral hue of the theme, used . Load a preset, like gradio.themes.colors.green (or just the string \"green\"), or pass your own gradio.themes.utils.Color object.\n", " | text_size: The size of the text. Load a preset, like gradio.themes.sizes.text_sm (or just the string \"sm\"), or pass your own gradio.themes.utils.Size object.\n", " | spacing_size: The size of the spacing. Load a preset, like gradio.themes.sizes.spacing_sm (or just the string \"sm\"), or pass your own gradio.themes.utils.Size object.\n", " | radius_size: The radius size of corners. Load a preset, like gradio.themes.sizes.radius_sm (or just the string \"sm\"), or pass your own gradio.themes.utils.Size object.\n", " | font: The primary font to use for the theme. Pass a string for a system font, or a gradio.themes.font.GoogleFont object to load a font from Google Fonts. Pass a list of fonts for fallbacks.\n", " | font_mono: The monospace font to use for the theme, applies to code. Pass a string for a system font, or a gradio.themes.font.GoogleFont object to load a font from Google Fonts. Pass a list of fonts for fallbacks.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Methods inherited from gradio.themes.base.Base:\n", " | \n", " | set(self, *, body_background_fill=None, body_background_fill_dark=None, body_text_color=None, body_text_color_dark=None, body_text_size=None, body_text_color_subdued=None, body_text_color_subdued_dark=None, body_text_weight=None, embed_radius=None, background_fill_primary=None, background_fill_primary_dark=None, background_fill_secondary=None, background_fill_secondary_dark=None, border_color_accent=None, border_color_accent_dark=None, border_color_accent_subdued=None, border_color_accent_subdued_dark=None, border_color_primary=None, border_color_primary_dark=None, color_accent=None, color_accent_soft=None, color_accent_soft_dark=None, link_text_color=None, link_text_color_dark=None, link_text_color_active=None, link_text_color_active_dark=None, link_text_color_hover=None, link_text_color_hover_dark=None, link_text_color_visited=None, link_text_color_visited_dark=None, prose_text_size=None, prose_text_weight=None, prose_header_text_weight=None, code_background_fill=None, code_background_fill_dark=None, shadow_drop=None, shadow_drop_lg=None, shadow_inset=None, shadow_spread=None, shadow_spread_dark=None, block_background_fill=None, block_background_fill_dark=None, block_border_color=None, block_border_color_dark=None, block_border_width=None, block_border_width_dark=None, block_info_text_color=None, block_info_text_color_dark=None, block_info_text_size=None, block_info_text_weight=None, block_label_background_fill=None, block_label_background_fill_dark=None, block_label_border_color=None, block_label_border_color_dark=None, block_label_border_width=None, block_label_border_width_dark=None, block_label_shadow=None, block_label_text_color=None, block_label_text_color_dark=None, block_label_margin=None, block_label_padding=None, block_label_radius=None, block_label_right_radius=None, block_label_text_size=None, block_label_text_weight=None, block_padding=None, block_radius=None, block_shadow=None, block_shadow_dark=None, block_title_background_fill=None, block_title_background_fill_dark=None, block_title_border_color=None, block_title_border_color_dark=None, block_title_border_width=None, block_title_border_width_dark=None, block_title_text_color=None, block_title_text_color_dark=None, block_title_padding=None, block_title_radius=None, block_title_text_size=None, block_title_text_weight=None, container_radius=None, form_gap_width=None, layout_gap=None, panel_background_fill=None, panel_background_fill_dark=None, panel_border_color=None, panel_border_color_dark=None, panel_border_width=None, panel_border_width_dark=None, section_header_text_size=None, section_header_text_weight=None, accordion_text_color=None, accordion_text_color_dark=None, table_text_color=None, table_text_color_dark=None, checkbox_background_color=None, checkbox_background_color_dark=None, checkbox_background_color_focus=None, checkbox_background_color_focus_dark=None, checkbox_background_color_hover=None, checkbox_background_color_hover_dark=None, checkbox_background_color_selected=None, checkbox_background_color_selected_dark=None, checkbox_border_color=None, checkbox_border_color_dark=None, checkbox_border_color_focus=None, checkbox_border_color_focus_dark=None, checkbox_border_color_hover=None, checkbox_border_color_hover_dark=None, checkbox_border_color_selected=None, checkbox_border_color_selected_dark=None, checkbox_border_radius=None, checkbox_border_width=None, checkbox_border_width_dark=None, checkbox_check=None, radio_circle=None, checkbox_shadow=None, checkbox_label_background_fill=None, checkbox_label_background_fill_dark=None, checkbox_label_background_fill_hover=None, checkbox_label_background_fill_hover_dark=None, checkbox_label_background_fill_selected=None, checkbox_label_background_fill_selected_dark=None, checkbox_label_border_color=None, checkbox_label_border_color_dark=None, checkbox_label_border_color_hover=None, checkbox_label_border_color_hover_dark=None, checkbox_label_border_width=None, checkbox_label_border_width_dark=None, checkbox_label_gap=None, checkbox_label_padding=None, checkbox_label_shadow=None, checkbox_label_text_size=None, checkbox_label_text_weight=None, checkbox_label_text_color=None, checkbox_label_text_color_dark=None, checkbox_label_text_color_selected=None, checkbox_label_text_color_selected_dark=None, error_background_fill=None, error_background_fill_dark=None, error_border_color=None, error_border_color_dark=None, error_border_width=None, error_border_width_dark=None, error_text_color=None, error_text_color_dark=None, error_icon_color=None, error_icon_color_dark=None, input_background_fill=None, input_background_fill_dark=None, input_background_fill_focus=None, input_background_fill_focus_dark=None, input_background_fill_hover=None, input_background_fill_hover_dark=None, input_border_color=None, input_border_color_dark=None, input_border_color_focus=None, input_border_color_focus_dark=None, input_border_color_hover=None, input_border_color_hover_dark=None, input_border_width=None, input_border_width_dark=None, input_padding=None, input_placeholder_color=None, input_placeholder_color_dark=None, input_radius=None, input_shadow=None, input_shadow_dark=None, input_shadow_focus=None, input_shadow_focus_dark=None, input_text_size=None, input_text_weight=None, loader_color=None, loader_color_dark=None, slider_color=None, slider_color_dark=None, stat_background_fill=None, stat_background_fill_dark=None, table_border_color=None, table_border_color_dark=None, table_even_background_fill=None, table_even_background_fill_dark=None, table_odd_background_fill=None, table_odd_background_fill_dark=None, table_radius=None, table_row_focus=None, table_row_focus_dark=None, button_border_width=None, button_border_width_dark=None, button_shadow=None, button_shadow_active=None, button_shadow_hover=None, button_transition=None, button_large_padding=None, button_large_radius=None, button_large_text_size=None, button_large_text_weight=None, button_small_padding=None, button_small_radius=None, button_small_text_size=None, button_small_text_weight=None, button_primary_background_fill=None, button_primary_background_fill_dark=None, button_primary_background_fill_hover=None, button_primary_background_fill_hover_dark=None, button_primary_border_color=None, button_primary_border_color_dark=None, button_primary_border_color_hover=None, button_primary_border_color_hover_dark=None, button_primary_text_color=None, button_primary_text_color_dark=None, button_primary_text_color_hover=None, button_primary_text_color_hover_dark=None, button_secondary_background_fill=None, button_secondary_background_fill_dark=None, button_secondary_background_fill_hover=None, button_secondary_background_fill_hover_dark=None, button_secondary_border_color=None, button_secondary_border_color_dark=None, button_secondary_border_color_hover=None, button_secondary_border_color_hover_dark=None, button_secondary_text_color=None, button_secondary_text_color_dark=None, button_secondary_text_color_hover=None, button_secondary_text_color_hover_dark=None, button_cancel_background_fill=None, button_cancel_background_fill_dark=None, button_cancel_background_fill_hover=None, button_cancel_background_fill_hover_dark=None, button_cancel_border_color=None, button_cancel_border_color_dark=None, button_cancel_border_color_hover=None, button_cancel_border_color_hover_dark=None, button_cancel_text_color=None, button_cancel_text_color_dark=None, button_cancel_text_color_hover=None, button_cancel_text_color_hover_dark=None) -> 'Base'\n", " | Parameters:\n", " | body_background_fill: The background of the entire app.\n", " | body_background_fill_dark: The background of the entire app in dark mode.\n", " | body_text_color: The default text color.\n", " | body_text_color_dark: The default text color in dark mode.\n", " | body_text_size: The default text size.\n", " | body_text_color_subdued: The text color used for softer, less important text.\n", " | body_text_color_subdued_dark: The text color used for softer, less important text in dark mode.\n", " | body_text_weight: The default text weight.\n", " | embed_radius: The corner radius used for embedding when the app is embedded within a page.\n", " | background_fill_primary: The background primarily used for items placed directly on the page.\n", " | background_fill_primary_dark: The background primarily used for items placed directly on the page in dark mode.\n", " | background_fill_secondary: The background primarily used for items placed on top of another item.\n", " | background_fill_secondary_dark: The background primarily used for items placed on top of another item in dark mode.\n", " | border_color_accent: The border color used for accented items.\n", " | border_color_accent_dark: The border color used for accented items in dark mode.\n", " | border_color_accent_subdued: The subdued border color for accented items.\n", " | border_color_accent_subdued_dark: The subdued border color for accented items in dark mode.\n", " | border_color_primary: The border color primarily used for items placed directly on the page.\n", " | border_color_primary_dark: The border color primarily used for items placed directly on the page in dark mode.\n", " | color_accent: The color used for accented items.\n", " | color_accent_soft: The softer color used for accented items.\n", " | color_accent_soft_dark: The softer color used for accented items in dark mode.\n", " | link_text_color: The text color used for links.\n", " | link_text_color_dark: The text color used for links in dark mode.\n", " | link_text_color_active: The text color used for links when they are active.\n", " | link_text_color_active_dark: The text color used for links when they are active in dark mode.\n", " | link_text_color_hover: The text color used for links when they are hovered over.\n", " | link_text_color_hover_dark: The text color used for links when they are hovered over in dark mode.\n", " | link_text_color_visited: The text color used for links when they have been visited.\n", " | link_text_color_visited_dark: The text color used for links when they have been visited in dark mode.\n", " | prose_text_size: The text size used for markdown and other prose.\n", " | prose_text_weight: The text weight used for markdown and other prose.\n", " | prose_header_text_weight: The text weight of a header used for markdown and other prose.\n", " | code_background_fill: The background color of code blocks.\n", " | code_background_fill_dark: The background color of code blocks in dark mode.\n", " | shadow_drop: Drop shadow used by other shadowed items.\n", " | shadow_drop_lg: Larger drop shadow used by other shadowed items.\n", " | shadow_inset: Inset shadow used by other shadowed items.\n", " | shadow_spread: Size of shadow spread used by shadowed items.\n", " | shadow_spread_dark: Size of shadow spread used by shadowed items in dark mode.\n", " | block_background_fill: The background around an item.\n", " | block_background_fill_dark: The background around an item in dark mode.\n", " | block_border_color: The border color around an item.\n", " | block_border_color_dark: The border color around an item in dark mode.\n", " | block_border_width: The border width around an item.\n", " | block_border_width_dark: The border width around an item in dark mode.\n", " | block_info_text_color: The color of the info text.\n", " | block_info_text_color_dark: The color of the info text in dark mode.\n", " | block_info_text_size: The size of the info text.\n", " | block_info_text_weight: The weight of the info text.\n", " | block_label_background_fill: The background of the title label of a media element (e.g. image).\n", " | block_label_background_fill_dark: The background of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_border_color: The border color of the title label of a media element (e.g. image).\n", " | block_label_border_color_dark: The border color of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_border_width: The border width of the title label of a media element (e.g. image).\n", " | block_label_border_width_dark: The border width of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_shadow: The shadow of the title label of a media element (e.g. image).\n", " | block_label_text_color: The text color of the title label of a media element (e.g. image).\n", " | block_label_text_color_dark: The text color of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_margin: The margin of the title label of a media element (e.g. image) from its surrounding container.\n", " | block_label_padding: The padding of the title label of a media element (e.g. image).\n", " | block_label_radius: The corner radius of the title label of a media element (e.g. image).\n", " | block_label_right_radius: The corner radius of a right-aligned helper label.\n", " | block_label_text_size: The text size of the title label of a media element (e.g. image).\n", " | block_label_text_weight: The text weight of the title label of a media element (e.g. image).\n", " | block_padding: The padding around an item.\n", " | block_radius: The corner radius around an item.\n", " | block_shadow: The shadow under an item.\n", " | block_shadow_dark: The shadow under an item in dark mode.\n", " | block_title_background_fill: The background of the title of a form element (e.g. textbox).\n", " | block_title_background_fill_dark: The background of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_border_color: The border color of the title of a form element (e.g. textbox).\n", " | block_title_border_color_dark: The border color of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_border_width: The border width of the title of a form element (e.g. textbox).\n", " | block_title_border_width_dark: The border width of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_text_color: The text color of the title of a form element (e.g. textbox).\n", " | block_title_text_color_dark: The text color of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_padding: The padding of the title of a form element (e.g. textbox).\n", " | block_title_radius: The corner radius of the title of a form element (e.g. textbox).\n", " | block_title_text_size: The text size of the title of a form element (e.g. textbox).\n", " | block_title_text_weight: The text weight of the title of a form element (e.g. textbox).\n", " | container_radius: The corner radius of a layout component that holds other content.\n", " | form_gap_width: The border gap between form elements, (e.g. consecutive textboxes).\n", " | layout_gap: The gap between items within a row or column.\n", " | panel_background_fill: The background of a panel.\n", " | panel_background_fill_dark: The background of a panel in dark mode.\n", " | panel_border_color: The border color of a panel.\n", " | panel_border_color_dark: The border color of a panel in dark mode.\n", " | panel_border_width: The border width of a panel.\n", " | panel_border_width_dark: The border width of a panel in dark mode.\n", " | accordion_text_color: The body text color in the accordion.\n", " | accordion_text_color_dark: The body text color in the accordion in dark mode.\n", " | table_text_color: The body text color in the table.\n", " | table_text_color_dark: The body text color in the table in dark mode.\n", " | section_header_text_size: The text size of a section header (e.g. tab name).\n", " | section_header_text_weight: The text weight of a section header (e.g. tab name).\n", " | checkbox_background_color: The background of a checkbox square or radio circle.\n", " | checkbox_background_color_dark: The background of a checkbox square or radio circle in dark mode.\n", " | checkbox_background_color_focus: The background of a checkbox square or radio circle when focused.\n", " | checkbox_background_color_focus_dark: The background of a checkbox square or radio circle when focused in dark mode.\n", " | checkbox_background_color_hover: The background of a checkbox square or radio circle when hovered over.\n", " | checkbox_background_color_hover_dark: The background of a checkbox square or radio circle when hovered over in dark mode.\n", " | checkbox_background_color_selected: The background of a checkbox square or radio circle when selected.\n", " | checkbox_background_color_selected_dark: The background of a checkbox square or radio circle when selected in dark mode.\n", " | checkbox_border_color: The border color of a checkbox square or radio circle.\n", " | checkbox_border_color_dark: The border color of a checkbox square or radio circle in dark mode.\n", " | checkbox_border_color_focus: The border color of a checkbox square or radio circle when focused.\n", " | checkbox_border_color_focus_dark: The border color of a checkbox square or radio circle when focused in dark mode.\n", " | checkbox_border_color_hover: The border color of a checkbox square or radio circle when hovered over.\n", " | checkbox_border_color_hover_dark: The border color of a checkbox square or radio circle when hovered over in dark mode.\n", " | checkbox_border_color_selected: The border color of a checkbox square or radio circle when selected.\n", " | checkbox_border_color_selected_dark: The border color of a checkbox square or radio circle when selected in dark mode.\n", " | checkbox_border_radius: The corner radius of a checkbox square.\n", " | checkbox_border_width: The border width of a checkbox square or radio circle.\n", " | checkbox_border_width_dark: The border width of a checkbox square or radio circle in dark mode.\n", " | checkbox_check: The checkmark visual of a checkbox square.\n", " | radio_circle: The circle visual of a radio circle.\n", " | checkbox_shadow: The shadow of a checkbox square or radio circle.\n", " | checkbox_label_background_fill: The background of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_background_fill_dark: The background of the surrounding button of a checkbox or radio element in dark mode.\n", " | checkbox_label_background_fill_hover: The background of the surrounding button of a checkbox or radio element when hovered over.\n", " | checkbox_label_background_fill_hover_dark: The background of the surrounding button of a checkbox or radio element when hovered over in dark mode.\n", " | checkbox_label_background_fill_selected: The background of the surrounding button of a checkbox or radio element when selected.\n", " | checkbox_label_background_fill_selected_dark: The background of the surrounding button of a checkbox or radio element when selected in dark mode.\n", " | checkbox_label_border_color: The border color of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_border_color_dark: The border color of the surrounding button of a checkbox or radio element in dark mode.\n", " | checkbox_label_border_color_hover: The border color of the surrounding button of a checkbox or radio element when hovered over.\n", " | checkbox_label_border_color_hover_dark: The border color of the surrounding button of a checkbox or radio element when hovered over in dark mode.\n", " | checkbox_label_border_width: The border width of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_border_width_dark: The border width of the surrounding button of a checkbox or radio element in dark mode.\n", " | checkbox_label_gap: The gap consecutive checkbox or radio elements.\n", " | checkbox_label_padding: The padding of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_shadow: The shadow of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_text_size: The text size of the label accompanying a checkbox or radio element.\n", " | checkbox_label_text_weight: The text weight of the label accompanying a checkbox or radio element.\n", " | checkbox_label_text_color: The text color of the label accompanying a checkbox or radio element.\n", " | checkbox_label_text_color_dark: The text color of the label accompanying a checkbox or radio element in dark mode.\n", " | checkbox_label_text_color_selected: The text color of the label accompanying a checkbox or radio element when selected.\n", " | checkbox_label_text_color_selected_dark: The text color of the label accompanying a checkbox or radio element when selected in dark mode.\n", " | error_background_fill: The background of an error message.\n", " | error_background_fill_dark: The background of an error message in dark mode.\n", " | error_border_color: The border color of an error message.\n", " | error_border_color_dark: The border color of an error message in dark mode.\n", " | error_border_width: The border width of an error message.\n", " | error_border_width_dark: The border width of an error message in dark mode.\n", " | error_text_color: The text color of an error message.\n", " | error_text_color_dark: The text color of an error message in dark mode.\n", " | input_background_fill: The background of an input field.\n", " | input_background_fill_dark: The background of an input field in dark mode.\n", " | input_background_fill_focus: The background of an input field when focused.\n", " | input_background_fill_focus_dark: The background of an input field when focused in dark mode.\n", " | input_background_fill_hover: The background of an input field when hovered over.\n", " | input_background_fill_hover_dark: The background of an input field when hovered over in dark mode.\n", " | input_border_color: The border color of an input field.\n", " | input_border_color_dark: The border color of an input field in dark mode.\n", " | input_border_color_focus: The border color of an input field when focused.\n", " | input_border_color_focus_dark: The border color of an input field when focused in dark mode.\n", " | input_border_color_hover: The border color of an input field when hovered over.\n", " | input_border_color_hover_dark: The border color of an input field when hovered over in dark mode.\n", " | input_border_width: The border width of an input field.\n", " | input_border_width_dark: The border width of an input field in dark mode.\n", " | input_padding: The padding of an input field.\n", " | input_placeholder_color: The placeholder text color of an input field.\n", " | input_placeholder_color_dark: The placeholder text color of an input field in dark mode.\n", " | input_radius: The corner radius of an input field.\n", " | input_shadow: The shadow of an input field.\n", " | input_shadow_dark: The shadow of an input field in dark mode.\n", " | input_shadow_focus: The shadow of an input field when focused.\n", " | input_shadow_focus_dark: The shadow of an input field when focused in dark mode.\n", " | input_text_size: The text size of an input field.\n", " | input_text_weight: The text weight of an input field.\n", " | loader_color: The color of the loading animation while a request is pending.\n", " | loader_color_dark: The color of the loading animation while a request is pending in dark mode.\n", " | slider_color: The color of the slider in a range element.\n", " | slider_color_dark: The color of the slider in a range element in dark mode.\n", " | stat_background_fill: The background used for stats visuals (e.g. confidence bars in label).\n", " | stat_background_fill_dark: The background used for stats visuals (e.g. confidence bars in label) in dark mode.\n", " | table_border_color: The border color of a table.\n", " | table_border_color_dark: The border color of a table in dark mode.\n", " | table_even_background_fill: The background of even rows in a table.\n", " | table_even_background_fill_dark: The background of even rows in a table in dark mode.\n", " | table_odd_background_fill: The background of odd rows in a table.\n", " | table_odd_background_fill_dark: The background of odd rows in a table in dark mode.\n", " | table_radius: The corner radius of a table.\n", " | table_row_focus: The background of a focused row in a table.\n", " | table_row_focus_dark: The background of a focused row in a table in dark mode.\n", " | button_border_width: The border width of a button.\n", " | button_border_width_dark: The border width of a button in dark mode.\n", " | button_cancel_background_fill: The background of a button of \"cancel\" variant.\n", " | button_cancel_background_fill_dark: The background of a button of \"cancel\" variant in dark mode.\n", " | button_cancel_background_fill_hover: The background of a button of \"cancel\" variant when hovered over.\n", " | button_cancel_background_fill_hover_dark: The background of a button of \"cancel\" variant when hovered over in dark mode.\n", " | button_cancel_border_color: The border color of a button of \"cancel\" variant.\n", " | button_cancel_border_color_dark: The border color of a button of \"cancel\" variant in dark mode.\n", " | button_cancel_border_color_hover: The border color of a button of \"cancel\" variant when hovered over.\n", " | button_cancel_border_color_hover_dark: The border color of a button of \"cancel\" variant when hovered over in dark mode.\n", " | button_cancel_text_color: The text color of a button of \"cancel\" variant.\n", " | button_cancel_text_color_dark: The text color of a button of \"cancel\" variant in dark mode.\n", " | button_cancel_text_color_hover: The text color of a button of \"cancel\" variant when hovered over.\n", " | button_cancel_text_color_hover_dark: The text color of a button of \"cancel\" variant when hovered over in dark mode.\n", " | button_large_padding: The padding of a button with the default \"large\" size.\n", " | button_large_radius: The corner radius of a button with the default \"large\" size.\n", " | button_large_text_size: The text size of a button with the default \"large\" size.\n", " | button_large_text_weight: The text weight of a button with the default \"large\" size.\n", " | button_primary_background_fill: The background of a button of \"primary\" variant.\n", " | button_primary_background_fill_dark: The background of a button of \"primary\" variant in dark mode.\n", " | button_primary_background_fill_hover: The background of a button of \"primary\" variant when hovered over.\n", " | button_primary_background_fill_hover_dark: The background of a button of \"primary\" variant when hovered over in dark mode.\n", " | button_primary_border_color: The border color of a button of \"primary\" variant.\n", " | button_primary_border_color_dark: The border color of a button of \"primary\" variant in dark mode.\n", " | button_primary_border_color_hover: The border color of a button of \"primary\" variant when hovered over.\n", " | button_primary_border_color_hover_dark: The border color of a button of \"primary\" variant when hovered over in dark mode.\n", " | button_primary_text_color: The text color of a button of \"primary\" variant.\n", " | button_primary_text_color_dark: The text color of a button of \"primary\" variant in dark mode.\n", " | button_primary_text_color_hover: The text color of a button of \"primary\" variant when hovered over.\n", " | button_primary_text_color_hover_dark: The text color of a button of \"primary\" variant when hovered over in dark mode.\n", " | button_secondary_background_fill: The background of a button of default \"secondary\" variant.\n", " | button_secondary_background_fill_dark: The background of a button of default \"secondary\" variant in dark mode.\n", " | button_secondary_background_fill_hover: The background of a button of default \"secondary\" variant when hovered over.\n", " | button_secondary_background_fill_hover_dark: The background of a button of default \"secondary\" variant when hovered over in dark mode.\n", " | button_secondary_border_color: The border color of a button of default \"secondary\" variant.\n", " | button_secondary_border_color_dark: The border color of a button of default \"secondary\" variant in dark mode.\n", " | button_secondary_border_color_hover: The border color of a button of default \"secondary\" variant when hovered over.\n", " | button_secondary_border_color_hover_dark: The border color of a button of default \"secondary\" variant when hovered over in dark mode.\n", " | button_secondary_text_color: The text color of a button of default \"secondary\" variant.\n", " | button_secondary_text_color_dark: The text color of a button of default \"secondary\" variant in dark mode.\n", " | button_secondary_text_color_hover: The text color of a button of default \"secondary\" variant when hovered over.\n", " | button_secondary_text_color_hover_dark: The text color of a button of default \"secondary\" variant when hovered over in dark mode.\n", " | button_shadow: The shadow under a button.\n", " | button_shadow_active: The shadow under a button when pressed.\n", " | button_shadow_hover: The shadow under a button when hovered over.\n", " | button_small_padding: The padding of a button set to \"small\" size.\n", " | button_small_radius: The corner radius of a button set to \"small\" size.\n", " | button_small_text_size: The text size of a button set to \"small\" size.\n", " | button_small_text_weight: The text weight of a button set to \"small\" size.\n", " | button_transition: The transition animation duration of a button between regular, hover, and focused states.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Methods inherited from gradio.themes.base.ThemeClass:\n", " | \n", " | dump(self, filename: 'str')\n", " | Write the theme to a json file.\n", " | \n", " | Parameters:\n", " | filename: The path to write the theme too\n", " | \n", " | push_to_hub(self, repo_name: 'str', org_name: 'str | None' = None, version: 'str | None' = None, hf_token: 'str | None' = None, theme_name: 'str | None' = None, description: 'str | None' = None, private: 'bool' = False)\n", " | Upload a theme to the HuggingFace hub.\n", " | \n", " | This requires a HuggingFace account.\n", " | \n", " | Parameters:\n", " | repo_name: The name of the repository to store the theme assets, e.g. 'my_theme' or 'sunset'.\n", " | org_name: The name of the org to save the space in. If None (the default), the username corresponding to the logged in user, or hƒ_token is used.\n", " | version: A semantic version tag for theme. Bumping the version tag lets you publish updates to a theme without changing the look of applications that already loaded your theme.\n", " | hf_token: API token for your HuggingFace account\n", " | theme_name: Name for the name. If None, defaults to repo_name\n", " | description: A long form description to your theme.\n", " | \n", " | to_dict(self)\n", " | Convert the theme into a python dictionary.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Class methods inherited from gradio.themes.base.ThemeClass:\n", " | \n", " | from_dict(theme: 'dict[str, dict[str, str]]') -> 'ThemeClass' from builtins.type\n", " | Create a theme instance from a dictionary representation.\n", " | \n", " | Parameters:\n", " | theme: The dictionary representation of the theme.\n", " | \n", " | from_hub(repo_name: 'str', hf_token: 'str | None' = None) from builtins.type\n", " | Load a theme from the hub.\n", " | \n", " | This DOES NOT require a HuggingFace account for downloading publicly available themes.\n", " | \n", " | Parameters:\n", " | repo_name: string of the form /@. If a semantic version expression is omitted, the latest version will be fetched.\n", " | hf_token: HuggingFace Token. Only needed to download private themes.\n", " | \n", " | load(path: 'str') -> 'ThemeClass' from builtins.type\n", " | Load a theme from a json file.\n", " | \n", " | Parameters:\n", " | path: The filepath to read.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors inherited from gradio.themes.base.ThemeClass:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", " \n", " class GoogleFont(Font)\n", " | GoogleFont(name: 'str', weights: 'Iterable[int]' = (400, 600))\n", " | \n", " | Method resolution order:\n", " | GoogleFont\n", " | Font\n", " | builtins.object\n", " | \n", " | Methods defined here:\n", " | \n", " | __init__(self, name: 'str', weights: 'Iterable[int]' = (400, 600))\n", " | Initialize self. See help(type(self)) for accurate signature.\n", " | \n", " | stylesheet(self) -> 'str'\n", " | \n", " | ----------------------------------------------------------------------\n", " | Methods inherited from Font:\n", " | \n", " | __eq__(self, other: 'Font') -> 'bool'\n", " | Return self==value.\n", " | \n", " | __repr__(self) -> 'str'\n", " | Return repr(self).\n", " | \n", " | __str__(self) -> 'str'\n", " | Return str(self).\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors inherited from Font:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data and other attributes inherited from Font:\n", " | \n", " | __hash__ = None\n", " \n", " class Monochrome(gradio.themes.base.Base)\n", " | Monochrome(*, primary_hue: 'colors.Color | str' = , secondary_hue: 'colors.Color | str' = , neutral_hue: 'colors.Color | str' = , spacing_size: 'sizes.Size | str' = , radius_size: 'sizes.Size | str' = , text_size: 'sizes.Size | str' = , font: 'fonts.Font | str | Iterable[fonts.Font | str]' = (, 'ui-sans-serif', 'system-ui', 'sans-serif'), font_mono: 'fonts.Font | str | Iterable[fonts.Font | str]' = (, 'ui-monospace', 'Consolas', 'monospace'))\n", " | \n", " | Method resolution order:\n", " | Monochrome\n", " | gradio.themes.base.Base\n", " | gradio.themes.base.ThemeClass\n", " | builtins.object\n", " | \n", " | Methods defined here:\n", " | \n", " | __init__(self, *, primary_hue: 'colors.Color | str' = , secondary_hue: 'colors.Color | str' = , neutral_hue: 'colors.Color | str' = , spacing_size: 'sizes.Size | str' = , radius_size: 'sizes.Size | str' = , text_size: 'sizes.Size | str' = , font: 'fonts.Font | str | Iterable[fonts.Font | str]' = (, 'ui-sans-serif', 'system-ui', 'sans-serif'), font_mono: 'fonts.Font | str | Iterable[fonts.Font | str]' = (, 'ui-monospace', 'Consolas', 'monospace'))\n", " | Parameters:\n", " | primary_hue: The primary hue of the theme. Load a preset, like gradio.themes.colors.green (or just the string \"green\"), or pass your own gradio.themes.utils.Color object.\n", " | secondary_hue: The secondary hue of the theme. Load a preset, like gradio.themes.colors.green (or just the string \"green\"), or pass your own gradio.themes.utils.Color object.\n", " | neutral_hue: The neutral hue of the theme, used . Load a preset, like gradio.themes.colors.green (or just the string \"green\"), or pass your own gradio.themes.utils.Color object.\n", " | text_size: The size of the text. Load a preset, like gradio.themes.sizes.text_sm (or just the string \"sm\"), or pass your own gradio.themes.utils.Size object.\n", " | spacing_size: The size of the spacing. Load a preset, like gradio.themes.sizes.spacing_sm (or just the string \"sm\"), or pass your own gradio.themes.utils.Size object.\n", " | radius_size: The radius size of corners. Load a preset, like gradio.themes.sizes.radius_sm (or just the string \"sm\"), or pass your own gradio.themes.utils.Size object.\n", " | font: The primary font to use for the theme. Pass a string for a system font, or a gradio.themes.font.GoogleFont object to load a font from Google Fonts. Pass a list of fonts for fallbacks.\n", " | font_mono: The monospace font to use for the theme, applies to code. Pass a string for a system font, or a gradio.themes.font.GoogleFont object to load a font from Google Fonts. Pass a list of fonts for fallbacks.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Methods inherited from gradio.themes.base.Base:\n", " | \n", " | set(self, *, body_background_fill=None, body_background_fill_dark=None, body_text_color=None, body_text_color_dark=None, body_text_size=None, body_text_color_subdued=None, body_text_color_subdued_dark=None, body_text_weight=None, embed_radius=None, background_fill_primary=None, background_fill_primary_dark=None, background_fill_secondary=None, background_fill_secondary_dark=None, border_color_accent=None, border_color_accent_dark=None, border_color_accent_subdued=None, border_color_accent_subdued_dark=None, border_color_primary=None, border_color_primary_dark=None, color_accent=None, color_accent_soft=None, color_accent_soft_dark=None, link_text_color=None, link_text_color_dark=None, link_text_color_active=None, link_text_color_active_dark=None, link_text_color_hover=None, link_text_color_hover_dark=None, link_text_color_visited=None, link_text_color_visited_dark=None, prose_text_size=None, prose_text_weight=None, prose_header_text_weight=None, code_background_fill=None, code_background_fill_dark=None, shadow_drop=None, shadow_drop_lg=None, shadow_inset=None, shadow_spread=None, shadow_spread_dark=None, block_background_fill=None, block_background_fill_dark=None, block_border_color=None, block_border_color_dark=None, block_border_width=None, block_border_width_dark=None, block_info_text_color=None, block_info_text_color_dark=None, block_info_text_size=None, block_info_text_weight=None, block_label_background_fill=None, block_label_background_fill_dark=None, block_label_border_color=None, block_label_border_color_dark=None, block_label_border_width=None, block_label_border_width_dark=None, block_label_shadow=None, block_label_text_color=None, block_label_text_color_dark=None, block_label_margin=None, block_label_padding=None, block_label_radius=None, block_label_right_radius=None, block_label_text_size=None, block_label_text_weight=None, block_padding=None, block_radius=None, block_shadow=None, block_shadow_dark=None, block_title_background_fill=None, block_title_background_fill_dark=None, block_title_border_color=None, block_title_border_color_dark=None, block_title_border_width=None, block_title_border_width_dark=None, block_title_text_color=None, block_title_text_color_dark=None, block_title_padding=None, block_title_radius=None, block_title_text_size=None, block_title_text_weight=None, container_radius=None, form_gap_width=None, layout_gap=None, panel_background_fill=None, panel_background_fill_dark=None, panel_border_color=None, panel_border_color_dark=None, panel_border_width=None, panel_border_width_dark=None, section_header_text_size=None, section_header_text_weight=None, accordion_text_color=None, accordion_text_color_dark=None, table_text_color=None, table_text_color_dark=None, checkbox_background_color=None, checkbox_background_color_dark=None, checkbox_background_color_focus=None, checkbox_background_color_focus_dark=None, checkbox_background_color_hover=None, checkbox_background_color_hover_dark=None, checkbox_background_color_selected=None, checkbox_background_color_selected_dark=None, checkbox_border_color=None, checkbox_border_color_dark=None, checkbox_border_color_focus=None, checkbox_border_color_focus_dark=None, checkbox_border_color_hover=None, checkbox_border_color_hover_dark=None, checkbox_border_color_selected=None, checkbox_border_color_selected_dark=None, checkbox_border_radius=None, checkbox_border_width=None, checkbox_border_width_dark=None, checkbox_check=None, radio_circle=None, checkbox_shadow=None, checkbox_label_background_fill=None, checkbox_label_background_fill_dark=None, checkbox_label_background_fill_hover=None, checkbox_label_background_fill_hover_dark=None, checkbox_label_background_fill_selected=None, checkbox_label_background_fill_selected_dark=None, checkbox_label_border_color=None, checkbox_label_border_color_dark=None, checkbox_label_border_color_hover=None, checkbox_label_border_color_hover_dark=None, checkbox_label_border_width=None, checkbox_label_border_width_dark=None, checkbox_label_gap=None, checkbox_label_padding=None, checkbox_label_shadow=None, checkbox_label_text_size=None, checkbox_label_text_weight=None, checkbox_label_text_color=None, checkbox_label_text_color_dark=None, checkbox_label_text_color_selected=None, checkbox_label_text_color_selected_dark=None, error_background_fill=None, error_background_fill_dark=None, error_border_color=None, error_border_color_dark=None, error_border_width=None, error_border_width_dark=None, error_text_color=None, error_text_color_dark=None, error_icon_color=None, error_icon_color_dark=None, input_background_fill=None, input_background_fill_dark=None, input_background_fill_focus=None, input_background_fill_focus_dark=None, input_background_fill_hover=None, input_background_fill_hover_dark=None, input_border_color=None, input_border_color_dark=None, input_border_color_focus=None, input_border_color_focus_dark=None, input_border_color_hover=None, input_border_color_hover_dark=None, input_border_width=None, input_border_width_dark=None, input_padding=None, input_placeholder_color=None, input_placeholder_color_dark=None, input_radius=None, input_shadow=None, input_shadow_dark=None, input_shadow_focus=None, input_shadow_focus_dark=None, input_text_size=None, input_text_weight=None, loader_color=None, loader_color_dark=None, slider_color=None, slider_color_dark=None, stat_background_fill=None, stat_background_fill_dark=None, table_border_color=None, table_border_color_dark=None, table_even_background_fill=None, table_even_background_fill_dark=None, table_odd_background_fill=None, table_odd_background_fill_dark=None, table_radius=None, table_row_focus=None, table_row_focus_dark=None, button_border_width=None, button_border_width_dark=None, button_shadow=None, button_shadow_active=None, button_shadow_hover=None, button_transition=None, button_large_padding=None, button_large_radius=None, button_large_text_size=None, button_large_text_weight=None, button_small_padding=None, button_small_radius=None, button_small_text_size=None, button_small_text_weight=None, button_primary_background_fill=None, button_primary_background_fill_dark=None, button_primary_background_fill_hover=None, button_primary_background_fill_hover_dark=None, button_primary_border_color=None, button_primary_border_color_dark=None, button_primary_border_color_hover=None, button_primary_border_color_hover_dark=None, button_primary_text_color=None, button_primary_text_color_dark=None, button_primary_text_color_hover=None, button_primary_text_color_hover_dark=None, button_secondary_background_fill=None, button_secondary_background_fill_dark=None, button_secondary_background_fill_hover=None, button_secondary_background_fill_hover_dark=None, button_secondary_border_color=None, button_secondary_border_color_dark=None, button_secondary_border_color_hover=None, button_secondary_border_color_hover_dark=None, button_secondary_text_color=None, button_secondary_text_color_dark=None, button_secondary_text_color_hover=None, button_secondary_text_color_hover_dark=None, button_cancel_background_fill=None, button_cancel_background_fill_dark=None, button_cancel_background_fill_hover=None, button_cancel_background_fill_hover_dark=None, button_cancel_border_color=None, button_cancel_border_color_dark=None, button_cancel_border_color_hover=None, button_cancel_border_color_hover_dark=None, button_cancel_text_color=None, button_cancel_text_color_dark=None, button_cancel_text_color_hover=None, button_cancel_text_color_hover_dark=None) -> 'Base'\n", " | Parameters:\n", " | body_background_fill: The background of the entire app.\n", " | body_background_fill_dark: The background of the entire app in dark mode.\n", " | body_text_color: The default text color.\n", " | body_text_color_dark: The default text color in dark mode.\n", " | body_text_size: The default text size.\n", " | body_text_color_subdued: The text color used for softer, less important text.\n", " | body_text_color_subdued_dark: The text color used for softer, less important text in dark mode.\n", " | body_text_weight: The default text weight.\n", " | embed_radius: The corner radius used for embedding when the app is embedded within a page.\n", " | background_fill_primary: The background primarily used for items placed directly on the page.\n", " | background_fill_primary_dark: The background primarily used for items placed directly on the page in dark mode.\n", " | background_fill_secondary: The background primarily used for items placed on top of another item.\n", " | background_fill_secondary_dark: The background primarily used for items placed on top of another item in dark mode.\n", " | border_color_accent: The border color used for accented items.\n", " | border_color_accent_dark: The border color used for accented items in dark mode.\n", " | border_color_accent_subdued: The subdued border color for accented items.\n", " | border_color_accent_subdued_dark: The subdued border color for accented items in dark mode.\n", " | border_color_primary: The border color primarily used for items placed directly on the page.\n", " | border_color_primary_dark: The border color primarily used for items placed directly on the page in dark mode.\n", " | color_accent: The color used for accented items.\n", " | color_accent_soft: The softer color used for accented items.\n", " | color_accent_soft_dark: The softer color used for accented items in dark mode.\n", " | link_text_color: The text color used for links.\n", " | link_text_color_dark: The text color used for links in dark mode.\n", " | link_text_color_active: The text color used for links when they are active.\n", " | link_text_color_active_dark: The text color used for links when they are active in dark mode.\n", " | link_text_color_hover: The text color used for links when they are hovered over.\n", " | link_text_color_hover_dark: The text color used for links when they are hovered over in dark mode.\n", " | link_text_color_visited: The text color used for links when they have been visited.\n", " | link_text_color_visited_dark: The text color used for links when they have been visited in dark mode.\n", " | prose_text_size: The text size used for markdown and other prose.\n", " | prose_text_weight: The text weight used for markdown and other prose.\n", " | prose_header_text_weight: The text weight of a header used for markdown and other prose.\n", " | code_background_fill: The background color of code blocks.\n", " | code_background_fill_dark: The background color of code blocks in dark mode.\n", " | shadow_drop: Drop shadow used by other shadowed items.\n", " | shadow_drop_lg: Larger drop shadow used by other shadowed items.\n", " | shadow_inset: Inset shadow used by other shadowed items.\n", " | shadow_spread: Size of shadow spread used by shadowed items.\n", " | shadow_spread_dark: Size of shadow spread used by shadowed items in dark mode.\n", " | block_background_fill: The background around an item.\n", " | block_background_fill_dark: The background around an item in dark mode.\n", " | block_border_color: The border color around an item.\n", " | block_border_color_dark: The border color around an item in dark mode.\n", " | block_border_width: The border width around an item.\n", " | block_border_width_dark: The border width around an item in dark mode.\n", " | block_info_text_color: The color of the info text.\n", " | block_info_text_color_dark: The color of the info text in dark mode.\n", " | block_info_text_size: The size of the info text.\n", " | block_info_text_weight: The weight of the info text.\n", " | block_label_background_fill: The background of the title label of a media element (e.g. image).\n", " | block_label_background_fill_dark: The background of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_border_color: The border color of the title label of a media element (e.g. image).\n", " | block_label_border_color_dark: The border color of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_border_width: The border width of the title label of a media element (e.g. image).\n", " | block_label_border_width_dark: The border width of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_shadow: The shadow of the title label of a media element (e.g. image).\n", " | block_label_text_color: The text color of the title label of a media element (e.g. image).\n", " | block_label_text_color_dark: The text color of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_margin: The margin of the title label of a media element (e.g. image) from its surrounding container.\n", " | block_label_padding: The padding of the title label of a media element (e.g. image).\n", " | block_label_radius: The corner radius of the title label of a media element (e.g. image).\n", " | block_label_right_radius: The corner radius of a right-aligned helper label.\n", " | block_label_text_size: The text size of the title label of a media element (e.g. image).\n", " | block_label_text_weight: The text weight of the title label of a media element (e.g. image).\n", " | block_padding: The padding around an item.\n", " | block_radius: The corner radius around an item.\n", " | block_shadow: The shadow under an item.\n", " | block_shadow_dark: The shadow under an item in dark mode.\n", " | block_title_background_fill: The background of the title of a form element (e.g. textbox).\n", " | block_title_background_fill_dark: The background of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_border_color: The border color of the title of a form element (e.g. textbox).\n", " | block_title_border_color_dark: The border color of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_border_width: The border width of the title of a form element (e.g. textbox).\n", " | block_title_border_width_dark: The border width of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_text_color: The text color of the title of a form element (e.g. textbox).\n", " | block_title_text_color_dark: The text color of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_padding: The padding of the title of a form element (e.g. textbox).\n", " | block_title_radius: The corner radius of the title of a form element (e.g. textbox).\n", " | block_title_text_size: The text size of the title of a form element (e.g. textbox).\n", " | block_title_text_weight: The text weight of the title of a form element (e.g. textbox).\n", " | container_radius: The corner radius of a layout component that holds other content.\n", " | form_gap_width: The border gap between form elements, (e.g. consecutive textboxes).\n", " | layout_gap: The gap between items within a row or column.\n", " | panel_background_fill: The background of a panel.\n", " | panel_background_fill_dark: The background of a panel in dark mode.\n", " | panel_border_color: The border color of a panel.\n", " | panel_border_color_dark: The border color of a panel in dark mode.\n", " | panel_border_width: The border width of a panel.\n", " | panel_border_width_dark: The border width of a panel in dark mode.\n", " | accordion_text_color: The body text color in the accordion.\n", " | accordion_text_color_dark: The body text color in the accordion in dark mode.\n", " | table_text_color: The body text color in the table.\n", " | table_text_color_dark: The body text color in the table in dark mode.\n", " | section_header_text_size: The text size of a section header (e.g. tab name).\n", " | section_header_text_weight: The text weight of a section header (e.g. tab name).\n", " | checkbox_background_color: The background of a checkbox square or radio circle.\n", " | checkbox_background_color_dark: The background of a checkbox square or radio circle in dark mode.\n", " | checkbox_background_color_focus: The background of a checkbox square or radio circle when focused.\n", " | checkbox_background_color_focus_dark: The background of a checkbox square or radio circle when focused in dark mode.\n", " | checkbox_background_color_hover: The background of a checkbox square or radio circle when hovered over.\n", " | checkbox_background_color_hover_dark: The background of a checkbox square or radio circle when hovered over in dark mode.\n", " | checkbox_background_color_selected: The background of a checkbox square or radio circle when selected.\n", " | checkbox_background_color_selected_dark: The background of a checkbox square or radio circle when selected in dark mode.\n", " | checkbox_border_color: The border color of a checkbox square or radio circle.\n", " | checkbox_border_color_dark: The border color of a checkbox square or radio circle in dark mode.\n", " | checkbox_border_color_focus: The border color of a checkbox square or radio circle when focused.\n", " | checkbox_border_color_focus_dark: The border color of a checkbox square or radio circle when focused in dark mode.\n", " | checkbox_border_color_hover: The border color of a checkbox square or radio circle when hovered over.\n", " | checkbox_border_color_hover_dark: The border color of a checkbox square or radio circle when hovered over in dark mode.\n", " | checkbox_border_color_selected: The border color of a checkbox square or radio circle when selected.\n", " | checkbox_border_color_selected_dark: The border color of a checkbox square or radio circle when selected in dark mode.\n", " | checkbox_border_radius: The corner radius of a checkbox square.\n", " | checkbox_border_width: The border width of a checkbox square or radio circle.\n", " | checkbox_border_width_dark: The border width of a checkbox square or radio circle in dark mode.\n", " | checkbox_check: The checkmark visual of a checkbox square.\n", " | radio_circle: The circle visual of a radio circle.\n", " | checkbox_shadow: The shadow of a checkbox square or radio circle.\n", " | checkbox_label_background_fill: The background of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_background_fill_dark: The background of the surrounding button of a checkbox or radio element in dark mode.\n", " | checkbox_label_background_fill_hover: The background of the surrounding button of a checkbox or radio element when hovered over.\n", " | checkbox_label_background_fill_hover_dark: The background of the surrounding button of a checkbox or radio element when hovered over in dark mode.\n", " | checkbox_label_background_fill_selected: The background of the surrounding button of a checkbox or radio element when selected.\n", " | checkbox_label_background_fill_selected_dark: The background of the surrounding button of a checkbox or radio element when selected in dark mode.\n", " | checkbox_label_border_color: The border color of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_border_color_dark: The border color of the surrounding button of a checkbox or radio element in dark mode.\n", " | checkbox_label_border_color_hover: The border color of the surrounding button of a checkbox or radio element when hovered over.\n", " | checkbox_label_border_color_hover_dark: The border color of the surrounding button of a checkbox or radio element when hovered over in dark mode.\n", " | checkbox_label_border_width: The border width of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_border_width_dark: The border width of the surrounding button of a checkbox or radio element in dark mode.\n", " | checkbox_label_gap: The gap consecutive checkbox or radio elements.\n", " | checkbox_label_padding: The padding of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_shadow: The shadow of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_text_size: The text size of the label accompanying a checkbox or radio element.\n", " | checkbox_label_text_weight: The text weight of the label accompanying a checkbox or radio element.\n", " | checkbox_label_text_color: The text color of the label accompanying a checkbox or radio element.\n", " | checkbox_label_text_color_dark: The text color of the label accompanying a checkbox or radio element in dark mode.\n", " | checkbox_label_text_color_selected: The text color of the label accompanying a checkbox or radio element when selected.\n", " | checkbox_label_text_color_selected_dark: The text color of the label accompanying a checkbox or radio element when selected in dark mode.\n", " | error_background_fill: The background of an error message.\n", " | error_background_fill_dark: The background of an error message in dark mode.\n", " | error_border_color: The border color of an error message.\n", " | error_border_color_dark: The border color of an error message in dark mode.\n", " | error_border_width: The border width of an error message.\n", " | error_border_width_dark: The border width of an error message in dark mode.\n", " | error_text_color: The text color of an error message.\n", " | error_text_color_dark: The text color of an error message in dark mode.\n", " | input_background_fill: The background of an input field.\n", " | input_background_fill_dark: The background of an input field in dark mode.\n", " | input_background_fill_focus: The background of an input field when focused.\n", " | input_background_fill_focus_dark: The background of an input field when focused in dark mode.\n", " | input_background_fill_hover: The background of an input field when hovered over.\n", " | input_background_fill_hover_dark: The background of an input field when hovered over in dark mode.\n", " | input_border_color: The border color of an input field.\n", " | input_border_color_dark: The border color of an input field in dark mode.\n", " | input_border_color_focus: The border color of an input field when focused.\n", " | input_border_color_focus_dark: The border color of an input field when focused in dark mode.\n", " | input_border_color_hover: The border color of an input field when hovered over.\n", " | input_border_color_hover_dark: The border color of an input field when hovered over in dark mode.\n", " | input_border_width: The border width of an input field.\n", " | input_border_width_dark: The border width of an input field in dark mode.\n", " | input_padding: The padding of an input field.\n", " | input_placeholder_color: The placeholder text color of an input field.\n", " | input_placeholder_color_dark: The placeholder text color of an input field in dark mode.\n", " | input_radius: The corner radius of an input field.\n", " | input_shadow: The shadow of an input field.\n", " | input_shadow_dark: The shadow of an input field in dark mode.\n", " | input_shadow_focus: The shadow of an input field when focused.\n", " | input_shadow_focus_dark: The shadow of an input field when focused in dark mode.\n", " | input_text_size: The text size of an input field.\n", " | input_text_weight: The text weight of an input field.\n", " | loader_color: The color of the loading animation while a request is pending.\n", " | loader_color_dark: The color of the loading animation while a request is pending in dark mode.\n", " | slider_color: The color of the slider in a range element.\n", " | slider_color_dark: The color of the slider in a range element in dark mode.\n", " | stat_background_fill: The background used for stats visuals (e.g. confidence bars in label).\n", " | stat_background_fill_dark: The background used for stats visuals (e.g. confidence bars in label) in dark mode.\n", " | table_border_color: The border color of a table.\n", " | table_border_color_dark: The border color of a table in dark mode.\n", " | table_even_background_fill: The background of even rows in a table.\n", " | table_even_background_fill_dark: The background of even rows in a table in dark mode.\n", " | table_odd_background_fill: The background of odd rows in a table.\n", " | table_odd_background_fill_dark: The background of odd rows in a table in dark mode.\n", " | table_radius: The corner radius of a table.\n", " | table_row_focus: The background of a focused row in a table.\n", " | table_row_focus_dark: The background of a focused row in a table in dark mode.\n", " | button_border_width: The border width of a button.\n", " | button_border_width_dark: The border width of a button in dark mode.\n", " | button_cancel_background_fill: The background of a button of \"cancel\" variant.\n", " | button_cancel_background_fill_dark: The background of a button of \"cancel\" variant in dark mode.\n", " | button_cancel_background_fill_hover: The background of a button of \"cancel\" variant when hovered over.\n", " | button_cancel_background_fill_hover_dark: The background of a button of \"cancel\" variant when hovered over in dark mode.\n", " | button_cancel_border_color: The border color of a button of \"cancel\" variant.\n", " | button_cancel_border_color_dark: The border color of a button of \"cancel\" variant in dark mode.\n", " | button_cancel_border_color_hover: The border color of a button of \"cancel\" variant when hovered over.\n", " | button_cancel_border_color_hover_dark: The border color of a button of \"cancel\" variant when hovered over in dark mode.\n", " | button_cancel_text_color: The text color of a button of \"cancel\" variant.\n", " | button_cancel_text_color_dark: The text color of a button of \"cancel\" variant in dark mode.\n", " | button_cancel_text_color_hover: The text color of a button of \"cancel\" variant when hovered over.\n", " | button_cancel_text_color_hover_dark: The text color of a button of \"cancel\" variant when hovered over in dark mode.\n", " | button_large_padding: The padding of a button with the default \"large\" size.\n", " | button_large_radius: The corner radius of a button with the default \"large\" size.\n", " | button_large_text_size: The text size of a button with the default \"large\" size.\n", " | button_large_text_weight: The text weight of a button with the default \"large\" size.\n", " | button_primary_background_fill: The background of a button of \"primary\" variant.\n", " | button_primary_background_fill_dark: The background of a button of \"primary\" variant in dark mode.\n", " | button_primary_background_fill_hover: The background of a button of \"primary\" variant when hovered over.\n", " | button_primary_background_fill_hover_dark: The background of a button of \"primary\" variant when hovered over in dark mode.\n", " | button_primary_border_color: The border color of a button of \"primary\" variant.\n", " | button_primary_border_color_dark: The border color of a button of \"primary\" variant in dark mode.\n", " | button_primary_border_color_hover: The border color of a button of \"primary\" variant when hovered over.\n", " | button_primary_border_color_hover_dark: The border color of a button of \"primary\" variant when hovered over in dark mode.\n", " | button_primary_text_color: The text color of a button of \"primary\" variant.\n", " | button_primary_text_color_dark: The text color of a button of \"primary\" variant in dark mode.\n", " | button_primary_text_color_hover: The text color of a button of \"primary\" variant when hovered over.\n", " | button_primary_text_color_hover_dark: The text color of a button of \"primary\" variant when hovered over in dark mode.\n", " | button_secondary_background_fill: The background of a button of default \"secondary\" variant.\n", " | button_secondary_background_fill_dark: The background of a button of default \"secondary\" variant in dark mode.\n", " | button_secondary_background_fill_hover: The background of a button of default \"secondary\" variant when hovered over.\n", " | button_secondary_background_fill_hover_dark: The background of a button of default \"secondary\" variant when hovered over in dark mode.\n", " | button_secondary_border_color: The border color of a button of default \"secondary\" variant.\n", " | button_secondary_border_color_dark: The border color of a button of default \"secondary\" variant in dark mode.\n", " | button_secondary_border_color_hover: The border color of a button of default \"secondary\" variant when hovered over.\n", " | button_secondary_border_color_hover_dark: The border color of a button of default \"secondary\" variant when hovered over in dark mode.\n", " | button_secondary_text_color: The text color of a button of default \"secondary\" variant.\n", " | button_secondary_text_color_dark: The text color of a button of default \"secondary\" variant in dark mode.\n", " | button_secondary_text_color_hover: The text color of a button of default \"secondary\" variant when hovered over.\n", " | button_secondary_text_color_hover_dark: The text color of a button of default \"secondary\" variant when hovered over in dark mode.\n", " | button_shadow: The shadow under a button.\n", " | button_shadow_active: The shadow under a button when pressed.\n", " | button_shadow_hover: The shadow under a button when hovered over.\n", " | button_small_padding: The padding of a button set to \"small\" size.\n", " | button_small_radius: The corner radius of a button set to \"small\" size.\n", " | button_small_text_size: The text size of a button set to \"small\" size.\n", " | button_small_text_weight: The text weight of a button set to \"small\" size.\n", " | button_transition: The transition animation duration of a button between regular, hover, and focused states.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Methods inherited from gradio.themes.base.ThemeClass:\n", " | \n", " | dump(self, filename: 'str')\n", " | Write the theme to a json file.\n", " | \n", " | Parameters:\n", " | filename: The path to write the theme too\n", " | \n", " | push_to_hub(self, repo_name: 'str', org_name: 'str | None' = None, version: 'str | None' = None, hf_token: 'str | None' = None, theme_name: 'str | None' = None, description: 'str | None' = None, private: 'bool' = False)\n", " | Upload a theme to the HuggingFace hub.\n", " | \n", " | This requires a HuggingFace account.\n", " | \n", " | Parameters:\n", " | repo_name: The name of the repository to store the theme assets, e.g. 'my_theme' or 'sunset'.\n", " | org_name: The name of the org to save the space in. If None (the default), the username corresponding to the logged in user, or hƒ_token is used.\n", " | version: A semantic version tag for theme. Bumping the version tag lets you publish updates to a theme without changing the look of applications that already loaded your theme.\n", " | hf_token: API token for your HuggingFace account\n", " | theme_name: Name for the name. If None, defaults to repo_name\n", " | description: A long form description to your theme.\n", " | \n", " | to_dict(self)\n", " | Convert the theme into a python dictionary.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Class methods inherited from gradio.themes.base.ThemeClass:\n", " | \n", " | from_dict(theme: 'dict[str, dict[str, str]]') -> 'ThemeClass' from builtins.type\n", " | Create a theme instance from a dictionary representation.\n", " | \n", " | Parameters:\n", " | theme: The dictionary representation of the theme.\n", " | \n", " | from_hub(repo_name: 'str', hf_token: 'str | None' = None) from builtins.type\n", " | Load a theme from the hub.\n", " | \n", " | This DOES NOT require a HuggingFace account for downloading publicly available themes.\n", " | \n", " | Parameters:\n", " | repo_name: string of the form /@. If a semantic version expression is omitted, the latest version will be fetched.\n", " | hf_token: HuggingFace Token. Only needed to download private themes.\n", " | \n", " | load(path: 'str') -> 'ThemeClass' from builtins.type\n", " | Load a theme from a json file.\n", " | \n", " | Parameters:\n", " | path: The filepath to read.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors inherited from gradio.themes.base.ThemeClass:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", " \n", " class Size(builtins.object)\n", " | Size(xxs: 'str', xs: 'str', sm: 'str', md: 'str', lg: 'str', xl: 'str', xxl: 'str', name=None)\n", " | \n", " | Methods defined here:\n", " | \n", " | __init__(self, xxs: 'str', xs: 'str', sm: 'str', md: 'str', lg: 'str', xl: 'str', xxl: 'str', name=None)\n", " | Initialize self. See help(type(self)) for accurate signature.\n", " | \n", " | expand(self) -> 'list[str]'\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors defined here:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data and other attributes defined here:\n", " | \n", " | all = [, , secondary_hue: 'colors.Color | str' = , neutral_hue: 'colors.Color | str' = , spacing_size: 'sizes.Size | str' = , radius_size: 'sizes.Size | str' = , text_size: 'sizes.Size | str' = , font: 'fonts.Font | str | Iterable[fonts.Font | str]' = (, 'ui-sans-serif', 'system-ui', 'sans-serif'), font_mono: 'fonts.Font | str | Iterable[fonts.Font | str]' = (, 'ui-monospace', 'Consolas', 'monospace'))\n", " | \n", " | Method resolution order:\n", " | Soft\n", " | gradio.themes.base.Base\n", " | gradio.themes.base.ThemeClass\n", " | builtins.object\n", " | \n", " | Methods defined here:\n", " | \n", " | __init__(self, *, primary_hue: 'colors.Color | str' = , secondary_hue: 'colors.Color | str' = , neutral_hue: 'colors.Color | str' = , spacing_size: 'sizes.Size | str' = , radius_size: 'sizes.Size | str' = , text_size: 'sizes.Size | str' = , font: 'fonts.Font | str | Iterable[fonts.Font | str]' = (, 'ui-sans-serif', 'system-ui', 'sans-serif'), font_mono: 'fonts.Font | str | Iterable[fonts.Font | str]' = (, 'ui-monospace', 'Consolas', 'monospace'))\n", " | Parameters:\n", " | primary_hue: The primary hue of the theme. Load a preset, like gradio.themes.colors.green (or just the string \"green\"), or pass your own gradio.themes.utils.Color object.\n", " | secondary_hue: The secondary hue of the theme. Load a preset, like gradio.themes.colors.green (or just the string \"green\"), or pass your own gradio.themes.utils.Color object.\n", " | neutral_hue: The neutral hue of the theme, used . Load a preset, like gradio.themes.colors.green (or just the string \"green\"), or pass your own gradio.themes.utils.Color object.\n", " | text_size: The size of the text. Load a preset, like gradio.themes.sizes.text_sm (or just the string \"sm\"), or pass your own gradio.themes.utils.Size object.\n", " | spacing_size: The size of the spacing. Load a preset, like gradio.themes.sizes.spacing_sm (or just the string \"sm\"), or pass your own gradio.themes.utils.Size object.\n", " | radius_size: The radius size of corners. Load a preset, like gradio.themes.sizes.radius_sm (or just the string \"sm\"), or pass your own gradio.themes.utils.Size object.\n", " | font: The primary font to use for the theme. Pass a string for a system font, or a gradio.themes.font.GoogleFont object to load a font from Google Fonts. Pass a list of fonts for fallbacks.\n", " | font_mono: The monospace font to use for the theme, applies to code. Pass a string for a system font, or a gradio.themes.font.GoogleFont object to load a font from Google Fonts. Pass a list of fonts for fallbacks.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Methods inherited from gradio.themes.base.Base:\n", " | \n", " | set(self, *, body_background_fill=None, body_background_fill_dark=None, body_text_color=None, body_text_color_dark=None, body_text_size=None, body_text_color_subdued=None, body_text_color_subdued_dark=None, body_text_weight=None, embed_radius=None, background_fill_primary=None, background_fill_primary_dark=None, background_fill_secondary=None, background_fill_secondary_dark=None, border_color_accent=None, border_color_accent_dark=None, border_color_accent_subdued=None, border_color_accent_subdued_dark=None, border_color_primary=None, border_color_primary_dark=None, color_accent=None, color_accent_soft=None, color_accent_soft_dark=None, link_text_color=None, link_text_color_dark=None, link_text_color_active=None, link_text_color_active_dark=None, link_text_color_hover=None, link_text_color_hover_dark=None, link_text_color_visited=None, link_text_color_visited_dark=None, prose_text_size=None, prose_text_weight=None, prose_header_text_weight=None, code_background_fill=None, code_background_fill_dark=None, shadow_drop=None, shadow_drop_lg=None, shadow_inset=None, shadow_spread=None, shadow_spread_dark=None, block_background_fill=None, block_background_fill_dark=None, block_border_color=None, block_border_color_dark=None, block_border_width=None, block_border_width_dark=None, block_info_text_color=None, block_info_text_color_dark=None, block_info_text_size=None, block_info_text_weight=None, block_label_background_fill=None, block_label_background_fill_dark=None, block_label_border_color=None, block_label_border_color_dark=None, block_label_border_width=None, block_label_border_width_dark=None, block_label_shadow=None, block_label_text_color=None, block_label_text_color_dark=None, block_label_margin=None, block_label_padding=None, block_label_radius=None, block_label_right_radius=None, block_label_text_size=None, block_label_text_weight=None, block_padding=None, block_radius=None, block_shadow=None, block_shadow_dark=None, block_title_background_fill=None, block_title_background_fill_dark=None, block_title_border_color=None, block_title_border_color_dark=None, block_title_border_width=None, block_title_border_width_dark=None, block_title_text_color=None, block_title_text_color_dark=None, block_title_padding=None, block_title_radius=None, block_title_text_size=None, block_title_text_weight=None, container_radius=None, form_gap_width=None, layout_gap=None, panel_background_fill=None, panel_background_fill_dark=None, panel_border_color=None, panel_border_color_dark=None, panel_border_width=None, panel_border_width_dark=None, section_header_text_size=None, section_header_text_weight=None, accordion_text_color=None, accordion_text_color_dark=None, table_text_color=None, table_text_color_dark=None, checkbox_background_color=None, checkbox_background_color_dark=None, checkbox_background_color_focus=None, checkbox_background_color_focus_dark=None, checkbox_background_color_hover=None, checkbox_background_color_hover_dark=None, checkbox_background_color_selected=None, checkbox_background_color_selected_dark=None, checkbox_border_color=None, checkbox_border_color_dark=None, checkbox_border_color_focus=None, checkbox_border_color_focus_dark=None, checkbox_border_color_hover=None, checkbox_border_color_hover_dark=None, checkbox_border_color_selected=None, checkbox_border_color_selected_dark=None, checkbox_border_radius=None, checkbox_border_width=None, checkbox_border_width_dark=None, checkbox_check=None, radio_circle=None, checkbox_shadow=None, checkbox_label_background_fill=None, checkbox_label_background_fill_dark=None, checkbox_label_background_fill_hover=None, checkbox_label_background_fill_hover_dark=None, checkbox_label_background_fill_selected=None, checkbox_label_background_fill_selected_dark=None, checkbox_label_border_color=None, checkbox_label_border_color_dark=None, checkbox_label_border_color_hover=None, checkbox_label_border_color_hover_dark=None, checkbox_label_border_width=None, checkbox_label_border_width_dark=None, checkbox_label_gap=None, checkbox_label_padding=None, checkbox_label_shadow=None, checkbox_label_text_size=None, checkbox_label_text_weight=None, checkbox_label_text_color=None, checkbox_label_text_color_dark=None, checkbox_label_text_color_selected=None, checkbox_label_text_color_selected_dark=None, error_background_fill=None, error_background_fill_dark=None, error_border_color=None, error_border_color_dark=None, error_border_width=None, error_border_width_dark=None, error_text_color=None, error_text_color_dark=None, error_icon_color=None, error_icon_color_dark=None, input_background_fill=None, input_background_fill_dark=None, input_background_fill_focus=None, input_background_fill_focus_dark=None, input_background_fill_hover=None, input_background_fill_hover_dark=None, input_border_color=None, input_border_color_dark=None, input_border_color_focus=None, input_border_color_focus_dark=None, input_border_color_hover=None, input_border_color_hover_dark=None, input_border_width=None, input_border_width_dark=None, input_padding=None, input_placeholder_color=None, input_placeholder_color_dark=None, input_radius=None, input_shadow=None, input_shadow_dark=None, input_shadow_focus=None, input_shadow_focus_dark=None, input_text_size=None, input_text_weight=None, loader_color=None, loader_color_dark=None, slider_color=None, slider_color_dark=None, stat_background_fill=None, stat_background_fill_dark=None, table_border_color=None, table_border_color_dark=None, table_even_background_fill=None, table_even_background_fill_dark=None, table_odd_background_fill=None, table_odd_background_fill_dark=None, table_radius=None, table_row_focus=None, table_row_focus_dark=None, button_border_width=None, button_border_width_dark=None, button_shadow=None, button_shadow_active=None, button_shadow_hover=None, button_transition=None, button_large_padding=None, button_large_radius=None, button_large_text_size=None, button_large_text_weight=None, button_small_padding=None, button_small_radius=None, button_small_text_size=None, button_small_text_weight=None, button_primary_background_fill=None, button_primary_background_fill_dark=None, button_primary_background_fill_hover=None, button_primary_background_fill_hover_dark=None, button_primary_border_color=None, button_primary_border_color_dark=None, button_primary_border_color_hover=None, button_primary_border_color_hover_dark=None, button_primary_text_color=None, button_primary_text_color_dark=None, button_primary_text_color_hover=None, button_primary_text_color_hover_dark=None, button_secondary_background_fill=None, button_secondary_background_fill_dark=None, button_secondary_background_fill_hover=None, button_secondary_background_fill_hover_dark=None, button_secondary_border_color=None, button_secondary_border_color_dark=None, button_secondary_border_color_hover=None, button_secondary_border_color_hover_dark=None, button_secondary_text_color=None, button_secondary_text_color_dark=None, button_secondary_text_color_hover=None, button_secondary_text_color_hover_dark=None, button_cancel_background_fill=None, button_cancel_background_fill_dark=None, button_cancel_background_fill_hover=None, button_cancel_background_fill_hover_dark=None, button_cancel_border_color=None, button_cancel_border_color_dark=None, button_cancel_border_color_hover=None, button_cancel_border_color_hover_dark=None, button_cancel_text_color=None, button_cancel_text_color_dark=None, button_cancel_text_color_hover=None, button_cancel_text_color_hover_dark=None) -> 'Base'\n", " | Parameters:\n", " | body_background_fill: The background of the entire app.\n", " | body_background_fill_dark: The background of the entire app in dark mode.\n", " | body_text_color: The default text color.\n", " | body_text_color_dark: The default text color in dark mode.\n", " | body_text_size: The default text size.\n", " | body_text_color_subdued: The text color used for softer, less important text.\n", " | body_text_color_subdued_dark: The text color used for softer, less important text in dark mode.\n", " | body_text_weight: The default text weight.\n", " | embed_radius: The corner radius used for embedding when the app is embedded within a page.\n", " | background_fill_primary: The background primarily used for items placed directly on the page.\n", " | background_fill_primary_dark: The background primarily used for items placed directly on the page in dark mode.\n", " | background_fill_secondary: The background primarily used for items placed on top of another item.\n", " | background_fill_secondary_dark: The background primarily used for items placed on top of another item in dark mode.\n", " | border_color_accent: The border color used for accented items.\n", " | border_color_accent_dark: The border color used for accented items in dark mode.\n", " | border_color_accent_subdued: The subdued border color for accented items.\n", " | border_color_accent_subdued_dark: The subdued border color for accented items in dark mode.\n", " | border_color_primary: The border color primarily used for items placed directly on the page.\n", " | border_color_primary_dark: The border color primarily used for items placed directly on the page in dark mode.\n", " | color_accent: The color used for accented items.\n", " | color_accent_soft: The softer color used for accented items.\n", " | color_accent_soft_dark: The softer color used for accented items in dark mode.\n", " | link_text_color: The text color used for links.\n", " | link_text_color_dark: The text color used for links in dark mode.\n", " | link_text_color_active: The text color used for links when they are active.\n", " | link_text_color_active_dark: The text color used for links when they are active in dark mode.\n", " | link_text_color_hover: The text color used for links when they are hovered over.\n", " | link_text_color_hover_dark: The text color used for links when they are hovered over in dark mode.\n", " | link_text_color_visited: The text color used for links when they have been visited.\n", " | link_text_color_visited_dark: The text color used for links when they have been visited in dark mode.\n", " | prose_text_size: The text size used for markdown and other prose.\n", " | prose_text_weight: The text weight used for markdown and other prose.\n", " | prose_header_text_weight: The text weight of a header used for markdown and other prose.\n", " | code_background_fill: The background color of code blocks.\n", " | code_background_fill_dark: The background color of code blocks in dark mode.\n", " | shadow_drop: Drop shadow used by other shadowed items.\n", " | shadow_drop_lg: Larger drop shadow used by other shadowed items.\n", " | shadow_inset: Inset shadow used by other shadowed items.\n", " | shadow_spread: Size of shadow spread used by shadowed items.\n", " | shadow_spread_dark: Size of shadow spread used by shadowed items in dark mode.\n", " | block_background_fill: The background around an item.\n", " | block_background_fill_dark: The background around an item in dark mode.\n", " | block_border_color: The border color around an item.\n", " | block_border_color_dark: The border color around an item in dark mode.\n", " | block_border_width: The border width around an item.\n", " | block_border_width_dark: The border width around an item in dark mode.\n", " | block_info_text_color: The color of the info text.\n", " | block_info_text_color_dark: The color of the info text in dark mode.\n", " | block_info_text_size: The size of the info text.\n", " | block_info_text_weight: The weight of the info text.\n", " | block_label_background_fill: The background of the title label of a media element (e.g. image).\n", " | block_label_background_fill_dark: The background of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_border_color: The border color of the title label of a media element (e.g. image).\n", " | block_label_border_color_dark: The border color of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_border_width: The border width of the title label of a media element (e.g. image).\n", " | block_label_border_width_dark: The border width of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_shadow: The shadow of the title label of a media element (e.g. image).\n", " | block_label_text_color: The text color of the title label of a media element (e.g. image).\n", " | block_label_text_color_dark: The text color of the title label of a media element (e.g. image) in dark mode.\n", " | block_label_margin: The margin of the title label of a media element (e.g. image) from its surrounding container.\n", " | block_label_padding: The padding of the title label of a media element (e.g. image).\n", " | block_label_radius: The corner radius of the title label of a media element (e.g. image).\n", " | block_label_right_radius: The corner radius of a right-aligned helper label.\n", " | block_label_text_size: The text size of the title label of a media element (e.g. image).\n", " | block_label_text_weight: The text weight of the title label of a media element (e.g. image).\n", " | block_padding: The padding around an item.\n", " | block_radius: The corner radius around an item.\n", " | block_shadow: The shadow under an item.\n", " | block_shadow_dark: The shadow under an item in dark mode.\n", " | block_title_background_fill: The background of the title of a form element (e.g. textbox).\n", " | block_title_background_fill_dark: The background of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_border_color: The border color of the title of a form element (e.g. textbox).\n", " | block_title_border_color_dark: The border color of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_border_width: The border width of the title of a form element (e.g. textbox).\n", " | block_title_border_width_dark: The border width of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_text_color: The text color of the title of a form element (e.g. textbox).\n", " | block_title_text_color_dark: The text color of the title of a form element (e.g. textbox) in dark mode.\n", " | block_title_padding: The padding of the title of a form element (e.g. textbox).\n", " | block_title_radius: The corner radius of the title of a form element (e.g. textbox).\n", " | block_title_text_size: The text size of the title of a form element (e.g. textbox).\n", " | block_title_text_weight: The text weight of the title of a form element (e.g. textbox).\n", " | container_radius: The corner radius of a layout component that holds other content.\n", " | form_gap_width: The border gap between form elements, (e.g. consecutive textboxes).\n", " | layout_gap: The gap between items within a row or column.\n", " | panel_background_fill: The background of a panel.\n", " | panel_background_fill_dark: The background of a panel in dark mode.\n", " | panel_border_color: The border color of a panel.\n", " | panel_border_color_dark: The border color of a panel in dark mode.\n", " | panel_border_width: The border width of a panel.\n", " | panel_border_width_dark: The border width of a panel in dark mode.\n", " | accordion_text_color: The body text color in the accordion.\n", " | accordion_text_color_dark: The body text color in the accordion in dark mode.\n", " | table_text_color: The body text color in the table.\n", " | table_text_color_dark: The body text color in the table in dark mode.\n", " | section_header_text_size: The text size of a section header (e.g. tab name).\n", " | section_header_text_weight: The text weight of a section header (e.g. tab name).\n", " | checkbox_background_color: The background of a checkbox square or radio circle.\n", " | checkbox_background_color_dark: The background of a checkbox square or radio circle in dark mode.\n", " | checkbox_background_color_focus: The background of a checkbox square or radio circle when focused.\n", " | checkbox_background_color_focus_dark: The background of a checkbox square or radio circle when focused in dark mode.\n", " | checkbox_background_color_hover: The background of a checkbox square or radio circle when hovered over.\n", " | checkbox_background_color_hover_dark: The background of a checkbox square or radio circle when hovered over in dark mode.\n", " | checkbox_background_color_selected: The background of a checkbox square or radio circle when selected.\n", " | checkbox_background_color_selected_dark: The background of a checkbox square or radio circle when selected in dark mode.\n", " | checkbox_border_color: The border color of a checkbox square or radio circle.\n", " | checkbox_border_color_dark: The border color of a checkbox square or radio circle in dark mode.\n", " | checkbox_border_color_focus: The border color of a checkbox square or radio circle when focused.\n", " | checkbox_border_color_focus_dark: The border color of a checkbox square or radio circle when focused in dark mode.\n", " | checkbox_border_color_hover: The border color of a checkbox square or radio circle when hovered over.\n", " | checkbox_border_color_hover_dark: The border color of a checkbox square or radio circle when hovered over in dark mode.\n", " | checkbox_border_color_selected: The border color of a checkbox square or radio circle when selected.\n", " | checkbox_border_color_selected_dark: The border color of a checkbox square or radio circle when selected in dark mode.\n", " | checkbox_border_radius: The corner radius of a checkbox square.\n", " | checkbox_border_width: The border width of a checkbox square or radio circle.\n", " | checkbox_border_width_dark: The border width of a checkbox square or radio circle in dark mode.\n", " | checkbox_check: The checkmark visual of a checkbox square.\n", " | radio_circle: The circle visual of a radio circle.\n", " | checkbox_shadow: The shadow of a checkbox square or radio circle.\n", " | checkbox_label_background_fill: The background of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_background_fill_dark: The background of the surrounding button of a checkbox or radio element in dark mode.\n", " | checkbox_label_background_fill_hover: The background of the surrounding button of a checkbox or radio element when hovered over.\n", " | checkbox_label_background_fill_hover_dark: The background of the surrounding button of a checkbox or radio element when hovered over in dark mode.\n", " | checkbox_label_background_fill_selected: The background of the surrounding button of a checkbox or radio element when selected.\n", " | checkbox_label_background_fill_selected_dark: The background of the surrounding button of a checkbox or radio element when selected in dark mode.\n", " | checkbox_label_border_color: The border color of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_border_color_dark: The border color of the surrounding button of a checkbox or radio element in dark mode.\n", " | checkbox_label_border_color_hover: The border color of the surrounding button of a checkbox or radio element when hovered over.\n", " | checkbox_label_border_color_hover_dark: The border color of the surrounding button of a checkbox or radio element when hovered over in dark mode.\n", " | checkbox_label_border_width: The border width of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_border_width_dark: The border width of the surrounding button of a checkbox or radio element in dark mode.\n", " | checkbox_label_gap: The gap consecutive checkbox or radio elements.\n", " | checkbox_label_padding: The padding of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_shadow: The shadow of the surrounding button of a checkbox or radio element.\n", " | checkbox_label_text_size: The text size of the label accompanying a checkbox or radio element.\n", " | checkbox_label_text_weight: The text weight of the label accompanying a checkbox or radio element.\n", " | checkbox_label_text_color: The text color of the label accompanying a checkbox or radio element.\n", " | checkbox_label_text_color_dark: The text color of the label accompanying a checkbox or radio element in dark mode.\n", " | checkbox_label_text_color_selected: The text color of the label accompanying a checkbox or radio element when selected.\n", " | checkbox_label_text_color_selected_dark: The text color of the label accompanying a checkbox or radio element when selected in dark mode.\n", " | error_background_fill: The background of an error message.\n", " | error_background_fill_dark: The background of an error message in dark mode.\n", " | error_border_color: The border color of an error message.\n", " | error_border_color_dark: The border color of an error message in dark mode.\n", " | error_border_width: The border width of an error message.\n", " | error_border_width_dark: The border width of an error message in dark mode.\n", " | error_text_color: The text color of an error message.\n", " | error_text_color_dark: The text color of an error message in dark mode.\n", " | input_background_fill: The background of an input field.\n", " | input_background_fill_dark: The background of an input field in dark mode.\n", " | input_background_fill_focus: The background of an input field when focused.\n", " | input_background_fill_focus_dark: The background of an input field when focused in dark mode.\n", " | input_background_fill_hover: The background of an input field when hovered over.\n", " | input_background_fill_hover_dark: The background of an input field when hovered over in dark mode.\n", " | input_border_color: The border color of an input field.\n", " | input_border_color_dark: The border color of an input field in dark mode.\n", " | input_border_color_focus: The border color of an input field when focused.\n", " | input_border_color_focus_dark: The border color of an input field when focused in dark mode.\n", " | input_border_color_hover: The border color of an input field when hovered over.\n", " | input_border_color_hover_dark: The border color of an input field when hovered over in dark mode.\n", " | input_border_width: The border width of an input field.\n", " | input_border_width_dark: The border width of an input field in dark mode.\n", " | input_padding: The padding of an input field.\n", " | input_placeholder_color: The placeholder text color of an input field.\n", " | input_placeholder_color_dark: The placeholder text color of an input field in dark mode.\n", " | input_radius: The corner radius of an input field.\n", " | input_shadow: The shadow of an input field.\n", " | input_shadow_dark: The shadow of an input field in dark mode.\n", " | input_shadow_focus: The shadow of an input field when focused.\n", " | input_shadow_focus_dark: The shadow of an input field when focused in dark mode.\n", " | input_text_size: The text size of an input field.\n", " | input_text_weight: The text weight of an input field.\n", " | loader_color: The color of the loading animation while a request is pending.\n", " | loader_color_dark: The color of the loading animation while a request is pending in dark mode.\n", " | slider_color: The color of the slider in a range element.\n", " | slider_color_dark: The color of the slider in a range element in dark mode.\n", " | stat_background_fill: The background used for stats visuals (e.g. confidence bars in label).\n", " | stat_background_fill_dark: The background used for stats visuals (e.g. confidence bars in label) in dark mode.\n", " | table_border_color: The border color of a table.\n", " | table_border_color_dark: The border color of a table in dark mode.\n", " | table_even_background_fill: The background of even rows in a table.\n", " | table_even_background_fill_dark: The background of even rows in a table in dark mode.\n", " | table_odd_background_fill: The background of odd rows in a table.\n", " | table_odd_background_fill_dark: The background of odd rows in a table in dark mode.\n", " | table_radius: The corner radius of a table.\n", " | table_row_focus: The background of a focused row in a table.\n", " | table_row_focus_dark: The background of a focused row in a table in dark mode.\n", " | button_border_width: The border width of a button.\n", " | button_border_width_dark: The border width of a button in dark mode.\n", " | button_cancel_background_fill: The background of a button of \"cancel\" variant.\n", " | button_cancel_background_fill_dark: The background of a button of \"cancel\" variant in dark mode.\n", " | button_cancel_background_fill_hover: The background of a button of \"cancel\" variant when hovered over.\n", " | button_cancel_background_fill_hover_dark: The background of a button of \"cancel\" variant when hovered over in dark mode.\n", " | button_cancel_border_color: The border color of a button of \"cancel\" variant.\n", " | button_cancel_border_color_dark: The border color of a button of \"cancel\" variant in dark mode.\n", " | button_cancel_border_color_hover: The border color of a button of \"cancel\" variant when hovered over.\n", " | button_cancel_border_color_hover_dark: The border color of a button of \"cancel\" variant when hovered over in dark mode.\n", " | button_cancel_text_color: The text color of a button of \"cancel\" variant.\n", " | button_cancel_text_color_dark: The text color of a button of \"cancel\" variant in dark mode.\n", " | button_cancel_text_color_hover: The text color of a button of \"cancel\" variant when hovered over.\n", " | button_cancel_text_color_hover_dark: The text color of a button of \"cancel\" variant when hovered over in dark mode.\n", " | button_large_padding: The padding of a button with the default \"large\" size.\n", " | button_large_radius: The corner radius of a button with the default \"large\" size.\n", " | button_large_text_size: The text size of a button with the default \"large\" size.\n", " | button_large_text_weight: The text weight of a button with the default \"large\" size.\n", " | button_primary_background_fill: The background of a button of \"primary\" variant.\n", " | button_primary_background_fill_dark: The background of a button of \"primary\" variant in dark mode.\n", " | button_primary_background_fill_hover: The background of a button of \"primary\" variant when hovered over.\n", " | button_primary_background_fill_hover_dark: The background of a button of \"primary\" variant when hovered over in dark mode.\n", " | button_primary_border_color: The border color of a button of \"primary\" variant.\n", " | button_primary_border_color_dark: The border color of a button of \"primary\" variant in dark mode.\n", " | button_primary_border_color_hover: The border color of a button of \"primary\" variant when hovered over.\n", " | button_primary_border_color_hover_dark: The border color of a button of \"primary\" variant when hovered over in dark mode.\n", " | button_primary_text_color: The text color of a button of \"primary\" variant.\n", " | button_primary_text_color_dark: The text color of a button of \"primary\" variant in dark mode.\n", " | button_primary_text_color_hover: The text color of a button of \"primary\" variant when hovered over.\n", " | button_primary_text_color_hover_dark: The text color of a button of \"primary\" variant when hovered over in dark mode.\n", " | button_secondary_background_fill: The background of a button of default \"secondary\" variant.\n", " | button_secondary_background_fill_dark: The background of a button of default \"secondary\" variant in dark mode.\n", " | button_secondary_background_fill_hover: The background of a button of default \"secondary\" variant when hovered over.\n", " | button_secondary_background_fill_hover_dark: The background of a button of default \"secondary\" variant when hovered over in dark mode.\n", " | button_secondary_border_color: The border color of a button of default \"secondary\" variant.\n", " | button_secondary_border_color_dark: The border color of a button of default \"secondary\" variant in dark mode.\n", " | button_secondary_border_color_hover: The border color of a button of default \"secondary\" variant when hovered over.\n", " | button_secondary_border_color_hover_dark: The border color of a button of default \"secondary\" variant when hovered over in dark mode.\n", " | button_secondary_text_color: The text color of a button of default \"secondary\" variant.\n", " | button_secondary_text_color_dark: The text color of a button of default \"secondary\" variant in dark mode.\n", " | button_secondary_text_color_hover: The text color of a button of default \"secondary\" variant when hovered over.\n", " | button_secondary_text_color_hover_dark: The text color of a button of default \"secondary\" variant when hovered over in dark mode.\n", " | button_shadow: The shadow under a button.\n", " | button_shadow_active: The shadow under a button when pressed.\n", " | button_shadow_hover: The shadow under a button when hovered over.\n", " | button_small_padding: The padding of a button set to \"small\" size.\n", " | button_small_radius: The corner radius of a button set to \"small\" size.\n", " | button_small_text_size: The text size of a button set to \"small\" size.\n", " | button_small_text_weight: The text weight of a button set to \"small\" size.\n", " | button_transition: The transition animation duration of a button between regular, hover, and focused states.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Methods inherited from gradio.themes.base.ThemeClass:\n", " | \n", " | dump(self, filename: 'str')\n", " | Write the theme to a json file.\n", " | \n", " | Parameters:\n", " | filename: The path to write the theme too\n", " | \n", " | push_to_hub(self, repo_name: 'str', org_name: 'str | None' = None, version: 'str | None' = None, hf_token: 'str | None' = None, theme_name: 'str | None' = None, description: 'str | None' = None, private: 'bool' = False)\n", " | Upload a theme to the HuggingFace hub.\n", " | \n", " | This requires a HuggingFace account.\n", " | \n", " | Parameters:\n", " | repo_name: The name of the repository to store the theme assets, e.g. 'my_theme' or 'sunset'.\n", " | org_name: The name of the org to save the space in. If None (the default), the username corresponding to the logged in user, or hƒ_token is used.\n", " | version: A semantic version tag for theme. Bumping the version tag lets you publish updates to a theme without changing the look of applications that already loaded your theme.\n", " | hf_token: API token for your HuggingFace account\n", " | theme_name: Name for the name. If None, defaults to repo_name\n", " | description: A long form description to your theme.\n", " | \n", " | to_dict(self)\n", " | Convert the theme into a python dictionary.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Class methods inherited from gradio.themes.base.ThemeClass:\n", " | \n", " | from_dict(theme: 'dict[str, dict[str, str]]') -> 'ThemeClass' from builtins.type\n", " | Create a theme instance from a dictionary representation.\n", " | \n", " | Parameters:\n", " | theme: The dictionary representation of the theme.\n", " | \n", " | from_hub(repo_name: 'str', hf_token: 'str | None' = None) from builtins.type\n", " | Load a theme from the hub.\n", " | \n", " | This DOES NOT require a HuggingFace account for downloading publicly available themes.\n", " | \n", " | Parameters:\n", " | repo_name: string of the form /@. If a semantic version expression is omitted, the latest version will be fetched.\n", " | hf_token: HuggingFace Token. Only needed to download private themes.\n", " | \n", " | load(path: 'str') -> 'ThemeClass' from builtins.type\n", " | Load a theme from a json file.\n", " | \n", " | Parameters:\n", " | path: The filepath to read.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors inherited from gradio.themes.base.ThemeClass:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", " \n", " class ThemeClass(builtins.object)\n", " | Methods defined here:\n", " | \n", " | __init__(self)\n", " | Initialize self. See help(type(self)) for accurate signature.\n", " | \n", " | dump(self, filename: 'str')\n", " | Write the theme to a json file.\n", " | \n", " | Parameters:\n", " | filename: The path to write the theme too\n", " | \n", " | push_to_hub(self, repo_name: 'str', org_name: 'str | None' = None, version: 'str | None' = None, hf_token: 'str | None' = None, theme_name: 'str | None' = None, description: 'str | None' = None, private: 'bool' = False)\n", " | Upload a theme to the HuggingFace hub.\n", " | \n", " | This requires a HuggingFace account.\n", " | \n", " | Parameters:\n", " | repo_name: The name of the repository to store the theme assets, e.g. 'my_theme' or 'sunset'.\n", " | org_name: The name of the org to save the space in. If None (the default), the username corresponding to the logged in user, or hƒ_token is used.\n", " | version: A semantic version tag for theme. Bumping the version tag lets you publish updates to a theme without changing the look of applications that already loaded your theme.\n", " | hf_token: API token for your HuggingFace account\n", " | theme_name: Name for the name. If None, defaults to repo_name\n", " | description: A long form description to your theme.\n", " | \n", " | to_dict(self)\n", " | Convert the theme into a python dictionary.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Class methods defined here:\n", " | \n", " | from_dict(theme: 'dict[str, dict[str, str]]') -> 'ThemeClass' from builtins.type\n", " | Create a theme instance from a dictionary representation.\n", " | \n", " | Parameters:\n", " | theme: The dictionary representation of the theme.\n", " | \n", " | from_hub(repo_name: 'str', hf_token: 'str | None' = None) from builtins.type\n", " | Load a theme from the hub.\n", " | \n", " | This DOES NOT require a HuggingFace account for downloading publicly available themes.\n", " | \n", " | Parameters:\n", " | repo_name: string of the form /@. If a semantic version expression is omitted, the latest version will be fetched.\n", " | hf_token: HuggingFace Token. Only needed to download private themes.\n", " | \n", " | load(path: 'str') -> 'ThemeClass' from builtins.type\n", " | Load a theme from a json file.\n", " | \n", " | Parameters:\n", " | path: The filepath to read.\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors defined here:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", "\n", "DATA\n", " __all__ = ['Base', 'Color', 'Default', 'Font', 'Glass', 'GoogleFont', ...\n", "\n", "FILE\n", " /usr/local/lib/python3.10/dist-packages/gradio/themes/__init__.py\n", "\n", "\n" ] } ] }, { "cell_type": "code", "source": [ "def echo(num):\n", " return num" ], "metadata": { "id": "hOxllWkDNQaY" }, "execution_count": 49, "outputs": [] }, { "cell_type": "code", "source": [ "# iface = gr.Interface(fn=echo,\n", "# inputs=gr.Number(),\n", "# outputs=gr.Number(), theme=gr.themes.Soft())\n", "# iface.launch()" ], "metadata": { "id": "WsZDRm35PMvy" }, "execution_count": 57, "outputs": [] }, { "cell_type": "code", "source": [ "# with gr.Blocks(theme=gr.themes.Soft()) as demo:\n", "# with gr.Row():\n", "# gr.Number()\n", "\n", "# demo.launch()" ], "metadata": { "id": "WEYWoHR_PaUb" }, "execution_count": 56, "outputs": [] }, { "cell_type": "code", "source": [ "# gr.themes.builder()" ], "metadata": { "id": "9Ap1-of-PtTF" }, "execution_count": 55, "outputs": [] }, { "cell_type": "code", "source": [], "metadata": { "id": "RNzeAgexQ4p5" }, "execution_count": null, "outputs": [] } ] }