Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated information about vidore/colqwen2-v0.1 support + Elaborated example code of using index_root #55

Closed
wants to merge 7 commits into from

Conversation

DebopamParam
Copy link
Contributor

Changes Overview

  • Updated information about vidore/colqwen2-v0.1 support
  • Elaborated example code of using index_root

Added method save_pretrained() to RAGMultiModalModel but Integration test failed thrice, I am not able to understand why - so commented portion of the out - please have a look at it )

#Inside RAGMultiModalModel class
def save_pretrained(self, directory_path: str) -> None:
    """
    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.

    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

    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)
        self.model.processor.save_pretrained(directory_path)
        
    except FileNotFoundError as fnf_error:
        raise FileNotFoundError(f"The specified directory '{directory_path}' does not exist.") from fnf_error
    except PermissionError as perm_error:
        raise PermissionError(f"Insufficient permissions to write to '{directory_path}'.") from perm_error
    except Exception as e:
        raise Exception(f"An unexpected error occurred while saving: {e}") from e

Hey @bclavie . Please accept my connection request on LinkedIn. I want to learn and contribute more to this amazing project & also the others that you are a part of. I will make a video on a project that I made recently - A complete local Multimodal RAG for large volume of PDFs using Byaldi & Pixtral. If you could take out 30mins of your time anyday if you want to be my guest, I would feel really honored. Here are some of my works and videos. I have sent you connection request on LinkedIn, you can also find my social links here sir when you scroll down. Thank you, Benjamin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant