Simplify extracting entries satisfying file filter

This commit is contained in:
Debanjum Singh Solanky 2022-09-05 02:09:36 +03:00
parent 7606724dbc
commit 2890b4cd44

View file

@ -67,7 +67,7 @@ class FileFilter(BaseFilter):
# Get entries (and associated embeddings) satisfying file filters # Get entries (and associated embeddings) satisfying file filters
start = time.time() start = time.time()
entries = [entry for id, entry in enumerate(raw_entries) if id in included_entry_indices] entries = [raw_entries[id] for id in included_entry_indices]
embeddings = torch.index_select(raw_embeddings, 0, torch.tensor(list(included_entry_indices))) embeddings = torch.index_select(raw_embeddings, 0, torch.tensor(list(included_entry_indices)))
end = time.time() end = time.time()