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

ExtractiveReader breaks if run with no documents #7878

Open
kurobanekid opened this issue Jun 17, 2024 · 1 comment
Open

ExtractiveReader breaks if run with no documents #7878

kurobanekid opened this issue Jun 17, 2024 · 1 comment

Comments

@kurobanekid
Copy link

Describe the bug
ExtractiveReader breaks if run with no documents

Error message
File "/home/rootuser/miniconda3/envs/xxxx/lib/python3.10/site-packages/haystack/components/readers/extractive.py", line 630, in run
answers = self._nest_answers(
File "/home/rootuser/miniconda3/envs/xxxx/lib/python3.10/site-packages/haystack/components/readers/extractive.py", line 391, in _nest_answers
current_answers = self.deduplicate_by_overlap(current_answers, overlap_threshold=overlap_threshold)
File "/home/rootuser/miniconda3/envs/xxxx/lib/python3.10/site-packages/haystack/components/readers/extractive.py", line 515, in deduplicate_by_overlap
deduplicated_answers = [answers[0]]

System:

  • OS: Linux
  • GPU: A100
  • Haystack version: v2.2.2
@anakin87
Copy link
Member

anakin87 commented Jun 17, 2024

Hey!

This seems like a duplicate of #7731 (fixed in #7732).

I am not able to reproduce it with the following code (haystack-ai==2.2.2):

from haystack.components.readers import ExtractiveReader


reader = ExtractiveReader()
reader.warm_up()
res=reader.run(query="hello", documents=[])

Can you try updating Haystack?
In case you still encounter a the error, please attach a reproducible example.

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

No branches or pull requests

2 participants