Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to requiring the vanilla transformers package #1302

Merged
merged 10 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading