Skip to content

Commit

Permalink
Change to requiring the vanilla transformers package (#1302)
Browse files Browse the repository at this point in the history
* Update datasets to match

* Update setup

* .

* oops

* Format

* remove deepsparse release install in twitter nlp example test

---------

Co-authored-by: Benjamin Fineran <bfineran@users.noreply.github.com>
  • Loading branch information
mgoin and bfineran committed Oct 18, 2023
1 parent 4960048 commit 32ddf55
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,8 @@ def _parse_requirements_file(file_path):
]
_yolov8_integration_deps = _yolo_integration_deps + ["ultralytics==8.0.124"]
_transformers_integration_deps = [
f"{'nm-transformers' if is_release else 'nm-transformers-nightly'}"
f"~={version_base}",
"datasets<=2.11",
"transformers<4.35",
"datasets<2.13",
"scikit-learn",
"seqeval",
]
Expand All @@ -166,7 +165,7 @@ def _parse_requirements_file(file_path):
_clip_deps = [
"open_clip_torch==2.20.0",
"scipy<1.9.2,>=1.8",
f"{'nm-transformers' if is_release else 'nm-transformers-nightly'}",
"transformers<4.35",
]

_torch_deps = ["torch>=1.7.0,<=2.0"]
Expand Down
17 changes: 0 additions & 17 deletions src/deepsparse/transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

# flake8: noqa

import logging as _logging

from deepsparse.analytics import deepsparse_analytics as _analytics

Expand All @@ -35,22 +34,6 @@
raise ImportError("Please install deepsparse[transformers] to use this pathway")


_LOGGER = _logging.getLogger(__name__)


def _check_transformers_install():
import transformers as _transformers

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


_check_transformers_install()


from .helpers import *
from .loaders import *
from .pipelines import *
5 changes: 3 additions & 2 deletions tests/examples/test_twitter_nlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ def install_reqs():
"-m",
"pip",
"install",
"-r",
"examples/twitter-nlp/requirements.txt",
"git+https://github.com/twintproject/"
"twint@e7c8a0c764f6879188e5c21e25fb6f1f856a7221#egg=twint",
"rich>=12.2.0",
]
)

Expand Down

0 comments on commit 32ddf55

Please sign in to comment.