Fixing the lecture values by making sure defaults are not changed (#13976)

384 // 4 < 128 would break `doc_stride`.
This commit is contained in:
Nicolas Patry 2021-10-12 18:18:19 +02:00 committed by GitHub
parent 58bf882579
commit 26b6ef79d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -253,7 +253,7 @@ class QuestionAnsweringPipeline(Pipeline):
if max_seq_len is None:
max_seq_len = min(self.tokenizer.model_max_length, 384)
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:
features = squad_convert_examples_to_features(