From 04ca6fe8c434b9dad436d7be18f35c0633c1cb74 Mon Sep 17 00:00:00 2001 From: David Heryanto Date: Sat, 2 Jul 2022 01:27:01 +0800 Subject: [PATCH 1/9] Exclude Databricks from notebook env only if the runtime is below 11.0 --- src/transformers/utils/import_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/transformers/utils/import_utils.py b/src/transformers/utils/import_utils.py index 275477a4ba93f9..b16437638d6ea0 100644 --- a/src/transformers/utils/import_utils.py +++ b/src/transformers/utils/import_utils.py @@ -506,7 +506,9 @@ def is_in_notebook(): raise ImportError("console") if "VSCODE_PID" in os.environ: raise ImportError("vscode") - if "DATABRICKS_RUNTIME_VERSION" in os.environ: + if "DATABRICKS_RUNTIME_VERSION" in os.environ and os.environ["DATABRICKS_RUNTIME_VERSION"] < "11.0": + # Databricks Runtime 11.0 and above uses IPython kernel by default so it should be compatible with Jupyter notebook. + # https://docs.microsoft.com/en-us/azure/databricks/notebooks/ipython-kernel raise ImportError("databricks") return importlib.util.find_spec("IPython") is not None From e79e717be95eef98ebae2180af1b8e21c04a9fee Mon Sep 17 00:00:00 2001 From: David Heryanto Date: Sat, 2 Jul 2022 01:58:18 +0800 Subject: [PATCH 2/9] Dummy commit to trigger CI --- src/transformers/utils/import_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transformers/utils/import_utils.py b/src/transformers/utils/import_utils.py index b16437638d6ea0..31dbb536ac60ff 100644 --- a/src/transformers/utils/import_utils.py +++ b/src/transformers/utils/import_utils.py @@ -507,7 +507,7 @@ def is_in_notebook(): if "VSCODE_PID" in os.environ: raise ImportError("vscode") if "DATABRICKS_RUNTIME_VERSION" in os.environ and os.environ["DATABRICKS_RUNTIME_VERSION"] < "11.0": - # Databricks Runtime 11.0 and above uses IPython kernel by default so it should be compatible with Jupyter notebook. + # Databricks Runtime 11.0 and above uses IPython kernel by default so it should be compatible with Jupyter notebook # https://docs.microsoft.com/en-us/azure/databricks/notebooks/ipython-kernel raise ImportError("databricks") From 58b85adbcc48feee1610c1292149d7647196ead9 Mon Sep 17 00:00:00 2001 From: David Heryanto Date: Sat, 2 Jul 2022 02:20:48 +0800 Subject: [PATCH 3/9] Empty commit to trigger CI From 64e6f0e3b3ce7ac3fff8038001d656cbc5e7eb33 Mon Sep 17 00:00:00 2001 From: David Heryanto Date: Sat, 2 Jul 2022 02:31:25 +0800 Subject: [PATCH 4/9] Empty commit to trigger CI From 54c668fa038cda3e7fa589e4287f79a097154c9e Mon Sep 17 00:00:00 2001 From: David Heryanto Date: Sat, 2 Jul 2022 02:44:09 +0800 Subject: [PATCH 5/9] Empty commit to trigger CI From e2686188e3108dd201317023b0144ae5cc3b475a Mon Sep 17 00:00:00 2001 From: David Heryanto Date: Sat, 2 Jul 2022 02:44:46 +0800 Subject: [PATCH 6/9] Empty commit to trigger CI From bd10a73425ecb62c854ad216d26f843fe51e435a Mon Sep 17 00:00:00 2001 From: David Heryanto Date: Sat, 2 Jul 2022 02:49:20 +0800 Subject: [PATCH 7/9] Empty commit to trigger CI From 5b073e36815034ddd226ceb487daae48f613abba Mon Sep 17 00:00:00 2001 From: David Heryanto Date: Sat, 2 Jul 2022 03:05:18 +0800 Subject: [PATCH 8/9] Empty commit to trigger CI From 26d9f1ab9abde21ab06ace0ac2f655b976df3e3d Mon Sep 17 00:00:00 2001 From: David Heryanto Date: Sat, 2 Jul 2022 03:16:35 +0800 Subject: [PATCH 9/9] Empty commit to trigger CI