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

Commit b27fbda

Browse files
authoredJan 26, 2022
update install check of transformers to NM_INTEGRATED (#255) (#256)
1 parent 072669e commit b27fbda

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

‎src/deepsparse/transformers/__init__.py

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

2828
# triggers error if neuralmagic/transformers is not installed
29-
_transformers.models.bert.modeling_bert.QATMatMul
29+
assert _transformers.NM_INTEGRATED
3030
_transformers_import_error = None
3131
except Exception as _transformers_import_err:
3232
_transformers_import_error = _transformers_import_err
@@ -105,11 +105,10 @@ def _check_transformers_install():
105105
try:
106106
import transformers as _transformers
107107

108-
_transformers.models.bert.modeling_bert.QATMatMul
108+
assert _transformers.NM_INTEGRATED
109109
except Exception:
110110
_LOGGER.warning(
111-
"transformers.models.bert.modeling_bert.QATMatMul not availalbe. the"
112-
"neuralmagic fork of transformers may not be installed. it can be "
111+
"the neuralmagic fork of transformers may not be installed. it can be "
113112
"installed via "
114113
f"`pip install {_NM_TRANSFORMERS_NIGHTLY}`"
115114
)

0 commit comments

Comments
 (0)
This repository has been archived.