Skip to content

Commit

Permalink
Addressed PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Frost45 committed Oct 12, 2022
1 parent 68d900e commit 1b60b1b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions regression_tests/test_gector_roberta.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def predict_for_file(input_file, temp_file, model, batch_size=32):

test_data = read_lines(input_file)
predictions = []
cnt_corrections = 0
batch = []
for sent in test_data:
batch.append(sent.split())
Expand All @@ -71,15 +70,12 @@ def predict_for_file(input_file, temp_file, model, batch_size=32):
if batch:
preds, cnt = model.handle_batch(batch)
predictions.extend(preds)
cnt_corrections += cnt

result_lines = [" ".join(pred) for pred in predictions]

with open(temp_file.name, "w") as f:
f.write("\n".join(result_lines) + "\n")

return cnt_corrections


def compare_files(filename, gold_file, temp_file):
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tokenization.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from allennlp.common.testing import AllenNlpTestCase


class TokenizationTests(AllenNlpTestCase):
class TestTokenization(AllenNlpTestCase):
"""A test class that tests the GECToR custom tokenization utilities."""

def test_get_bpe_groups(self):
Expand Down

0 comments on commit 1b60b1b

Please sign in to comment.