IntelLabs / fastRAG

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

Cannot run the examples, haystack issues #31

Closed satyaloka93 closed 6 months ago

satyaloka93 commented 9 months ago

Can your examples include the haystack installation lines (with compatible versions)? I get errors on the newest farm-haystack and haystack-ai packages. When I downgraded to farm-haystack==1.17.2 (saw in another issue), then basic haystack 'getting started' code doesn't work. Are these projects synced?

Tried to run the notebook 'client_inference_with_Llama_cpp.ipynb'. Got the following error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[1], line 2
      1 from haystack import Pipeline
----> 2 from haystack.nodes.prompt import PromptNode
      3 from haystack.nodes import PromptModel
      4 from haystack.nodes.prompt.prompt_template import PromptTemplate

File ~/miniconda3/envs/jupyter/lib/python3.10/site-packages/haystack/nodes/__init__.py:1
----> 1 from haystack.nodes.base import BaseComponent
      3 from haystack.nodes.document_classifier import BaseDocumentClassifier, TransformersDocumentClassifier
      4 from haystack.nodes.extractor import EntityExtractor, simplify_ner_for_qa

File ~/miniconda3/envs/jupyter/lib/python3.10/site-packages/haystack/nodes/base.py:11
      8 import logging
     10 from haystack.schema import Document, MultiLabel
---> 11 from haystack.errors import PipelineSchemaError
     12 from haystack.utils.reflection import args_to_kwargs
     15 logger = logging.getLogger(__name__)

ImportError: cannot import name 'PipelineSchemaError' from 'haystack.errors' (/root/miniconda3/envs/jupyter/lib/python3.10/site-packages/haystack/errors.py)
satyaloka93 commented 9 months ago

I saw my problem was trying to install haystack from their documentation. Uninstalling that and just using the repo's version fixed that. Also their api has changed a bit, so copying code from their documentation doesn't work.

ameerfaour95 commented 9 months ago

Having the same problem uninstalling the haystack and installing using the repo doesnt work also. The same code 2 month ago worked just fine. ImportError: cannot import name 'send_event' from 'haystack.telemetry' (/usr/local/lib/python3.8/site-packages/haystack/telemetry/init.py)

peteriz commented 9 months ago

Hi @ameerfaour95 @satyaloka93 I just validated the notebook you mentioned on a clean python env. I ran the following commands to install the right packages for the llama_cpp example. Note that I chose to install CPU-only pytorch.

pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -e .
pip install -e .[llama_cpp]
danielfleischer commented 6 months ago

No response.