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
fd0ef8b6
"docs/vscode:/vscode.git/clone" did not exist on "9f5fe635483c9c80d59c9523eef5cf19ed93174c"
Unverified
Commit
fd0ef8b6
authored
Jan 26, 2023
by
Nicolas Patry
Committed by
GitHub
Jan 26, 2023
Browse files
Small QoL for qa. (#21316)
parent
a01dd381
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
src/transformers/pipelines/question_answering.py
src/transformers/pipelines/question_answering.py
+3
-0
No files found.
src/transformers/pipelines/question_answering.py
View file @
fd0ef8b6
...
@@ -404,6 +404,9 @@ class QuestionAnsweringPipeline(ChunkPipeline):
...
@@ -404,6 +404,9 @@ class QuestionAnsweringPipeline(ChunkPipeline):
if
doc_stride
is
None
:
if
doc_stride
is
None
:
doc_stride
=
min
(
max_seq_len
//
2
,
128
)
doc_stride
=
min
(
max_seq_len
//
2
,
128
)
if
doc_stride
>
max_seq_len
:
raise
ValueError
(
f
"`doc_stride` (
{
doc_stride
}
) is larger than `max_seq_len` (
{
max_seq_len
}
)"
)
if
not
self
.
tokenizer
.
is_fast
:
if
not
self
.
tokenizer
.
is_fast
:
features
=
squad_convert_examples_to_features
(
features
=
squad_convert_examples_to_features
(
examples
=
[
example
],
examples
=
[
example
],
...
...
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