Skip to content

Commit

Permalink
#42 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolay-r authored Jul 14, 2022
1 parent d67dccb commit 74d424b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arelight/pipelines/inference_bert.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,21 @@ def apply_core(self, input_data, pipeline_ctx):
def __iter_predict_result():
samples = BaseRowsStorage.from_tsv(samples_filepath)

used_row_ids = set()

data = {"text_a": [], "text_b": [], "row_ids": []}

for row_ind, row in samples:

# Considering unique rows only.
if row["id"] in used_row_ids:
continue

data["text_a"].append(row['text_a'])
data["text_b"].append(row['text_b'])
data["row_ids"].append(row_ind)

used_row_ids.add(row["id"])

batch_size = 10

Expand Down

0 comments on commit 74d424b

Please sign in to comment.