Add date and time to the codec file path so that the file doesn't get overridden with each run ()

Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4303

Add date and time to the codec file path so that the file doesn't get overridden with each run

Reviewed By: junjieqi

Differential Revision: D73419533

fbshipit-source-id: 289875f07c5037e40921ae3a8bfcb339bee1131c
pull/4233/merge
Satyendra Mishra 2025-04-23 06:01:49 -07:00 committed by Facebook GitHub Bot
parent a3cd63fb6a
commit c75f166e2f
1 changed files with 4 additions and 0 deletions
benchs/bench_fw

View File

@ -113,6 +113,8 @@ class DatasetDescriptor:
# desc_name
desc_name: Optional[str] = None
filename_suffix: Optional[str] = None
normalize_L2: bool = False
def __hash__(self):
@ -138,6 +140,8 @@ class DatasetDescriptor:
).replace("=", "_").replace("/", "_")
if self.num_vectors is not None:
filename += f"_{self.num_vectors}"
if self.filename_suffix is not None:
filename += f"_{self.filename_suffix}"
filename += "."
self.desc_name = filename