haystack icon indicating copy to clipboard operation
haystack copied to clipboard

ExtractiveReader breaks if run with no documents

Open kurobanekid opened this issue 1 year ago • 1 comments

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

kurobanekid avatar Jun 17 '24 09:06 kurobanekid

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.

anakin87 avatar Jun 17 '24 10:06 anakin87