in src/alpaca_eval/annotators/base.py [0:0]
def _initialize_cache(self, caching_path):
if caching_path == "auto":
if isinstance(self.annotators_config, (str, Path, os.PathLike)):
stem = Path(self.annotators_config).stem
caching_path = Path(self.annotators_config).parent / f"annotations_seed{self.seed}_{stem}.json"
logging.info(f"Saving annotations to `{caching_path}`.")
else:
logging.warning("caching_path cannot be 'auto' if annotators_config is not a path. Setting to None.")
caching_path = None
elif caching_path is not None:
logging.warning("Saving_path is given but not 'auto', make sure that it's different for different seeds.")
if caching_path is not None:
self.load_(caching_path)
return caching_path