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

Again! cannot import name 'convert_files_to_dicts' from 'haystack.utils' After the recent Update. #2370

Closed
AI-Ahmed opened this issue Mar 29, 2022 · 4 comments
Labels

Comments

@AI-Ahmed
Copy link
Contributor

image

@radhakrishr36
Copy link

I am also facing the same issue after the recent updates

ImportError Traceback (most recent call last)
in
1 from haystack.preprocessor.cleaning import clean_wiki_text
----> 2 from haystack.preprocessor.utils import convert_files_to_dicts, fetch_archive_from_http
3 from haystack.reader.farm import FARMReader
4 from haystack.reader.transformers import TransformersReader
5 from haystack.utils import print_answers

ImportError: cannot import name 'convert_files_to_dicts' from 'haystack.utils.preprocessing' (unknown location)

help me to resolve this issue.

@bogdankostic
Copy link
Contributor

Hi @AI-Ahmed and @radhakrishr36! In #2342, we included a few breaking changes. One of them is the renaming of convert_files_to_dicts to convert_files_to_docs. This method does not return a list of dictionaries anymore, but a list of Document objects. We changed the tutorials accordingly.

I hope this solves your problem.

@AI-Ahmed
Copy link
Contributor Author

AI-Ahmed commented Mar 30, 2022

This is much better! Thanks @bogdankostic

@aicam
Copy link

aicam commented Jun 25, 2024

Thanks @bogdankostic but now in version 2, it seems like it does not exist at all:
from haystack.utils import convert_files_to_docs
I tried to import it or alternatives but could not find neither in doc or code

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

No branches or pull requests

4 participants