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
9f5d5a53
"...gpu/git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "0b7699197a56cca5585ce28d8eb818164d9351ce"
Unverified
Commit
9f5d5a53
authored
Jun 09, 2020
by
Julien Plu
Committed by
GitHub
Jun 09, 2020
Browse files
Fix the __getattr__ method in BatchEncoding (#4772)
parent
41a1d27c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/transformers/tokenization_utils.py
src/transformers/tokenization_utils.py
+4
-1
No files found.
src/transformers/tokenization_utils.py
View file @
9f5d5a53
...
...
@@ -266,7 +266,10 @@ class BatchEncoding(UserDict):
)
def
__getattr__
(
self
,
item
:
str
):
try
:
return
self
.
data
[
item
]
except
KeyError
:
raise
AttributeError
def
keys
(
self
):
return
self
.
data
.
keys
()
...
...
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