Skip to content

Commit

Permalink
Added method save_pretrained() to RAGMultiModalModel
Browse files Browse the repository at this point in the history
  • Loading branch information
DebopamParam authored Nov 7, 2024
1 parent 9ef65b2 commit 5765fba
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions byaldi/RAGModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,24 +180,24 @@ def as_langchain_retriever(self, **kwargs: Any):
return ByaldiLangChainRetriever(model=self, kwargs=kwargs)

def save_pretrained(self, directory_path: str) -> None:
"""
Save the model and processor to a specified directory.
"""
Save the model and processor to a specified directory.
Parameters:
directory_path (str): The path to the directory where the model and processor should be saved.
Parameters:
directory_path (str): The path to the directory where the model and processor should be saved.
Returns:
None
Returns:
None
This function saves both the model and processor components of the current instance
to the specified directory, allowing the model to be reloaded later from this checkpoint.
However for complete local setup follow this - https://github.com/illuin-tech/colpali/issues/129
This function saves both the model and processor components of the current instance
to the specified directory, allowing the model to be reloaded later from this checkpoint.
However for complete local setup follow this - https://github.com/illuin-tech/colpali/issues/129
Raises:
FileNotFoundError: If the specified directory does not exist.
PermissionError: If there are insufficient permissions to write to the directory.
Exception: For any other unexpected errors during the save process.
"""
Raises:
FileNotFoundError: If the specified directory does not exist.
PermissionError: If there are insufficient permissions to write to the directory.
Exception: For any other unexpected errors during the save process.
"""
try:
# Attempt to save the model and processor
self.model.model.save_pretrained(directory_path)
Expand Down

0 comments on commit 5765fba

Please sign in to comment.