ThilinaRajapakse / simpletransformers

Transformers for Information Retrieval, Text Classification, NER, QA, Language Modelling, Language Generation, T5, Multi-Modal, and Conversational AI
https://simpletransformers.ai/
Apache License 2.0
4.11k stars 727 forks source link

Cannot import required library (Repost after multiple attempts at workarounds) #1526

Closed Fshrink closed 1 year ago

Fshrink commented 1 year ago

Describe the bug Screenshot from 2023-05-14 09-08-29

To Reproduce pip install simpletransformers or ipython from transformers import cached_path

Expected behavior Install would complete and library would be functional

Desktop (please complete the following information):

Linux Ubuntu 22.10 Laptop - CPU only

Additional context Add any other context about the problem here. Screenshot from 2023-05-14 09-16-11

Not being able to import this library throws a wrench in pretty much everything downstream, including in the model.py. It eventually prevents to properly load trained saved model. Huggingface says it's a simpletransformers issue. Thanks!!

Fshrink commented 1 year ago

This is a bug because cached_path utility is not used any longer by transformers. It has been replaced by the huggingface_hub library. Can one dev please include this in upcoming patch? Thank you.

Fshrink commented 1 year ago

Workaround is to install 'cached-path' through pip or other means and to replace "from transformers import cached_path" with "from cached_path import cached_path"