Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
6813439f
"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "36ddcc0d35e4ac736c7e196f40b85736d84a5c76"
Unverified
Commit
6813439f
authored
Jun 01, 2022
by
Sylvain Gugger
Committed by
GitHub
Jun 01, 2022
Browse files
Exclude Databricks from notebook env (#17496)
parent
3042ea4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
src/transformers/utils/import_utils.py
src/transformers/utils/import_utils.py
+2
-0
No files found.
src/transformers/utils/import_utils.py
View file @
6813439f
...
@@ -460,6 +460,8 @@ def is_in_notebook():
...
@@ -460,6 +460,8 @@ def is_in_notebook():
raise
ImportError
(
"console"
)
raise
ImportError
(
"console"
)
if
"VSCODE_PID"
in
os
.
environ
:
if
"VSCODE_PID"
in
os
.
environ
:
raise
ImportError
(
"vscode"
)
raise
ImportError
(
"vscode"
)
if
"DATABRICKS_RUNTIME_VERSION"
in
os
.
environ
:
raise
ImportError
(
"databricks"
)
return
importlib
.
util
.
find_spec
(
"IPython"
)
is
not
None
return
importlib
.
util
.
find_spec
(
"IPython"
)
is
not
None
except
(
AttributeError
,
ImportError
,
KeyError
):
except
(
AttributeError
,
ImportError
,
KeyError
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment