Skip to content

Commit 43372e4

Browse files
committed
Improve package checking to allow editable builds
Signed-off-by: Antoni Viros i Martin <[email protected]>
1 parent 3a373ff commit 43372e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fms_mo/utils/import_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
"""
1818

1919
# Standard
20+
from importlib.util import find_spec
2021
import pkgutil
2122
import sys
2223

2324
# Third Party
24-
from transformers.utils.import_utils import _is_package_available
2525
import torch
2626

2727
all_available_modules = []
@@ -47,7 +47,7 @@
4747
available_packages = {}
4848
for package in optional_packages:
4949
available_packages[package] = (
50-
_is_package_available(package) or package in all_available_modules
50+
find_spec(package) is not None or package in all_available_modules
5151
)
5252

5353
# cutlass is detected through torch.ops.cutlass_gemm

0 commit comments

Comments
 (0)