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

array out of bounds error in retrieval #453

Open
chair300 opened this issue Feb 28, 2024 · 4 comments
Open

array out of bounds error in retrieval #453

chair300 opened this issue Feb 28, 2024 · 4 comments

Comments

@chair300
Copy link
Contributor

When making a RAG request to of a semantic query I experienced the following stack trace. I am able to reproduce this.

File "/llmware/llmware/retrieval.py", line 670, in semantic_query
results_dict = self._cursor_to_qr(query, qr_raw, result_count=result_count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/llmware/llmware/retrieval.py", line 578, in _cursor_to_qr
matches_found = self.locate_query_match(query, raw_qr["text"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/llmware/llmware/retrieval.py", line 1375, in locate_query_match
if core_text[x].lower() == key_term[0].lower():
~~~~~~~~^^^
IndexError: string index out of range

@MacOS
Copy link
Contributor

MacOS commented Feb 28, 2024

Can you please post a self-contained reproducible example so I can take a look at it?

@chair300
Copy link
Contributor Author

I am able to reproduce the issue if I have an extra space or double space in the the query text.

@ucekmez
Copy link
Contributor

ucekmez commented Mar 1, 2024

Please see 4f6a7b5 which fixes the mentioned bug (inside #470 pr)

@chair300
Copy link
Contributor Author

chair300 commented Mar 1, 2024

This does not fix the bug. I have submitted the fix already with PR#471

doberst added a commit that referenced this issue Mar 1, 2024
fix tokenize whitespace issue (Issue #453)
doberst added a commit that referenced this issue Mar 16, 2024
fix tokenize whitespace issue (Issue #453)
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