Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def get_optional_dependencies():
"seaborn",
"mkdocs",
"mkdocs-material",
"torchvision>=0.20",
]
}

Expand Down
3 changes: 3 additions & 0 deletions test/convergence/bf16/test_mini_models_multimodal.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from test.utils import UNTOKENIZED_DATASET_PATH
from test.utils import MiniModelConfig
from test.utils import assert_verbose_allclose
from test.utils import is_torchvision_available
from test.utils import load_image_processing_config
from test.utils import load_processor_config
from test.utils import load_tokenizer_config
Expand Down Expand Up @@ -788,6 +789,7 @@ def run_mini_model_multimodal(
not QWEN2_VL_AVAILABLE,
reason="Qwen2-VL not available in this version of transformers",
),
pytest.mark.skipif(not is_torchvision_available(), reason="Qwen2VLVideoProcessor requires torchvision"),
],
),
pytest.param(
Expand Down Expand Up @@ -826,6 +828,7 @@ def run_mini_model_multimodal(
not QWEN2_5_VL_AVAILABLE,
reason="Qwen2.5-VL not available in this version of transformers",
),
pytest.mark.skipif(not is_torchvision_available(), reason="Qwen2VLVideoProcessor requires torchvision"),
],
),
pytest.param(
Expand Down
3 changes: 3 additions & 0 deletions test/convergence/fp32/test_mini_models_multimodal.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from test.utils import UNTOKENIZED_DATASET_PATH
from test.utils import MiniModelConfig
from test.utils import assert_verbose_allclose
from test.utils import is_torchvision_available
from test.utils import load_image_processing_config
from test.utils import load_processor_config
from test.utils import load_tokenizer_config
Expand Down Expand Up @@ -783,6 +784,7 @@ def run_mini_model_multimodal(
not QWEN2_VL_AVAILABLE,
reason="Qwen2-VL not available in this version of transformers",
),
pytest.mark.skipif(not is_torchvision_available(), reason="Qwen2VLVideoProcessor requires torchvision"),
],
),
pytest.param(
Expand Down Expand Up @@ -817,6 +819,7 @@ def run_mini_model_multimodal(
not QWEN2_5_VL_AVAILABLE,
reason="Qwen2.5-VL not available in this version of transformers",
),
pytest.mark.skipif(not is_torchvision_available(), reason="Qwen2VLVideoProcessor requires torchvision"),
],
),
pytest.param(
Expand Down
7 changes: 7 additions & 0 deletions test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ def supports_bfloat16():
return False


def is_torchvision_available():
if importlib.util.find_spec("torchvision") is not None:
return True
else:
return False


def revert_liger_kernel_to_granite(model_config: MiniModelConfig):
"""
Revert all Liger kernel patches applied to Granite.
Expand Down
Loading