mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-03 03:31:05 +06:00
Exclude Databricks from notebook env (#17496)
This commit is contained in:
parent
3042ea4f6f
commit
6813439fdc
@ -460,6 +460,8 @@ def is_in_notebook():
|
||||
raise ImportError("console")
|
||||
if "VSCODE_PID" in os.environ:
|
||||
raise ImportError("vscode")
|
||||
if "DATABRICKS_RUNTIME_VERSION" in os.environ:
|
||||
raise ImportError("databricks")
|
||||
|
||||
return importlib.util.find_spec("IPython") is not None
|
||||
except (AttributeError, ImportError, KeyError):
|
||||
|
Loading…
Reference in New Issue
Block a user