Skip to content

Commit

Permalink
should fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
Parry-Parry committed Nov 12, 2024
1 parent 59b572d commit ab4dd62
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions rankers/datasets/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ def __call__(self, batch) -> dict:
batch_queries = []
batch_docs = []
batch_scores = []
for (q, dx, *args) in batch:
for elt in batch:
q = elt[0]
dx = elt[1]
batch_queries.append(q)
batch_docs.extend(dx)
if len(args) == 0:
if len(elt) < 3:
continue
batch_scores.extend(args[0])
batch_scores.extend(elt[2])

tokenized_queries = self.tokenizer(
batch_queries,
Expand Down Expand Up @@ -61,12 +63,14 @@ def __call__(self, batch) -> dict:
batch_queries = []
batch_docs = []
batch_scores = []
for (q, dx, *args) in batch:
for elt in batch:
q = elt[0]
dx = elt[1]
batch_queries.extend([q]*len(dx))
batch_docs.extend(dx)
if len(args) == 0:
if len(elt) < 3:
continue
batch_scores.extend(args[0])
batch_scores.extend(elt[2])

tokenized_sequences = self.tokenizer(
batch_queries,
Expand Down

0 comments on commit ab4dd62

Please sign in to comment.