haystack icon indicating copy to clipboard operation
haystack copied to clipboard

ImportError: cannot import name 'pipeline' from 'transformers'

Open boralprophecy opened this issue 6 years ago • 2 comments

When trying to import TransformersReader, I am getting the following error

from haystack.reader.transformers import TransformersReader

Error :

>>> from haystack.reader.transformers import TransformersReader
ImportError: cannot import name 'pipeline' from 'transformers' (C:\ANACON~1\lib\site-packages\transformers\__init__.py)

Please note I am in the directory haystack-master. I am using windows 10.

Please help me in solving this.

boralprophecy avatar Mar 15 '20 07:03 boralprophecy

Hey @boralprophecy ,

I was not able to reproduce this. What version of Transformers do you have installed? It seems that it cannot import the pipeline object from there. Haystack is currently using Transformers v2.4.0 (2.5.1 should also work, but it is not fully tested yet).

tholor avatar Mar 15 '20 09:03 tholor

It was a version issue. During installation of FARM, transformers was in version 2.1.1 which was giving the error. Have upgraded to 2.5.1. Now it is working fine. Thanks.

boralprophecy avatar Mar 16 '20 08:03 boralprophecy