We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3a373ff commit 43372e4Copy full SHA for 43372e4
fms_mo/utils/import_utils.py
@@ -17,11 +17,11 @@
17
"""
18
19
# Standard
20
+from importlib.util import find_spec
21
import pkgutil
22
import sys
23
24
# Third Party
-from transformers.utils.import_utils import _is_package_available
25
import torch
26
27
all_available_modules = []
@@ -47,7 +47,7 @@
47
available_packages = {}
48
for package in optional_packages:
49
available_packages[package] = (
50
- _is_package_available(package) or package in all_available_modules
+ find_spec(package) is not None or package in all_available_modules
51
)
52
53
# cutlass is detected through torch.ops.cutlass_gemm
0 commit comments