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
d72fa2a0
Commit
d72fa2a0
authored
Dec 19, 2019
by
Morgan Funtowicz
Browse files
Fix inputs_for_model call in QuestionAnsweringPipeline accessing __dict__ on list.
parent
bcc99fd9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
transformers/pipelines.py
transformers/pipelines.py
+1
-1
No files found.
transformers/pipelines.py
View file @
d72fa2a0
...
...
@@ -504,7 +504,7 @@ class QuestionAnsweringPipeline(Pipeline):
# Convert inputs to features
examples
=
self
.
_args_parser
(
*
texts
,
**
kwargs
)
features
=
squad_convert_examples_to_features
(
examples
,
self
.
tokenizer
,
kwargs
[
'max_seq_len'
],
kwargs
[
'doc_stride'
],
kwargs
[
'max_question_len'
],
False
)
fw_args
=
self
.
inputs_for_model
(
f
eatures
.
__dict__
)
fw_args
=
self
.
inputs_for_model
(
[
f
.
__dict__
for
f
in
features
]
)
# Manage tensor allocation on correct device
with
self
.
device_placement
():
...
...
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