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

Colbert rerank not working, no attribute "run_context" #91

Closed
julianmukaj opened this issue Jan 30, 2024 · 6 comments
Closed

Colbert rerank not working, no attribute "run_context" #91

julianmukaj opened this issue Jan 30, 2024 · 6 comments

Comments

@julianmukaj
Copy link

\appdata\local\programs\python\python39\lib\site-packages\ragatouille\models\colbert.py", line 752, in del
AttributeError: 'ColBERT' object has no attribute 'run_context'

Have tried all versions of RAGatouille, this is on windows and on several Py versions 3.8, 3.9, 3.10 have been tested.

I saw issue #40 fixed it for RAGtrainer but this happens when I load RAGPretrainedModel

@PrimoUomo89
Copy link
Contributor

I think when no run_context is found, it can't find the index directory. When running from_index, I have to submit the full path to dir. not sure if that's intended.

@julianmukaj
Copy link
Author

You should be able to do this without an index

colbert = RAGPretrainedModel.from_pretrained("colbert-ir/colbertv2.0")
docs = colbert.rerank(query='What is ERS?', documents=[
    d['content'] for d in docs
], k=5)

But for the exception above is given on the line:

colbert = RAGPretrainedModel.from_pretrained("colbert-ir/colbertv2.0")

Indicating a issue with RAGPretrainedModel class it seems, will take a deeper look soon

@PrimoUomo89
Copy link
Contributor

My mistake. I misread your initial comment.

@bclavie
Copy link
Owner

bclavie commented Jan 30, 2024

When running from_index, I have to submit the full path to dir. not sure if that's intended.

If I understand correctly, this is intended yes! Maybe it's not super intuitive 🤔

@julianmukaj It seems like this is likely hiding another error, as __del__ shouldn't be called without an initialised run_context, which appears whenever a new ColBERT is instantiated... I've pushed a mini-PR to make __del__ have a try/except, could you please try the latest version and let me know if it fixes it and/or reveals another real error?

@julianmukaj
Copy link
Author

That got past the issue, seems to not be compatible in Windows when not using WSL.

Related issue: #14

You can resolve that users issue by installing the Windows C++ Build Tools and adding it to PATH correctly.

But then you get to here:

segmented_maxsim.cpp(1): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory

Should be able to resolve this by installing pthreads-w32, but having trouble getting colbert to detect it for now.

I think fair to add library is currently not supported for Windows outside of WSL.

@bclavie
Copy link
Owner

bclavie commented Feb 3, 2024

I think fair to add library is currently not supported for Windows outside of WSL.

Yeah this is fair. I've juste added a disclaimer to the README to this effect -- windows support right now is a nice to have but sadly not something we can target with current resources

@bclavie bclavie closed this as completed Feb 3, 2024
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

No branches or pull requests

3 participants