Find answers from the community

Updated 3 months ago

**Potential bug?**

Potential bug? Postprocessor error when vector search yields 0 results

Exception: IndexError: list index out of range

I think there's a decent chance this is a bug. I'm fairly certain this happens because I just moved to a new Vector Database that has no data in it, but the index itself has been created.

My code was working fine and my tests were passing, but when I cleared my DB this error occurred. I believe its happening because the vector search yields no results and then the postprocessor (SentenceTransformerRerank) has nothing to rerank. I would guess that even when the results are zero, the reranker shouldn't run or just returns nothing.

I've attached my code and full stack-trace in the thread.
n
L
8 comments
Here is my code. Apologies for the weird preview, company network security messes it up, but if you download it, it should be fine.

If this is indeed a bug I can move this over to GitHub or wherever the mods/contributors deem relevant πŸ˜„
Yea you are probably right, the reranker should handle zero nodes. Easy enough to fix πŸ™‚
Let me know if I need to move this somewhere else. Happy to do so, but given my lack of experience I thought there was a chance I was using the class wrong so I didn't want to post right away as a bug
Give me a few minues, I can fix this right now
Now I gotta upgrade again
Lol gotta get it on pypi soon, should be up soon. But can also install from source
Add a reply
Sign up and join the conversation on Discord