From b27fbdada12eda9962cedd5cbe9535bd5a71aa1e Mon Sep 17 00:00:00 2001 From: Benjamin Fineran Date: Wed, 26 Jan 2022 18:21:24 -0500 Subject: [PATCH] update install check of transformers to NM_INTEGRATED (#255) (#256) --- src/deepsparse/transformers/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/deepsparse/transformers/__init__.py b/src/deepsparse/transformers/__init__.py index a3a7213d1a..3832601ee6 100644 --- a/src/deepsparse/transformers/__init__.py +++ b/src/deepsparse/transformers/__init__.py @@ -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 @@ -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}`" )