Skip to content

Commit

Permalink
protect imports in type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
molbap committed Oct 18, 2023
1 parent 8de6382 commit 2ae2dad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/models/fuyu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
from .configuration_fuyu import FUYU_PRETRAINED_CONFIG_ARCHIVE_MAP, FuyuConfig

try:
if not is_vision_available():
if not is_vision_available() or not is_torch_available():
raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
pass
Expand Down

0 comments on commit 2ae2dad

Please sign in to comment.