Skip to content

Commit 2462cf5

Browse files
kuarorafacebook-github-bot
authored andcommitted
Adding embedding column to dataset descriptor (facebookresearch#3736)
Summary: Pull Request resolved: facebookresearch#3736 Nit - adding embedding column in dataset descriptor Nit - initializing cached_ds as part of class instead of post_init Reviewed By: satymish Differential Revision: D60858496
1 parent ac18577 commit 2462cf5

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

benchs/bench_fw/benchmark_io.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import os
1111
import pickle
1212
from dataclasses import dataclass
13-
from typing import Any, List, Optional
13+
from typing import Any, Dict, List, Optional
1414
from zipfile import ZipFile
1515

1616
import faiss # @manual=//faiss/python:pyfaiss_gpu
@@ -46,13 +46,11 @@ def merge_rcq_itq(
4646
@dataclass
4747
class BenchmarkIO:
4848
path: str
49+
cached_ds: Dict[Any, Any] = {}
4950

5051
def clone(self):
5152
return BenchmarkIO(path=self.path)
5253

53-
def __post_init__(self):
54-
self.cached_ds = {}
55-
5654
# TODO(kuarora): rename it as get_local_file
5755
def get_local_filename(self, filename):
5856
if len(filename) > 184:

benchs/bench_fw/descriptors.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ class DatasetDescriptor:
7878
# number of vectors to load from the dataset
7979
num_vectors: Optional[int] = None
8080

81+
embedding_column: Optional[str] = None
82+
8183
def __hash__(self):
8284
return hash(self.get_filename())
8385

0 commit comments

Comments
 (0)