File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed
src/transformers/pipelines Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change @@ -340,7 +340,6 @@ def _sanitize_parameters(
340
340
if max_answer_len is not None :
341
341
if max_answer_len < 1 :
342
342
raise ValueError (f"max_answer_len parameter should be >= 1 (got { max_answer_len } " )
343
- if max_answer_len is not None :
344
343
postprocess_params ["max_answer_len" ] = max_answer_len
345
344
if handle_impossible_answer is not None :
346
345
postprocess_params ["handle_impossible_answer" ] = handle_impossible_answer
@@ -542,11 +541,9 @@ def postprocess(
542
541
for output in model_outputs :
543
542
if self .framework == "pt" and output ["start" ].dtype == torch .bfloat16 :
544
543
start_ = output ["start" ].to (torch .float32 )
545
- else :
546
- start_ = output ["start" ]
547
- if self .framework == "pt" and output ["start" ].dtype == torch .bfloat16 :
548
544
end_ = output ["end" ].to (torch .float32 )
549
545
else :
546
+ start_ = output ["start" ]
550
547
end_ = output ["end" ]
551
548
example = output ["example" ]
552
549
p_mask = output ["p_mask" ]
You can’t perform that action at this time.
0 commit comments