IntelLabs / fastRAG

Efficient Retrieval Augmentation and Generation Framework
Apache License 2.0
1.29k stars 116 forks source link

ImportError: cannot import name 'Seq2SeqGenerator' from 'haystack.nodes' #23

Closed Maximiliano-Villanueva closed 1 year ago

Maximiliano-Villanueva commented 1 year ago

Problem Hi, I am trying to reproduce the knowledge graph example you provided here

but I am getting the following error:

File "xxx/haystack1.py", line 6, in from fastrag.readers import FiDReader File "xxx/lib/python3.8/site-packages/fastrag/init.py", line 4, in from fastrag import image_generators, kg_creators, rankers, readers, retrievers, stores File "xxx/lib/python3.8/site-packages/fastrag/readers/init.py", line 6, in from fastrag.readers.FiD import FiDReader File "xxx/lib/python3.8/site-packages/fastrag/readers/FiD.py", line 8, in from haystack.nodes import Seq2SeqGenerator ImportError: cannot import name 'Seq2SeqGenerator' from 'haystack.nodes' (xxx/haystack/haystack/nodes/init.py) /usr/lib/python3.8/tempfile.py:957: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/tmpuj6o9jw1'> _warnings.warn(warn_message, ResourceWarning)

Steps to reproduce git clone https://github.com/deepset-ai/haystack.git cd haystack pip install --upgrade pip pip install -e '.[all-gpu]'

pip install git+https://github.com/IntelLabs/fastRAG.git

HW specifications:

danielfleischer commented 1 year ago

We require a specific version of haystack https://github.com/IntelLabs/fastRAG/blob/e5dea518e3ef243965016bf2ebb63b2789d1845c/setup.cfg#L5 as newer versions remove the Seq2SeqGenerator class. In order to run fastRAG, there's no need to manually install Haystack, much less so installing it by cloning it locally (unless you want to edit and modify Haystack source code), as it's not the recommended way of installing it, see https://github.com/deepset-ai/haystack#-installation.