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

[BUG] RuntimeError: Failed to import transformers.models.fuyu.processing_fuyu #105

Closed
vyomakesh09 opened this issue Nov 8, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@vyomakesh09
Copy link
Contributor

vyomakesh09 commented Nov 8, 2023

Traceback (most recent call last):
File "/home/v/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1345, in _get_module
return importlib.import_module("." + module_name, self.name)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/home/v/.local/lib/python3.10/site-packages/transformers/models/fuyu/processing_fuyu.py", line 29, in
from .image_processing_fuyu import FuyuBatchFeature
File "/home/v/.local/lib/python3.10/site-packages/transformers/models/fuyu/image_processing_fuyu.py", line 180, in
class FuyuImageProcessor(BaseImageProcessor):
File "/home/v/.local/lib/python3.10/site-packages/transformers/models/fuyu/image_processing_fuyu.py", line 365, in FuyuImageProcessor
resample: Optional[PILImageResampling] = None,
File "/usr/lib/python3.10/typing.py", line 312, in inner
return func(*args, **kwds)
File "/usr/lib/python3.10/typing.py", line 403, in getitem
return self._getitem(self, parameters)
File "/usr/lib/python3.10/typing.py", line 529, in Optional
arg = _type_check(parameters, f"{self} requires a single type.")
File "/usr/lib/python3.10/typing.py", line 176, in _type_check
raise TypeError(f"{msg} Got {arg!r:.100}.")
TypeError: typing.Optional requires a single type. Got <module 'PIL.Image' from '/usr/lib/python3/dist-packages/PIL/Image.py'>.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/v/inhouse/fuyu.py", line 1, in
from swarms.models.fuyu import Fuyu
File "/home/v/.local/lib/python3.10/site-packages/swarms/models/fuyu.py", line 2, in
from transformers import (
File "", line 1075, in _handle_fromlist
File "/home/v/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1336, in getattr
value = getattr(module, name)
File "/home/v/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1335, in getattr
module = self._get_module(self._class_to_module[name])
File "/home/v/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1347, in _get_module
raise RuntimeError(
RuntimeError: Failed to import transformers.models.fuyu.processing_fuyu because of the following error (look up to see its traceback):
typing.Optional requires a single type. Got <module 'PIL.Image' from '/usr/lib/python3/dist-packages/PIL/Image.py'>.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@vyomakesh09 vyomakesh09 added the bug Something isn't working label Nov 8, 2023
@kyegomez
Copy link
Owner

@vyomakesh09 we have double of this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants