Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 3463202

Browse files
authored
update install check of transformers to NM_INTEGRATED (#532) (#533)
1 parent 9778882 commit 3463202

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/sparseml/transformers/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import transformers as _transformers
2626

2727
# triggers error if neuralmagic/transformers is not installed
28-
_transformers.models.bert.modeling_bert.QATMatMul
28+
assert _transformers.NM_INTEGRATED
2929
_transformers_import_error = None
3030
except Exception as _transformers_import_err:
3131
_transformers_import_error = _transformers_import_err
@@ -101,11 +101,10 @@ def _check_transformers_install():
101101
try:
102102
import transformers as _transformers
103103

104-
_transformers.models.bert.modeling_bert.QATMatMul
104+
assert _transformers.NM_INTEGRATED
105105
except Exception:
106106
_LOGGER.warning(
107-
"transformers.models.bert.modeling_bert.QATMatMul not availalbe. the"
108-
"neuralmagic fork of transformers may not be installed. it can be "
107+
"the neuralmagic fork of transformers may not be installed. it can be "
109108
"installed via "
110109
f"`pip install {_NM_TRANSFORMERS_NIGHTLY}`"
111110
)

0 commit comments

Comments
 (0)