Skip to content

Commit

Permalink
Fix VideoLlava imports (#30867)
Browse files Browse the repository at this point in the history
* Fix VideoLlava imports

* Update dummy objects
  • Loading branch information
amyeroberts authored May 16, 2024
1 parent 4e17e7d commit 15c74a2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,7 @@
_import_structure["models.swin2sr"].append("Swin2SRImageProcessor")
_import_structure["models.tvlt"].append("TvltImageProcessor")
_import_structure["models.tvp"].append("TvpImageProcessor")
_import_structure["models.video_llava"].append("VideoLlavaImageProcessor")
_import_structure["models.videomae"].extend(["VideoMAEFeatureExtractor", "VideoMAEImageProcessor"])
_import_structure["models.vilt"].extend(["ViltFeatureExtractor", "ViltImageProcessor", "ViltProcessor"])
_import_structure["models.vit"].extend(["ViTFeatureExtractor", "ViTImageProcessor"])
Expand Down Expand Up @@ -3243,7 +3244,6 @@
_import_structure["models.video_llava"].extend(
[
"VideoLlavaForConditionalGeneration",
"VideoLlavaImageProcessor",
"VideoLlavaPreTrainedModel",
"VideoLlavaProcessor",
]
Expand Down Expand Up @@ -5759,6 +5759,7 @@
from .models.swin2sr import Swin2SRImageProcessor
from .models.tvlt import TvltImageProcessor
from .models.tvp import TvpImageProcessor
from .models.video_llava import VideoLlavaImageProcessor
from .models.videomae import VideoMAEFeatureExtractor, VideoMAEImageProcessor
from .models.vilt import ViltFeatureExtractor, ViltImageProcessor, ViltProcessor
from .models.vit import ViTFeatureExtractor, ViTImageProcessor
Expand Down Expand Up @@ -7437,7 +7438,6 @@
)
from .models.video_llava import (
VideoLlavaForConditionalGeneration,
VideoLlavaImageProcessor,
VideoLlavaPreTrainedModel,
VideoLlavaProcessor,
)
Expand Down
7 changes: 0 additions & 7 deletions src/transformers/utils/dummy_pt_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -8417,13 +8417,6 @@ def __init__(self, *args, **kwargs):
requires_backends(self, ["torch"])


class VideoLlavaImageProcessor(metaclass=DummyObject):
_backends = ["torch"]

def __init__(self, *args, **kwargs):
requires_backends(self, ["torch"])


class VideoLlavaPreTrainedModel(metaclass=DummyObject):
_backends = ["torch"]

Expand Down
7 changes: 7 additions & 0 deletions src/transformers/utils/dummy_vision_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,13 @@ def __init__(self, *args, **kwargs):
requires_backends(self, ["vision"])


class VideoLlavaImageProcessor(metaclass=DummyObject):
_backends = ["vision"]

def __init__(self, *args, **kwargs):
requires_backends(self, ["vision"])


class VideoMAEFeatureExtractor(metaclass=DummyObject):
_backends = ["vision"]

Expand Down

0 comments on commit 15c74a2

Please sign in to comment.