Skip to content

Commit

Permalink
Allow check_transformers_install to warn and pass if NM fork isn't us…
Browse files Browse the repository at this point in the history
…ed (#1101)

* Allow check_transformers_install to warn and pass if NM fork isn't used

* .

* Update src/deepsparse/transformers/__init__.py

Co-authored-by: Benjamin Fineran <bfineran@users.noreply.github.com>

---------

Co-authored-by: Benjamin Fineran <bfineran@users.noreply.github.com>
  • Loading branch information
2 people authored and horheynm committed Jul 6, 2023
1 parent c6b17f9 commit d8eafaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/deepsparse/transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
def _check_transformers_install():
import transformers as _transformers

if not _transformers.NM_INTEGRATED:
if not getattr(_transformers, "NM_INTEGRATED", False):
_LOGGER.warning(
"the neuralmagic fork of transformers may not be installed. it can be "
"The neuralmagic fork of transformers may not be installed. It can be "
f"installed via `pip install {nm_transformers}`"
)

Expand Down

0 comments on commit d8eafaf

Please sign in to comment.