Skip to content

Commit

Permalink
fix a bug when there is no answer
Browse files Browse the repository at this point in the history
  • Loading branch information
ymcui committed Jul 5, 2021
1 parent e786ae1 commit 937ef90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion baseline/run_cmrc2018_drcd_baseline.py
Expand Up @@ -897,7 +897,7 @@ def write_predictions(all_examples, all_features, all_results, n_best_size,
# just create a nonce prediction in this case to avoid failure.
if not nbest:
nbest.append(
_NbestPrediction(text="empty", start_logit=0.0, end_logit=0.0))
_NbestPrediction(text="empty", start_logit=0.0, end_logit=0.0, start_index=0, end_index=0))

assert len(nbest) >= 1

Expand Down

0 comments on commit 937ef90

Please sign in to comment.