diff --git a/src/transformers/utils/import_utils.py b/src/transformers/utils/import_utils.py index aa80cbb28e7a..1b85326e5de7 100644 --- a/src/transformers/utils/import_utils.py +++ b/src/transformers/utils/import_utils.py @@ -82,10 +82,7 @@ def _is_package_available(pkg_name: str, return_version: bool = False) -> Union[ package = importlib.import_module(pkg_name) package_version = getattr(package, "__version__", "N/A") except Exception: - try: - package_version = importlib.metadata.version("pytorch-triton") # pytorch-triton - except Exception: - package_exists = False + package_exists = False else: # For packages other than "torch", don't attempt the fallback and set as not available package_exists = False