Skip to content

Commit

Permalink
only load searcher if index_dir is different
Browse files Browse the repository at this point in the history
  • Loading branch information
fschlatt committed Dec 16, 2024
1 parent 3e9816c commit dde4881
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lightning_ir/callbacks/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ def _get_searcher(self, trainer: Trainer, pl_module: BiEncoderModule, dataset_id
dataset = dataloaders[dataset_idx].dataset

index_dir = self._get_index_dir(pl_module, dataset)
if self.searcher is not None and self.searcher.index_dir == index_dir:
return self.searcher

searcher = self.search_config.search_class(index_dir, self.search_config, pl_module, self.use_gpu)
return searcher
Expand Down

0 comments on commit dde4881

Please sign in to comment.