Skip to content

Commit

Permalink
fix: fixed path issues by reverting previous deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
adharm committed Feb 28, 2024
1 parent 7d3ff09 commit 348ea6c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion ragatouille/models/colbert.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,28 @@ def add_to_index(
"add_to_index support will be more thorough in future versions",
)

if self.loaded_from_index:
index_root = self.config.root
else:
expected_path_segment = Path(self.config.experiment) / "indexes"
if str(expected_path_segment) in self.config.root:
index_root = self.config.root
else:
index_root = str(Path(self.config.root) / expected_path_segment)

if not self.collection:
collection_path = Path(index_root) / self.index_name / "collection.json"
if collection_path.exists():
self._get_collection_files_from_disk(
str(Path(index_root) / self.index_name)
)

searcher = Searcher(
checkpoint=self.checkpoint,
config=None,
collection=self.collection,
index=self.index_name,
index_root=self.index_root,
index_root=index_root,
verbose=self.verbose,
)

Expand Down

0 comments on commit 348ea6c

Please sign in to comment.