Skip to content
Open
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
3 changes: 3 additions & 0 deletions msmarco-v2-vector/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import csv
import json
import os
import random
import statistics
from collections import defaultdict
from typing import Any, Dict, List
Expand Down Expand Up @@ -86,6 +87,8 @@ def __init__(self, track, params, **kwargs):
with bz2.open(os.path.join(cwd, QUERIES_FILENAME), "r") as queries_file:
for vector_query in queries_file:
self._queries.append(json.loads(vector_query))

self._queries = random.shuffle(self._queries)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it makes sense to allow a settable seed for the sake of reproducing the shuffle ordering and then printing the seed in the logs.

self._iters = 0
self._maxIters = len(self._queries)
self.infinite = True
Expand Down