Unverified Commit fd0ef8b6 authored by Nicolas Patry's avatar Nicolas Patry Committed by GitHub
Browse files

Small QoL for qa. (#21316)

parent a01dd381
......@@ -404,6 +404,9 @@ class QuestionAnsweringPipeline(ChunkPipeline):
if doc_stride is None:
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:
features = squad_convert_examples_to_features(
examples=[example],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment