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

Version 0.63.11 not compatible with Transformers 4.31.0 #1538

Closed owendw1 closed 1 year ago

owendw1 commented 1 year ago

Describe the bug Version 0.63.11 doesn't appear to be compatible with the latest version of the Transformers dependency, which is version 4.31.0.

To Reproduce

  1. Install Simple Transformers using pip pip install simpletransformers

  2. In the Python interpreter or a Python script, try to import key Simple Transformers modules from simpletransformers.classification import ClassificationModel, ClassificationArgs

Traceback (most recent call last): File "", line 1, in File "/home//venv/lib/python3.8/site-packages/simpletransformers/classification/init.py", line 5, in from simpletransformers.classification.multi_modal_classification_model import ( File "/home//venv/lib/python3.8/site-packages/simpletransformers/classification/multi_modal_classification_model.py", line 47, in from transformers.models.mmbt.configuration_mmbt import MMBTConfig ModuleNotFoundError: No module named 'transformers.models.mmbt'

Expected behavior The above error to not appear

Desktop (please complete the following information): Ubuntu 20.04.6 LTS

Cause In the latest version of Transformers, the model mmbt appears to have been moved to transformers/models/deprecated/mmbt/, which Simple Transformers cannot find.

Workaround A workaround for the above problem can be used. When installing Simple Transformers using pip, add the following dependency resolution:

pip install simpletransformers "transformers==4.30.2"

ColinFerguson commented 1 year ago

I have also had this issue today and downgrading transformers worked for me. I don't love that solution, but it works for now.

bver commented 1 year ago

^^^ Workaround works for me as well, thanks.

owendw1 commented 1 year ago

Fixed (see issue #1539): Simple Transformers 0.64.3 now available.