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
8560b55b
"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "d4886173b26d772b34afe20efa029b54a0f356a0"
Unverified
Commit
8560b55b
authored
Oct 25, 2021
by
Sylvain Gugger
Committed by
GitHub
Oct 25, 2021
Browse files
Fix lazy init to stop hiding errors in import (#14124)
parent
c99a2832
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
src/transformers/file_utils.py
src/transformers/file_utils.py
+6
-1
No files found.
src/transformers/file_utils.py
View file @
8560b55b
...
...
@@ -2146,7 +2146,12 @@ class _LazyModule(ModuleType):
return
value
def
_get_module
(
self
,
module_name
:
str
):
return
importlib
.
import_module
(
"."
+
module_name
,
self
.
__name__
)
try
:
return
importlib
.
import_module
(
"."
+
module_name
,
self
.
__name__
)
except
Exception
as
e
:
raise
RuntimeError
(
f
"Failed to import
{
self
.
__name__
}
.
{
module_name
}
because of the following error (look up to see its traceback):
\n
{
e
}
"
)
from
e
def
__reduce__
(
self
):
return
(
self
.
__class__
,
(
self
.
_name
,
self
.
__file__
,
self
.
_import_structure
))
...
...
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