Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

fix TransformerQA predictor test #145

Merged
merged 1 commit into from
Oct 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions tests/rc/predictors/transformer_qa_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ def test_predict_single_instance(self):
"What is love?", "Baby don't hurt me, don't hurt me, no more."
)
span_start, span_end = prediction["best_span"]
assert 0 <= span_start <= span_end
assert (
"best_span_str" in prediction
and isinstance(prediction["best_span_str"], str)
and len(prediction["best_span_str"]) > 0
)
assert -1 <= span_start <= span_end
assert "best_span_str" in prediction and isinstance(prediction["best_span_str"], str)
if span_start > -1:
assert len(prediction["best_span_str"]) > 0

def test_predict_long_instance(self):
# We use a short context and a long context, so that the long context has to be broken into multiple
Expand Down