Merge branch 'main' into extract_features_fix_for_clip_like_models

This commit is contained in:
Srikumar Sastry 2025-06-11 09:12:43 -07:00 committed by GitHub
commit d5e2ef57df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 22 deletions

View File

@ -11,7 +11,6 @@ from ..utils import (
is_accelerate_available,
is_bitsandbytes_available,
is_bitsandbytes_multi_backend_available,
is_ipex_available,
is_torch_available,
logging,
)
@ -488,29 +487,11 @@ def _validate_bnb_multi_backend_availability(raise_exception):
bnb_supported_devices = getattr(bnb, "supported_torch_devices", set())
available_devices = set(get_available_devices())
if available_devices == {"cpu"} and not is_ipex_available():
from importlib.util import find_spec
if find_spec("intel_extension_for_pytorch"):
logger.warning(
"You have Intel IPEX installed but if you're intending to use it for CPU, it might not have the right version. Be sure to double check that your PyTorch and IPEX installs are compatible."
)
available_devices = frozenset(
[device for device in available_devices if device != "cpu"]
) # Only Intel CPU is supported by BNB at the moment
if not available_devices.intersection(bnb_supported_devices):
if raise_exception:
bnb_supported_devices_with_info = set( # noqa: C401
'"cpu" (needs an Intel CPU and intel_extension_for_pytorch installed and compatible with the PyTorch version)'
if device == "cpu"
else device
for device in bnb_supported_devices
)
err_msg = (
f"None of the available devices `available_devices = {available_devices or None}` are supported by the bitsandbytes version you have installed: `bnb_supported_devices = {bnb_supported_devices_with_info}`. "
"Please check the docs to see if the backend you intend to use is available and how to install it: https://huggingface.co/docs/bitsandbytes/main/en/installation#multi-backend"
f"None of the available devices `available_devices = {available_devices or None}` are supported by the bitsandbytes version you have installed: `bnb_supported_devices = {bnb_supported_devices}`. "
"Please check the docs to see if the backend you intend to use is available and how to install it: https://huggingface.co/docs/bitsandbytes/main/en/installation"
)
logger.error(err_msg)

View File

@ -683,7 +683,7 @@ def check_all_models_are_tested():
test_file = [file for file in test_files if f"test_{module.__name__.split('.')[-1]}.py" in file]
if len(test_file) == 0:
# We do not test TF or Flax models anymore because they're deprecated.
if not (module.__name__.startswith("modeling_tf") or module.__name__.startswith("modeling_flax")):
if not ("modeling_tf" in module.__name__ or "modeling_flax" in module.__name__):
failures.append(f"{module.__name__} does not have its corresponding test file {test_file}.")
elif len(test_file) > 1:
failures.append(f"{module.__name__} has several test files: {test_file}.")