Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added cache directory support for Colpali
  • Loading branch information
Jainil-Gosalia committed Nov 19, 2024
commit 6891dc089311716000b166c9cf21aebaaa5dc0c1
2 changes: 2 additions & 0 deletions byaldi/RAGModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def from_pretrained(
index_root: str = ".byaldi",
device: str = "cuda",
verbose: int = 1,
cache_dir: Optional[str] = "/cache_dir/models",
):
"""Load a ColPali model from a pre-trained checkpoint.

Expand All @@ -61,6 +62,7 @@ def from_pretrained(
index_root=index_root,
device=device,
verbose=verbose,
cache_dir=cache_dir,
)
return instance

Expand Down
1 change: 1 addition & 0 deletions byaldi/colpali.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def __init__(
else None
),
token=kwargs.get("hf_token", None) or os.environ.get("HF_TOKEN"),
cache_dir=kwargs.get("cache_dir", None),
)
elif "colqwen2" in pretrained_model_name_or_path.lower():
self.model = ColQwen2.from_pretrained(
Expand Down