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

fix(numeric type issue): 🐛 making sure the division returns an int #375

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Almonok
Copy link

@Almonok Almonok commented Oct 25, 2024

Context

While working with RAGatouille (using colbert-ai version 0.2.19) to build and subsequently update an index, I encountered an error related to the persist_to_disk method in the IndexUpdater class. The error message was: TypeError: slice indices must be integers or None or have an __index__ method.

Analysis

Upon investigation, I identified a potential issue with the calculation of avg_chunksize. The value was being computed as a float, which later caused an error when attempting to use it for slicing, specifically in the calculation of pid_end.

To resolve this, I adjusted the computation to ensure that avg_chunksize is an integer. However, I have some reservations about whether this change aligns with the original algorithm's intent, given that using a // b results in the floor of the division.

Thank you for maintaining this repository !

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