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
26b6ef79
Unverified
Commit
26b6ef79
authored
Oct 12, 2021
by
Nicolas Patry
Committed by
GitHub
Oct 12, 2021
Browse files
Fixing the lecture values by making sure defaults are not changed (#13976)
384 // 4 < 128 would break `doc_stride`.
parent
58bf8825
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/pipelines/question_answering.py
src/transformers/pipelines/question_answering.py
+1
-1
No files found.
src/transformers/pipelines/question_answering.py
View file @
26b6ef79
...
@@ -253,7 +253,7 @@ class QuestionAnsweringPipeline(Pipeline):
...
@@ -253,7 +253,7 @@ class QuestionAnsweringPipeline(Pipeline):
if
max_seq_len
is
None
:
if
max_seq_len
is
None
:
max_seq_len
=
min
(
self
.
tokenizer
.
model_max_length
,
384
)
max_seq_len
=
min
(
self
.
tokenizer
.
model_max_length
,
384
)
if
doc_stride
is
None
:
if
doc_stride
is
None
:
doc_stride
=
min
(
max_seq_len
//
4
,
128
)
doc_stride
=
min
(
max_seq_len
//
2
,
128
)
if
not
self
.
tokenizer
.
is_fast
:
if
not
self
.
tokenizer
.
is_fast
:
features
=
squad_convert_examples_to_features
(
features
=
squad_convert_examples_to_features
(
...
...
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