huggingface / transformers

🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
https://huggingface.co/transformers
Apache License 2.0
134.93k stars 26.99k forks source link

ImportError: cannot import name 'AutoModelForImageTextToText' from 'transformers' (/usr/local/lib/python3.10/dist-packages/transformers/__init__.py) #34217

Open psologub opened 3 weeks ago

psologub commented 3 weeks ago

System Info

Who can help?

@ArthurZucker @amyeroberts @qubv

Information

Tasks

Reproduction

!pip install torch
!pip install transformers

import requests
from PIL import Image
import torch
from transformers import AutoProcessor, AutoModelForImageTextToText

The error message:

ImportError                               Traceback (most recent call last)
[<ipython-input-5-af84153c3b01>](https://localhost:8080/#) in <cell line: 4>()
      2 from PIL import Image
      3 import torch
----> 4 from transformers import AutoProcessor, AutoModelForImageTextToText

ImportError: cannot import name 'AutoModelForImageTextToText' from 'transformers' (/usr/local/lib/python3.10/dist-packages/transformers/__init__.py)

Expected behavior

I've tried to follow this example but I get stuck importing AutoModelForImageTextToText. Could you help me out please?

ArthurZucker commented 3 weeks ago

Hey! That is because you are looking at the main documentation! This feature was shipped in #29572 which is not part of the latest release! 🤗