Skip to content

Commit

Permalink
update install check of transformers to NM_INTEGRATED (#255) (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
bfineran committed Jan 26, 2022
1 parent 072669e commit b27fbda
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/deepsparse/transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import transformers as _transformers

# triggers error if neuralmagic/transformers is not installed
_transformers.models.bert.modeling_bert.QATMatMul
assert _transformers.NM_INTEGRATED
_transformers_import_error = None
except Exception as _transformers_import_err:
_transformers_import_error = _transformers_import_err
Expand Down Expand Up @@ -105,11 +105,10 @@ def _check_transformers_install():
try:
import transformers as _transformers

_transformers.models.bert.modeling_bert.QATMatMul
assert _transformers.NM_INTEGRATED
except Exception:
_LOGGER.warning(
"transformers.models.bert.modeling_bert.QATMatMul not availalbe. the"
"neuralmagic fork of transformers may not be installed. it can be "
"the neuralmagic fork of transformers may not be installed. it can be "
"installed via "
f"`pip install {_NM_TRANSFORMERS_NIGHTLY}`"
)
Expand Down

0 comments on commit b27fbda

Please sign in to comment.