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
67b37891
"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "97ec17f73bf008c2382d900f12f0fe64a0118145"
Unverified
Commit
67b37891
authored
Nov 09, 2022
by
Mario Šaško
Committed by
GitHub
Nov 09, 2022
Browse files
Make DummyObject more robust (#20146)
parent
93e14486
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/utils/import_utils.py
src/transformers/utils/import_utils.py
+2
-2
No files found.
src/transformers/utils/import_utils.py
View file @
67b37891
...
@@ -986,9 +986,9 @@ class DummyObject(type):
...
@@ -986,9 +986,9 @@ class DummyObject(type):
`requires_backend` each time a user tries to access any method of that class.
`requires_backend` each time a user tries to access any method of that class.
"""
"""
def
__getattr__
(
cls
,
key
):
def
__getattr
ibute
__
(
cls
,
key
):
if
key
.
startswith
(
"_"
):
if
key
.
startswith
(
"_"
):
return
super
().
__getattr
__
(
cls
,
key
)
return
super
().
__getattr
ibute__
(
key
)
requires_backends
(
cls
,
cls
.
_backends
)
requires_backends
(
cls
,
cls
.
_backends
)
...
...
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