diff --git "a/biomed_clip_example.ipynb" "b/biomed_clip_example.ipynb"
new file mode 100644--- /dev/null
+++ "b/biomed_clip_example.ipynb"
@@ -0,0 +1,2841 @@
+{
+ "nbformat": 4,
+ "nbformat_minor": 0,
+ "metadata": {
+ "colab": {
+ "provenance": []
+ },
+ "kernelspec": {
+ "name": "python3",
+ "display_name": "Python 3"
+ },
+ "language_info": {
+ "name": "python"
+ },
+ "widgets": {
+ "application/vnd.jupyter.widget-state+json": {
+ "dd364294fe024a3faff862df014abdcd": {
+ "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_eca221cae70445409181610afdef0e5f",
+ "IPY_MODEL_c43dae56ac244d4a9d97b39cf9d2c239",
+ "IPY_MODEL_4d234f8b73394113af464b91cbc78dbe"
+ ],
+ "layout": "IPY_MODEL_56c3e17b6cdc46f888ea61128435a326"
+ }
+ },
+ "eca221cae70445409181610afdef0e5f": {
+ "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_21d52e2249eb495ebd0a52c954e8da00",
+ "placeholder": "",
+ "style": "IPY_MODEL_47df4590b09b4982bb189b705a10c388",
+ "value": "Fetching 15 files: 100%"
+ }
+ },
+ "c43dae56ac244d4a9d97b39cf9d2c239": {
+ "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_2ec4c1279d23484dbc5349e52bad13cc",
+ "max": 15,
+ "min": 0,
+ "orientation": "horizontal",
+ "style": "IPY_MODEL_81f57d4f33d74947b78b3361ded13e60",
+ "value": 15
+ }
+ },
+ "4d234f8b73394113af464b91cbc78dbe": {
+ "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_47839e629e6f4b078f0469351b86467b",
+ "placeholder": "",
+ "style": "IPY_MODEL_d7685e5180544cccb0510f7fb7a55df6",
+ "value": " 15/15 [00:00<00:00, 44.42it/s]"
+ }
+ },
+ "56c3e17b6cdc46f888ea61128435a326": {
+ "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
+ }
+ },
+ "21d52e2249eb495ebd0a52c954e8da00": {
+ "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
+ }
+ },
+ "47df4590b09b4982bb189b705a10c388": {
+ "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": ""
+ }
+ },
+ "2ec4c1279d23484dbc5349e52bad13cc": {
+ "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
+ }
+ },
+ "81f57d4f33d74947b78b3361ded13e60": {
+ "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": ""
+ }
+ },
+ "47839e629e6f4b078f0469351b86467b": {
+ "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
+ }
+ },
+ "d7685e5180544cccb0510f7fb7a55df6": {
+ "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": ""
+ }
+ },
+ "567f7218c19e423094943bcc1e2d949b": {
+ "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_1dacb2bd8efe494b9af0f14bd00de103",
+ "IPY_MODEL_3da95a498ce5481ebf6cdee3845556e3",
+ "IPY_MODEL_effd51f491da420dbd2189b71ec45bc2"
+ ],
+ "layout": "IPY_MODEL_e80a18da678c4a2b966a5916f59973c7"
+ }
+ },
+ "1dacb2bd8efe494b9af0f14bd00de103": {
+ "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_5869689db6bc478e9e1fc882f4940395",
+ "placeholder": "",
+ "style": "IPY_MODEL_b884bf53904d4decaeb82b13d750222f",
+ "value": ""
+ }
+ },
+ "3da95a498ce5481ebf6cdee3845556e3": {
+ "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_6a09cd03963c49118c7b3b09069affcf",
+ "max": 1,
+ "min": 0,
+ "orientation": "horizontal",
+ "style": "IPY_MODEL_9d97118639af417398ec047fce465ad4",
+ "value": 0
+ }
+ },
+ "effd51f491da420dbd2189b71ec45bc2": {
+ "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_5fce92dd68734554a72770c5956e20ac",
+ "placeholder": "",
+ "style": "IPY_MODEL_1dede12557ae4d08be0d02f626793f9b",
+ "value": " 0/0 [00:00<?, ?it/s]"
+ }
+ },
+ "e80a18da678c4a2b966a5916f59973c7": {
+ "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
+ }
+ },
+ "5869689db6bc478e9e1fc882f4940395": {
+ "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
+ }
+ },
+ "b884bf53904d4decaeb82b13d750222f": {
+ "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": ""
+ }
+ },
+ "6a09cd03963c49118c7b3b09069affcf": {
+ "model_module": "@jupyter-widgets/base",
+ "model_name": "LayoutModel",
+ "model_module_version": "1.2.0",
+ "state": {
+ "_model_module": "@jupyter-widgets/base",
+ "_model_module_version": "1.2.0",
+ "_model_name": "LayoutModel",
+ "_view_count": null,
+ "_view_module": "@jupyter-widgets/base",
+ "_view_module_version": "1.2.0",
+ "_view_name": "LayoutView",
+ "align_content": null,
+ "align_items": null,
+ "align_self": null,
+ "border": null,
+ "bottom": null,
+ "display": null,
+ "flex": null,
+ "flex_flow": null,
+ "grid_area": null,
+ "grid_auto_columns": null,
+ "grid_auto_flow": null,
+ "grid_auto_rows": null,
+ "grid_column": null,
+ "grid_gap": null,
+ "grid_row": null,
+ "grid_template_areas": null,
+ "grid_template_columns": null,
+ "grid_template_rows": null,
+ "height": null,
+ "justify_content": null,
+ "justify_items": null,
+ "left": null,
+ "margin": null,
+ "max_height": null,
+ "max_width": null,
+ "min_height": null,
+ "min_width": null,
+ "object_fit": null,
+ "object_position": null,
+ "order": null,
+ "overflow": null,
+ "overflow_x": null,
+ "overflow_y": null,
+ "padding": null,
+ "right": null,
+ "top": null,
+ "visibility": null,
+ "width": "20px"
+ }
+ },
+ "9d97118639af417398ec047fce465ad4": {
+ "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": ""
+ }
+ },
+ "5fce92dd68734554a72770c5956e20ac": {
+ "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
+ }
+ },
+ "1dede12557ae4d08be0d02f626793f9b": {
+ "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": ""
+ }
+ },
+ "977698fe79d7438da30291edc33f1fcd": {
+ "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_01a9180d588a40d8aec90d04f706b396",
+ "IPY_MODEL_a53a3834d6e44bf182f4445ddf58b891",
+ "IPY_MODEL_2999b53117744ea596ac33bd6c2f5369"
+ ],
+ "layout": "IPY_MODEL_f355ec466eb14e648cd7c83069fb4728"
+ }
+ },
+ "01a9180d588a40d8aec90d04f706b396": {
+ "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_48cb79b41ca84241aecfc31e7aedef01",
+ "placeholder": "",
+ "style": "IPY_MODEL_3fb54fb6e23a49cb94e71626cc8d210b",
+ "value": "Downloading (…)lve/main/config.json: 100%"
+ }
+ },
+ "a53a3834d6e44bf182f4445ddf58b891": {
+ "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_50fa00bf7fe04a71b5b65fe4e633663e",
+ "max": 385,
+ "min": 0,
+ "orientation": "horizontal",
+ "style": "IPY_MODEL_583c48826b6e470abccfbaa2f0f7277b",
+ "value": 385
+ }
+ },
+ "2999b53117744ea596ac33bd6c2f5369": {
+ "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_502c43bb126e40d597f08b531ec0d8b5",
+ "placeholder": "",
+ "style": "IPY_MODEL_58c105a5cece403fa753051a32bfa680",
+ "value": " 385/385 [00:00<00:00, 7.22kB/s]"
+ }
+ },
+ "f355ec466eb14e648cd7c83069fb4728": {
+ "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
+ }
+ },
+ "48cb79b41ca84241aecfc31e7aedef01": {
+ "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
+ }
+ },
+ "3fb54fb6e23a49cb94e71626cc8d210b": {
+ "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": ""
+ }
+ },
+ "50fa00bf7fe04a71b5b65fe4e633663e": {
+ "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
+ }
+ },
+ "583c48826b6e470abccfbaa2f0f7277b": {
+ "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": ""
+ }
+ },
+ "502c43bb126e40d597f08b531ec0d8b5": {
+ "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
+ }
+ },
+ "58c105a5cece403fa753051a32bfa680": {
+ "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": ""
+ }
+ },
+ "bcb369cde62c4b57850166e739f70cb4": {
+ "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_6a103517d1154760a574493bf45037a3",
+ "IPY_MODEL_1991167f95644ca3afd5a0fee31e6c9f",
+ "IPY_MODEL_165098b5aaf64e378eea9620dcf8c80e"
+ ],
+ "layout": "IPY_MODEL_27d672359bb5483a826f671b65c28d23"
+ }
+ },
+ "6a103517d1154760a574493bf45037a3": {
+ "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_563c7194bb884b52a35d3e60080fca59",
+ "placeholder": "",
+ "style": "IPY_MODEL_d48f091a22d844af8eb4d41093722c7f",
+ "value": "Downloading pytorch_model.bin: 100%"
+ }
+ },
+ "1991167f95644ca3afd5a0fee31e6c9f": {
+ "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_183c0ab8e9f94e16999501a95e2e0430",
+ "max": 440474434,
+ "min": 0,
+ "orientation": "horizontal",
+ "style": "IPY_MODEL_d01b5d6098b649a692920f300c968c4f",
+ "value": 440474434
+ }
+ },
+ "165098b5aaf64e378eea9620dcf8c80e": {
+ "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_f4ebab0dfb4c48f987a91359e139f272",
+ "placeholder": "",
+ "style": "IPY_MODEL_1e297107c9374160970da511c195be59",
+ "value": " 440M/440M [00:04<00:00, 110MB/s]"
+ }
+ },
+ "27d672359bb5483a826f671b65c28d23": {
+ "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
+ }
+ },
+ "563c7194bb884b52a35d3e60080fca59": {
+ "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
+ }
+ },
+ "d48f091a22d844af8eb4d41093722c7f": {
+ "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": ""
+ }
+ },
+ "183c0ab8e9f94e16999501a95e2e0430": {
+ "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
+ }
+ },
+ "d01b5d6098b649a692920f300c968c4f": {
+ "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": ""
+ }
+ },
+ "f4ebab0dfb4c48f987a91359e139f272": {
+ "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
+ }
+ },
+ "1e297107c9374160970da511c195be59": {
+ "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": ""
+ }
+ },
+ "04c1bccf173248f8833c48cac89a9da1": {
+ "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_4982661c09844b7294563e375e850c14",
+ "IPY_MODEL_67c8c149a6e544879e797161baf89d95",
+ "IPY_MODEL_fd6accc637f447a4875a696912c3cae2"
+ ],
+ "layout": "IPY_MODEL_239c9bc740f54fad88ab04e24b70ac7e"
+ }
+ },
+ "4982661c09844b7294563e375e850c14": {
+ "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_dc1655a283ba40c5b041514549b0dfe5",
+ "placeholder": "",
+ "style": "IPY_MODEL_b6e29f8c6a684d72b5a3064b124bef0a",
+ "value": "Downloading (…)okenizer_config.json: 100%"
+ }
+ },
+ "67c8c149a6e544879e797161baf89d95": {
+ "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_f20dcdc727de45f8903b13dda22660a6",
+ "max": 28,
+ "min": 0,
+ "orientation": "horizontal",
+ "style": "IPY_MODEL_8c01911ecb8b4afea7c6f29c4b5b0461",
+ "value": 28
+ }
+ },
+ "fd6accc637f447a4875a696912c3cae2": {
+ "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_fa8a049155f94db38e757daed40deb82",
+ "placeholder": "",
+ "style": "IPY_MODEL_476d555e6f584616b051ff70611e4384",
+ "value": " 28.0/28.0 [00:00<00:00, 504B/s]"
+ }
+ },
+ "239c9bc740f54fad88ab04e24b70ac7e": {
+ "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
+ }
+ },
+ "dc1655a283ba40c5b041514549b0dfe5": {
+ "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
+ }
+ },
+ "b6e29f8c6a684d72b5a3064b124bef0a": {
+ "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": ""
+ }
+ },
+ "f20dcdc727de45f8903b13dda22660a6": {
+ "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
+ }
+ },
+ "8c01911ecb8b4afea7c6f29c4b5b0461": {
+ "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": ""
+ }
+ },
+ "fa8a049155f94db38e757daed40deb82": {
+ "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
+ }
+ },
+ "476d555e6f584616b051ff70611e4384": {
+ "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": ""
+ }
+ },
+ "60eef94bc2cc4688ab13305ad1a1908d": {
+ "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_8763bcae7a424f21b926581f4cfc3f79",
+ "IPY_MODEL_1a840b729f764907a9e3eb4bc3c1c2c9",
+ "IPY_MODEL_abba5e7c32fd44a6b872690c897e9725"
+ ],
+ "layout": "IPY_MODEL_48eb304451c64f2db0e565ffd2b1d218"
+ }
+ },
+ "8763bcae7a424f21b926581f4cfc3f79": {
+ "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_2e726f67f1bb4e97acd689615c97c09d",
+ "placeholder": "",
+ "style": "IPY_MODEL_44310507110c4492a68f38313ee95058",
+ "value": "Downloading (…)solve/main/vocab.txt: 100%"
+ }
+ },
+ "1a840b729f764907a9e3eb4bc3c1c2c9": {
+ "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_4ef47128a9564e5fb88adba8c31a32ce",
+ "max": 225062,
+ "min": 0,
+ "orientation": "horizontal",
+ "style": "IPY_MODEL_6765c01450054686a94a47e24ce1d1ae",
+ "value": 225062
+ }
+ },
+ "abba5e7c32fd44a6b872690c897e9725": {
+ "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_728d7d32d78040408b839f245e7ec9ce",
+ "placeholder": "",
+ "style": "IPY_MODEL_bc572326b7544adca040359d77dfdba9",
+ "value": " 225k/225k [00:00<00:00, 2.29MB/s]"
+ }
+ },
+ "48eb304451c64f2db0e565ffd2b1d218": {
+ "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
+ }
+ },
+ "2e726f67f1bb4e97acd689615c97c09d": {
+ "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
+ }
+ },
+ "44310507110c4492a68f38313ee95058": {
+ "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": ""
+ }
+ },
+ "4ef47128a9564e5fb88adba8c31a32ce": {
+ "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
+ }
+ },
+ "6765c01450054686a94a47e24ce1d1ae": {
+ "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": ""
+ }
+ },
+ "728d7d32d78040408b839f245e7ec9ce": {
+ "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
+ }
+ },
+ "bc572326b7544adca040359d77dfdba9": {
+ "model_module": "@jupyter-widgets/controls",
+ "model_name": "DescriptionStyleModel",
+ "model_module_version": "1.5.0",
+ "state": {
+ "_model_module": "@jupyter-widgets/controls",
+ "_model_module_version": "1.5.0",
+ "_model_name": "DescriptionStyleModel",
+ "_view_count": null,
+ "_view_module": "@jupyter-widgets/base",
+ "_view_module_version": "1.2.0",
+ "_view_name": "StyleView",
+ "description_width": ""
+ }
+ }
+ }
+ }
+ },
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "source": [
+ "### Clone BiomedCLIP repo\n",
+ "\n",
+ "Will be merged to the open_clip main later"
+ ],
+ "metadata": {
+ "id": "e4ymt2jdGuPx"
+ }
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "J4N1Au3wz10u",
+ "outputId": "bb6ddaa6-3733-43f2-9d4f-9f8f003a1a62"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "fatal: destination path 'open_clip' already exists and is not an empty directory.\n"
+ ]
+ }
+ ],
+ "source": [
+ "!git clone -b naotous/biomed_clip_224px https://github.com/usuyama/open_clip.git"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "### Install libraries\n",
+ "**Make sure to restart the Colab runtime after installation**\n",
+ "\n",
+ "Colab Menu -> Runtime -> Restart runtime"
+ ],
+ "metadata": {
+ "id": "t8BYG2CFF6wD"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "!pip install -e ./open_clip transformers"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "nUAkSVJ90DQs",
+ "outputId": "f0196a2a-a631-46b9-f52c-0c2032af7c6f"
+ },
+ "execution_count": 2,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
+ "Obtaining file:///content/open_clip\n",
+ " Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
+ "Requirement already satisfied: transformers in /usr/local/lib/python3.9/dist-packages (4.27.4)\n",
+ "Requirement already satisfied: requests in /usr/local/lib/python3.9/dist-packages (from transformers) (2.27.1)\n",
+ "Requirement already satisfied: huggingface-hub<1.0,>=0.11.0 in /usr/local/lib/python3.9/dist-packages (from transformers) (0.13.4)\n",
+ "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.9/dist-packages (from transformers) (1.22.4)\n",
+ "Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.9/dist-packages (from transformers) (4.65.0)\n",
+ "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.9/dist-packages (from transformers) (23.0)\n",
+ "Requirement already satisfied: filelock in /usr/local/lib/python3.9/dist-packages (from transformers) (3.10.7)\n",
+ "Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.9/dist-packages (from transformers) (2022.10.31)\n",
+ "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.9/dist-packages (from transformers) (6.0)\n",
+ "Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in /usr/local/lib/python3.9/dist-packages (from transformers) (0.13.3)\n",
+ "Requirement already satisfied: torch>=1.9.0 in /usr/local/lib/python3.9/dist-packages (from open-clip-torch==2.16.0) (2.0.0+cu118)\n",
+ "Requirement already satisfied: torchvision in /usr/local/lib/python3.9/dist-packages (from open-clip-torch==2.16.0) (0.15.1+cu118)\n",
+ "Requirement already satisfied: ftfy in /usr/local/lib/python3.9/dist-packages (from open-clip-torch==2.16.0) (6.1.1)\n",
+ "Requirement already satisfied: sentencepiece in /usr/local/lib/python3.9/dist-packages (from open-clip-torch==2.16.0) (0.1.97)\n",
+ "Requirement already satisfied: protobuf<4 in /usr/local/lib/python3.9/dist-packages (from open-clip-torch==2.16.0) (3.20.3)\n",
+ "Requirement already satisfied: timm in /usr/local/lib/python3.9/dist-packages (from open-clip-torch==2.16.0) (0.6.13)\n",
+ "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.9/dist-packages (from huggingface-hub<1.0,>=0.11.0->transformers) (4.5.0)\n",
+ "Requirement already satisfied: jinja2 in /usr/local/lib/python3.9/dist-packages (from torch>=1.9.0->open-clip-torch==2.16.0) (3.1.2)\n",
+ "Requirement already satisfied: networkx in /usr/local/lib/python3.9/dist-packages (from torch>=1.9.0->open-clip-torch==2.16.0) (3.0)\n",
+ "Requirement already satisfied: sympy in /usr/local/lib/python3.9/dist-packages (from torch>=1.9.0->open-clip-torch==2.16.0) (1.11.1)\n",
+ "Requirement already satisfied: triton==2.0.0 in /usr/local/lib/python3.9/dist-packages (from torch>=1.9.0->open-clip-torch==2.16.0) (2.0.0)\n",
+ "Requirement already satisfied: lit in /usr/local/lib/python3.9/dist-packages (from triton==2.0.0->torch>=1.9.0->open-clip-torch==2.16.0) (16.0.0)\n",
+ "Requirement already satisfied: cmake in /usr/local/lib/python3.9/dist-packages (from triton==2.0.0->torch>=1.9.0->open-clip-torch==2.16.0) (3.25.2)\n",
+ "Requirement already satisfied: wcwidth>=0.2.5 in /usr/local/lib/python3.9/dist-packages (from ftfy->open-clip-torch==2.16.0) (0.2.6)\n",
+ "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests->transformers) (1.26.15)\n",
+ "Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.9/dist-packages (from requests->transformers) (2.0.12)\n",
+ "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests->transformers) (2022.12.7)\n",
+ "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests->transformers) (3.4)\n",
+ "Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in /usr/local/lib/python3.9/dist-packages (from torchvision->open-clip-torch==2.16.0) (8.4.0)\n",
+ "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.9/dist-packages (from jinja2->torch>=1.9.0->open-clip-torch==2.16.0) (2.1.2)\n",
+ "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.9/dist-packages (from sympy->torch>=1.9.0->open-clip-torch==2.16.0) (1.3.0)\n",
+ "Installing collected packages: open-clip-torch\n",
+ " Attempting uninstall: open-clip-torch\n",
+ " Found existing installation: open-clip-torch 2.16.0\n",
+ " Can't uninstall 'open-clip-torch'. No files were found to uninstall.\n",
+ " Running setup.py develop for open-clip-torch\n",
+ "Successfully installed open-clip-torch-2.16.0\n"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "### Download the model checkpoint and example images"
+ ],
+ "metadata": {
+ "id": "G4FRMeHQHW3c"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "from huggingface_hub import snapshot_download\n",
+ "snapshot_download(\"microsoft/BiomedCLIP-PubMedBERT_256-vit_base_patch16_224\", local_dir=\"biomed-clip-share\")"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 67,
+ "referenced_widgets": [
+ "dd364294fe024a3faff862df014abdcd",
+ "eca221cae70445409181610afdef0e5f",
+ "c43dae56ac244d4a9d97b39cf9d2c239",
+ "4d234f8b73394113af464b91cbc78dbe",
+ "56c3e17b6cdc46f888ea61128435a326",
+ "21d52e2249eb495ebd0a52c954e8da00",
+ "47df4590b09b4982bb189b705a10c388",
+ "2ec4c1279d23484dbc5349e52bad13cc",
+ "81f57d4f33d74947b78b3361ded13e60",
+ "47839e629e6f4b078f0469351b86467b",
+ "d7685e5180544cccb0510f7fb7a55df6"
+ ]
+ },
+ "id": "ScBC4GSiP1ya",
+ "outputId": "70fc6620-4c67-4f39-cb0b-0d8266fb8c7e"
+ },
+ "execution_count": 3,
+ "outputs": [
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/plain": [
+ "Fetching 15 files: 0%| | 0/15 [00:00, ?it/s]"
+ ],
+ "application/vnd.jupyter.widget-view+json": {
+ "version_major": 2,
+ "version_minor": 0,
+ "model_id": "dd364294fe024a3faff862df014abdcd"
+ }
+ },
+ "metadata": {}
+ },
+ {
+ "output_type": "execute_result",
+ "data": {
+ "text/plain": [
+ "'/content/biomed-clip-share'"
+ ],
+ "application/vnd.google.colaboratory.intrinsic+json": {
+ "type": "string"
+ }
+ },
+ "metadata": {},
+ "execution_count": 3
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "!ls biomed-clip-share"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "4WOxBdKr0e_m",
+ "outputId": "8decdbf2-fb53-40c4-c5f4-22d1cc4f224c"
+ },
+ "execution_count": 4,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "biomed_clip_example_20230323.ipynb example_data models\n",
+ "biomed-vlp-eval.svg\t\t LICENSE.md\t README.md\n"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "### Load BiomedCLIP model"
+ ],
+ "metadata": {
+ "id": "ZQ7D3zXKGcaM"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "import glob\n",
+ "from collections import OrderedDict\n",
+ "\n",
+ "import torch\n",
+ "from PIL import Image\n",
+ "import open_clip\n",
+ "\n",
+ "# Timm contiual pretraining\n",
+ "model_name = 'PubMedBERT_256-timm-vit_base_patch16_224'\n",
+ "checkpoint = 'biomed-clip-share/models/2022_11_08-07_39_28-model_timm-vit_base_patch16_224-lr_0.0005-b_1024-j_8-p_amp/checkpoints/epoch_32.pt'\n",
+ "\n",
+ "model, transform_train, transform_val = open_clip.create_model_and_transforms(model_name)\n",
+ "checkpoint = torch.load(checkpoint, map_location=\"cpu\")\n",
+ "\n",
+ "tokenizer = open_clip.get_tokenizer(model_name)\n",
+ "context_length = 256\n",
+ "\n",
+ "new_state_dict = OrderedDict()\n",
+ "for k,v in checkpoint['state_dict'].items():\n",
+ " new_k = k.replace('module.', '')\n",
+ " new_state_dict[new_k] = v\n",
+ "model.load_state_dict(new_state_dict, strict=False) # can set this to be true except for timm models"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 286,
+ "referenced_widgets": [
+ "567f7218c19e423094943bcc1e2d949b",
+ "1dacb2bd8efe494b9af0f14bd00de103",
+ "3da95a498ce5481ebf6cdee3845556e3",
+ "effd51f491da420dbd2189b71ec45bc2",
+ "e80a18da678c4a2b966a5916f59973c7",
+ "5869689db6bc478e9e1fc882f4940395",
+ "b884bf53904d4decaeb82b13d750222f",
+ "6a09cd03963c49118c7b3b09069affcf",
+ "9d97118639af417398ec047fce465ad4",
+ "5fce92dd68734554a72770c5956e20ac",
+ "1dede12557ae4d08be0d02f626793f9b",
+ "977698fe79d7438da30291edc33f1fcd",
+ "01a9180d588a40d8aec90d04f706b396",
+ "a53a3834d6e44bf182f4445ddf58b891",
+ "2999b53117744ea596ac33bd6c2f5369",
+ "f355ec466eb14e648cd7c83069fb4728",
+ "48cb79b41ca84241aecfc31e7aedef01",
+ "3fb54fb6e23a49cb94e71626cc8d210b",
+ "50fa00bf7fe04a71b5b65fe4e633663e",
+ "583c48826b6e470abccfbaa2f0f7277b",
+ "502c43bb126e40d597f08b531ec0d8b5",
+ "58c105a5cece403fa753051a32bfa680",
+ "bcb369cde62c4b57850166e739f70cb4",
+ "6a103517d1154760a574493bf45037a3",
+ "1991167f95644ca3afd5a0fee31e6c9f",
+ "165098b5aaf64e378eea9620dcf8c80e",
+ "27d672359bb5483a826f671b65c28d23",
+ "563c7194bb884b52a35d3e60080fca59",
+ "d48f091a22d844af8eb4d41093722c7f",
+ "183c0ab8e9f94e16999501a95e2e0430",
+ "d01b5d6098b649a692920f300c968c4f",
+ "f4ebab0dfb4c48f987a91359e139f272",
+ "1e297107c9374160970da511c195be59",
+ "04c1bccf173248f8833c48cac89a9da1",
+ "4982661c09844b7294563e375e850c14",
+ "67c8c149a6e544879e797161baf89d95",
+ "fd6accc637f447a4875a696912c3cae2",
+ "239c9bc740f54fad88ab04e24b70ac7e",
+ "dc1655a283ba40c5b041514549b0dfe5",
+ "b6e29f8c6a684d72b5a3064b124bef0a",
+ "f20dcdc727de45f8903b13dda22660a6",
+ "8c01911ecb8b4afea7c6f29c4b5b0461",
+ "fa8a049155f94db38e757daed40deb82",
+ "476d555e6f584616b051ff70611e4384",
+ "60eef94bc2cc4688ab13305ad1a1908d",
+ "8763bcae7a424f21b926581f4cfc3f79",
+ "1a840b729f764907a9e3eb4bc3c1c2c9",
+ "abba5e7c32fd44a6b872690c897e9725",
+ "48eb304451c64f2db0e565ffd2b1d218",
+ "2e726f67f1bb4e97acd689615c97c09d",
+ "44310507110c4492a68f38313ee95058",
+ "4ef47128a9564e5fb88adba8c31a32ce",
+ "6765c01450054686a94a47e24ce1d1ae",
+ "728d7d32d78040408b839f245e7ec9ce",
+ "bc572326b7544adca040359d77dfdba9"
+ ]
+ },
+ "id": "v88W1wY01oxB",
+ "outputId": "14fce3aa-60bf-485d-98dd-0bd33933ce1d"
+ },
+ "execution_count": 5,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "The cache for model files in Transformers v4.22.0 has been updated. Migrating your old cache. This is a one-time only operation. You can interrupt this and resume the migration later on by calling `transformers.utils.move_cache()`.\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/plain": [
+ "0it [00:00, ?it/s]"
+ ],
+ "application/vnd.jupyter.widget-view+json": {
+ "version_major": 2,
+ "version_minor": 0,
+ "model_id": "567f7218c19e423094943bcc1e2d949b"
+ }
+ },
+ "metadata": {}
+ },
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/plain": [
+ "Downloading (…)lve/main/config.json: 0%| | 0.00/385 [00:00, ?B/s]"
+ ],
+ "application/vnd.jupyter.widget-view+json": {
+ "version_major": 2,
+ "version_minor": 0,
+ "model_id": "977698fe79d7438da30291edc33f1fcd"
+ }
+ },
+ "metadata": {}
+ },
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/plain": [
+ "Downloading pytorch_model.bin: 0%| | 0.00/440M [00:00, ?B/s]"
+ ],
+ "application/vnd.jupyter.widget-view+json": {
+ "version_major": 2,
+ "version_minor": 0,
+ "model_id": "bcb369cde62c4b57850166e739f70cb4"
+ }
+ },
+ "metadata": {}
+ },
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "Some weights of the model checkpoint at microsoft/BiomedNLP-PubMedBERT-base-uncased-abstract were not used when initializing BertModel: ['cls.seq_relationship.weight', 'cls.predictions.decoder.weight', 'cls.seq_relationship.bias', 'cls.predictions.transform.dense.bias', 'cls.predictions.transform.dense.weight', 'cls.predictions.bias', 'cls.predictions.transform.LayerNorm.weight', 'cls.predictions.transform.LayerNorm.bias', 'cls.predictions.decoder.bias']\n",
+ "- This IS expected if you are initializing BertModel from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n",
+ "- This IS NOT expected if you are initializing BertModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n"
+ ]
+ },
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/plain": [
+ "Downloading (…)okenizer_config.json: 0%| | 0.00/28.0 [00:00, ?B/s]"
+ ],
+ "application/vnd.jupyter.widget-view+json": {
+ "version_major": 2,
+ "version_minor": 0,
+ "model_id": "04c1bccf173248f8833c48cac89a9da1"
+ }
+ },
+ "metadata": {}
+ },
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/plain": [
+ "Downloading (…)solve/main/vocab.txt: 0%| | 0.00/225k [00:00, ?B/s]"
+ ],
+ "application/vnd.jupyter.widget-view+json": {
+ "version_major": 2,
+ "version_minor": 0,
+ "model_id": "60eef94bc2cc4688ab13305ad1a1908d"
+ }
+ },
+ "metadata": {}
+ },
+ {
+ "output_type": "execute_result",
+ "data": {
+ "text/plain": [
+ "_IncompatibleKeys(missing_keys=['text.transformer.pooler.dense.weight', 'text.transformer.pooler.dense.bias'], unexpected_keys=[])"
+ ]
+ },
+ "metadata": {},
+ "execution_count": 5
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "### Example: Zero-shot classifications"
+ ],
+ "metadata": {
+ "id": "_11A5zFuGfkG"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "dataset_path = 'biomed-clip-share/example_data/biomed_image_classification_example_data'\n",
+ "template = 'this is a photo of '\n",
+ "labels = [\n",
+ " 'adenocarcinoma histopathology',\n",
+ " 'brain MRI',\n",
+ " 'covid line chart',\n",
+ " 'squamous cell carcinoma histopathology',\n",
+ " 'immunohistochemistry histopathology',\n",
+ " 'bone X-ray',\n",
+ " 'chest X-ray',\n",
+ " 'pie chart',\n",
+ " 'hematoxylin and eosin histopathology'\n",
+ "]\n",
+ "\n",
+ "import glob\n",
+ "test_imgs = glob.glob(dataset_path + '/*')\n",
+ "\n",
+ "device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')\n",
+ "model.to(device)\n",
+ "model.eval()\n",
+ "\n",
+ "images = torch.stack([transform_val(Image.open(img)) for img in test_imgs]).to(device)\n",
+ "texts = tokenizer([template + l for l in labels], context_length=context_length).to(device)\n",
+ "with torch.no_grad():\n",
+ " image_features, text_features, logit_scale = model(images, texts)\n",
+ "\n",
+ " logits = (logit_scale * image_features @ text_features.t()).detach().softmax(dim=-1)\n",
+ " sorted_indices = torch.argsort(logits, dim=-1, descending=True)\n",
+ "\n",
+ " logits = logits.cpu().numpy()\n",
+ " sorted_indices = sorted_indices.cpu().numpy()\n",
+ "\n",
+ "top_k = -1\n",
+ "\n",
+ "for i, img in enumerate(test_imgs):\n",
+ " pred = labels[sorted_indices[i][0]]\n",
+ "\n",
+ " top_k = len(labels) if top_k == -1 else top_k\n",
+ " print(img.split('/')[-1] + ':')\n",
+ " for j in range(top_k):\n",
+ " jth_index = sorted_indices[i][j]\n",
+ " print(f'{labels[jth_index]}: {logits[i][jth_index]}')\n",
+ " print('\\n')"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "XSJw7Qpm1w-f",
+ "outputId": "c2998da1-d12e-4d9c-8aa0-a730f9191eb1"
+ },
+ "execution_count": 6,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "chest_X-ray.jpg:\n",
+ "chest X-ray: 0.9998347759246826\n",
+ "hematoxylin and eosin histopathology: 0.00012055984552716836\n",
+ "bone X-ray: 4.112849273951724e-05\n",
+ "immunohistochemistry histopathology: 1.048634430844686e-06\n",
+ "adenocarcinoma histopathology: 9.666315463618957e-07\n",
+ "covid line chart: 9.508923426437832e-07\n",
+ "brain MRI: 3.2323802656719636e-07\n",
+ "squamous cell carcinoma histopathology: 2.533681140448607e-07\n",
+ "pie chart: 3.698396922047209e-09\n",
+ "\n",
+ "\n",
+ "IHC_histopathology.jpg:\n",
+ "immunohistochemistry histopathology: 0.9465932250022888\n",
+ "hematoxylin and eosin histopathology: 0.032324664294719696\n",
+ "brain MRI: 0.020657304674386978\n",
+ "adenocarcinoma histopathology: 0.0003047357895411551\n",
+ "bone X-ray: 4.5735243475064635e-05\n",
+ "squamous cell carcinoma histopathology: 3.150888369418681e-05\n",
+ "covid line chart: 2.0559631593641825e-05\n",
+ "chest X-ray: 1.271547625947278e-05\n",
+ "pie chart: 9.552859410177916e-06\n",
+ "\n",
+ "\n",
+ "covid_line_chart.png:\n",
+ "covid line chart: 0.9493206143379211\n",
+ "adenocarcinoma histopathology: 0.018982239067554474\n",
+ "squamous cell carcinoma histopathology: 0.017550276592373848\n",
+ "immunohistochemistry histopathology: 0.0067917839623987675\n",
+ "hematoxylin and eosin histopathology: 0.0034173389431089163\n",
+ "brain MRI: 0.0026299129240214825\n",
+ "chest X-ray: 0.001004116260446608\n",
+ "bone X-ray: 0.00024685877724550664\n",
+ "pie chart: 5.681261609424837e-05\n",
+ "\n",
+ "\n",
+ "bone_X-ray.jpg:\n",
+ "bone X-ray: 0.9037957191467285\n",
+ "hematoxylin and eosin histopathology: 0.07279353588819504\n",
+ "brain MRI: 0.01353507675230503\n",
+ "chest X-ray: 0.008212101645767689\n",
+ "immunohistochemistry histopathology: 0.001647883327677846\n",
+ "squamous cell carcinoma histopathology: 1.4188161912898067e-05\n",
+ "covid line chart: 1.1351595503583667e-06\n",
+ "adenocarcinoma histopathology: 2.3802178361620463e-07\n",
+ "pie chart: 9.43324423019476e-08\n",
+ "\n",
+ "\n",
+ "H_and_E_histopathology.jpg:\n",
+ "hematoxylin and eosin histopathology: 0.7953248620033264\n",
+ "immunohistochemistry histopathology: 0.19780027866363525\n",
+ "chest X-ray: 0.005973882507532835\n",
+ "bone X-ray: 0.0008049227762967348\n",
+ "adenocarcinoma histopathology: 9.133952698903158e-05\n",
+ "squamous cell carcinoma histopathology: 3.642378715085215e-06\n",
+ "brain MRI: 6.688669031973404e-07\n",
+ "pie chart: 4.2787809206856764e-07\n",
+ "covid line chart: 3.051618335803141e-08\n",
+ "\n",
+ "\n",
+ "brain_MRI.jpg:\n",
+ "brain MRI: 0.9565798044204712\n",
+ "hematoxylin and eosin histopathology: 0.041418008506298065\n",
+ "immunohistochemistry histopathology: 0.0019450504332780838\n",
+ "pie chart: 2.7151156245963648e-05\n",
+ "squamous cell carcinoma histopathology: 1.0223747267446015e-05\n",
+ "bone X-ray: 8.662519576319028e-06\n",
+ "chest X-ray: 7.967662895680405e-06\n",
+ "adenocarcinoma histopathology: 2.769203774732887e-06\n",
+ "covid line chart: 3.420072687276843e-07\n",
+ "\n",
+ "\n",
+ "squamous_cell_carcinoma_histopathology.jpeg:\n",
+ "squamous cell carcinoma histopathology: 0.946948766708374\n",
+ "adenocarcinoma histopathology: 0.05259053036570549\n",
+ "hematoxylin and eosin histopathology: 0.0003988392127212137\n",
+ "immunohistochemistry histopathology: 6.187905091792345e-05\n",
+ "chest X-ray: 1.4099564182856739e-08\n",
+ "pie chart: 3.522493408070204e-10\n",
+ "bone X-ray: 2.9633698273023867e-10\n",
+ "brain MRI: 1.2720474673599824e-10\n",
+ "covid line chart: 1.8425671145100297e-12\n",
+ "\n",
+ "\n",
+ "adenocarcinoma_histopathology.jpg:\n",
+ "adenocarcinoma histopathology: 0.7818866968154907\n",
+ "hematoxylin and eosin histopathology: 0.1551772654056549\n",
+ "immunohistochemistry histopathology: 0.061494577676057816\n",
+ "squamous cell carcinoma histopathology: 0.001418206375092268\n",
+ "chest X-ray: 2.017212136706803e-05\n",
+ "brain MRI: 1.2181552619949798e-06\n",
+ "pie chart: 7.932691801215697e-07\n",
+ "bone X-ray: 7.436469786625821e-07\n",
+ "covid line chart: 4.4826077783000073e-07\n",
+ "\n",
+ "\n",
+ "pie_chart.png:\n",
+ "pie chart: 0.999992847442627\n",
+ "covid line chart: 6.0569645938812755e-06\n",
+ "brain MRI: 6.212229095581279e-07\n",
+ "bone X-ray: 1.8702795046010579e-07\n",
+ "chest X-ray: 1.4315868668290932e-07\n",
+ "immunohistochemistry histopathology: 7.397999013392109e-08\n",
+ "hematoxylin and eosin histopathology: 1.3329846559884118e-08\n",
+ "adenocarcinoma histopathology: 7.695412307384686e-09\n",
+ "squamous cell carcinoma histopathology: 4.512859419492088e-09\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "
Expected outputs
\n",
+ "\n",
+ "\n",
+ "adenocarcinoma_histopathology.jpg:\n",
+ "adenocarcinoma histopathology: 0.7818863987922668\n",
+ "hematoxylin and eosin histopathology: 0.15517690777778625\n",
+ "immunohistochemistry histopathology: 0.06149514392018318\n",
+ "squamous cell carcinoma histopathology: 0.0014182085869833827\n",
+ "chest X-ray: 2.017213228100445e-05\n",
+ "brain MRI: 1.2181524198240368e-06\n",
+ "pie chart: 7.932688959044754e-07\n",
+ "bone X-ray: 7.436410101036017e-07\n",
+ "covid line chart: 4.482610052036762e-07\n",
+ "\n",
+ "\n",
+ "covid_line_chart.png:\n",
+ "covid line chart: 0.9493210315704346\n",
+ "adenocarcinoma histopathology: 0.01898195780813694\n",
+ "squamous cell carcinoma histopathology: 0.0175501499325037\n",
+ "immunohistochemistry histopathology: 0.006791787222027779\n",
+ "hematoxylin and eosin histopathology: 0.003417333820834756\n",
+ "brain MRI: 0.002629919210448861\n",
+ "chest X-ray: 0.0010041205678135157\n",
+ "bone X-ray: 0.00024685842799954116\n",
+ "pie chart: 5.6812208640621975e-05\n",
+ "\n",
+ "\n",
+ "bone_X-ray.jpg:\n",
+ "bone X-ray: 0.9037961959838867\n",
+ "hematoxylin and eosin histopathology: 0.07279316335916519\n",
+ "brain MRI: 0.013534954749047756\n",
+ "chest X-ray: 0.00821212213486433\n",
+ "immunohistochemistry histopathology: 0.001647887285798788\n",
+ "squamous cell carcinoma histopathology: 1.418814281350933e-05\n",
+ "covid line chart: 1.1351590956110158e-06\n",
+ "adenocarcinoma histopathology: 2.3802124360372545e-07\n",
+ "pie chart: 9.433303205241828e-08\n",
+ "\n",
+ "\n",
+ "pie_chart.png:\n",
+ "pie chart: 0.999992847442627\n",
+ "covid line chart: 6.056906840967713e-06\n",
+ "brain MRI: 6.212158041307703e-07\n",
+ "bone X-ray: 1.870277799298492e-07\n",
+ "chest X-ray: 1.4315827456812258e-07\n",
+ "immunohistochemistry histopathology: 7.397970591682679e-08\n",
+ "hematoxylin and eosin histopathology: 1.3329795045535775e-08\n",
+ "adenocarcinoma histopathology: 7.695367898463701e-09\n",
+ "squamous cell carcinoma histopathology: 4.512833662317917e-09\n",
+ "\n",
+ "\n",
+ "H_and_E_histopathology.jpg:\n",
+ "hematoxylin and eosin histopathology: 0.7953251600265503\n",
+ "immunohistochemistry histopathology: 0.19779996573925018\n",
+ "chest X-ray: 0.005973907187581062\n",
+ "bone X-ray: 0.0008049230673350394\n",
+ "adenocarcinoma histopathology: 9.133991261478513e-05\n",
+ "squamous cell carcinoma histopathology: 3.6423973597266013e-06\n",
+ "brain MRI: 6.688684948130685e-07\n",
+ "pie chart: 4.278819574210502e-07\n",
+ "covid line chart: 3.051619401617245e-08\n",
+ "\n",
+ "\n",
+ "brain_MRI.jpg:\n",
+ "brain MRI: 0.9565795660018921\n",
+ "hematoxylin and eosin histopathology: 0.041418157517910004\n",
+ "immunohistochemistry histopathology: 0.0019450499676167965\n",
+ "pie chart: 2.7151252652402036e-05\n",
+ "squamous cell carcinoma histopathology: 1.0223812751064543e-05\n",
+ "bone X-ray: 8.662499567435589e-06\n",
+ "chest X-ray: 7.96773747424595e-06\n",
+ "adenocarcinoma histopathology: 2.7692055937222904e-06\n",
+ "covid line chart: 3.420084908611898e-07\n",
+ "\n",
+ "\n",
+ "chest_X-ray.jpg:\n",
+ "chest X-ray: 0.9998347759246826\n",
+ "hematoxylin and eosin histopathology: 0.0001205605294671841\n",
+ "bone X-ray: 4.112880560569465e-05\n",
+ "immunohistochemistry histopathology: 1.0486423889233265e-06\n",
+ "adenocarcinoma histopathology: 9.66637117016944e-07\n",
+ "covid line chart: 9.508977996119938e-07\n",
+ "brain MRI: 3.232386518448038e-07\n",
+ "squamous cell carcinoma histopathology: 2.53368597213921e-07\n",
+ "pie chart: 3.6984038054299617e-09\n",
+ "\n",
+ "\n",
+ "squamous_cell_carcinoma_histopathology.jpeg:\n",
+ "squamous cell carcinoma histopathology: 0.9469489455223083\n",
+ "adenocarcinoma histopathology: 0.05259034037590027\n",
+ "hematoxylin and eosin histopathology: 0.0003988408425357193\n",
+ "immunohistochemistry histopathology: 6.187965482240543e-05\n",
+ "chest X-ray: 1.4099594380923008e-08\n",
+ "pie chart: 3.522500624519864e-10\n",
+ "bone X-ray: 2.9633814846441453e-10\n",
+ "brain MRI: 1.2720452469139332e-10\n",
+ "covid line chart: 1.8425603924565603e-12\n",
+ "\n",
+ "\n",
+ "IHC_histopathology.jpg:\n",
+ "immunohistochemistry histopathology: 0.9465934634208679\n",
+ "hematoxylin and eosin histopathology: 0.03232448548078537\n",
+ "brain MRI: 0.020657211542129517\n",
+ "adenocarcinoma histopathology: 0.000304735847748816\n",
+ "bone X-ray: 4.5735167077509686e-05\n",
+ "squamous cell carcinoma histopathology: 3.150868360535242e-05\n",
+ "covid line chart: 2.0559578842949122e-05\n",
+ "chest X-ray: 1.2715442608168814e-05\n",
+ "pie chart: 9.55282575887395e-06\n",
+ "
\n",
+ " "
+ ],
+ "metadata": {
+ "id": "kIZEaLJB5H6A"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "import matplotlib.pyplot as plt\n",
+ "\n",
+ "def plot_images_with_metadata(images, metadata):\n",
+ " num_images = len(images)\n",
+ " fig, axes = plt.subplots(nrows=num_images, ncols=1, figsize=(5, 5 * num_images))\n",
+ "\n",
+ " for i, (img_path, metadata) in enumerate(zip(images, metadata)):\n",
+ " img = Image.open(img_path)\n",
+ " ax = axes[i]\n",
+ " ax.imshow(img)\n",
+ " ax.axis('off')\n",
+ " ax.set_title(f\"{metadata['filename']}\\n{metadata['top_probs']}\", fontsize=14)\n",
+ "\n",
+ " plt.tight_layout()\n",
+ " plt.show()\n",
+ "\n",
+ "metadata_list = []\n",
+ "\n",
+ "top_k = 3\n",
+ "for i, img in enumerate(test_imgs):\n",
+ " pred = labels[sorted_indices[i][0]]\n",
+ " img_name = img.split('/')[-1]\n",
+ "\n",
+ " top_probs = []\n",
+ " top_k = len(labels) if top_k == -1 else top_k\n",
+ " for j in range(top_k):\n",
+ " jth_index = sorted_indices[i][j]\n",
+ " top_probs.append(f\"{labels[jth_index]}: {logits[i][jth_index] * 100:.1f}\")\n",
+ "\n",
+ " metadata = {'filename': img_name, 'top_probs': '\\n'.join(top_probs)}\n",
+ " metadata_list.append(metadata)\n",
+ "\n",
+ "plot_images_with_metadata(test_imgs, metadata_list)"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 1000
+ },
+ "id": "zE5vznWj2CCf",
+ "outputId": "62767ea6-9e1f-4467-b2ab-ad001842b99b"
+ },
+ "execution_count": 7,
+ "outputs": [
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/plain": [
+ "