diff --git a/src/transformers/utils/import_utils.py b/src/transformers/utils/import_utils.py index 70bd236e3bb4ac..0fdf62d533a783 100755 --- a/src/transformers/utils/import_utils.py +++ b/src/transformers/utils/import_utils.py @@ -1006,6 +1006,17 @@ def is_auto_gptq_available(): def is_eetq_available(): + if not _eetq_available: + return _eetq_available + + try: + from eetq import EetqLinear # noqa: F401 + except ImportError as exc: + if "shard_checkpoint" in str(exc): + # eetq is currently broken with newer transformers versions because it tries to import shard_checkpoint + # see https://github.com/NetEase-FuXi/EETQ/issues/34 + # TODO: Remove once eetq releasees a fix and this release is used in CI + return False return _eetq_available