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

Add import error messages for integrations now that auto install has been removed #1030

Merged
merged 1 commit into from
May 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
12 changes: 11 additions & 1 deletion src/deepsparse/image_classification/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,19 @@
from deepsparse.analytics import deepsparse_analytics as _analytics


_analytics.send_event("python__image_classification__init")
try:
import torchvision as _torchvision

import cv2 as _cv2
except ImportError:
raise ImportError(
"Please install deepsparse[image_classification] to use this pathway"
)


from .constants import *
from .pipelines import *
from .schemas import *


_analytics.send_event("python__image_classification__init")
7 changes: 7 additions & 0 deletions src/deepsparse/open_pif_paf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
# flake8: noqa
from deepsparse.analytics import deepsparse_analytics as _analytics


try:
import cv2 as _cv2
import openpifpaf as _openpifpaf
except ImportError:
raise ImportError("Please install deepsparse[openpifpaf] to use this pathway")

from .utils import *


Expand Down
8 changes: 8 additions & 0 deletions src/deepsparse/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@

from deepsparse.analytics import deepsparse_analytics as _analytics


try:
import uvicorn as _uvicorn
from fastapi import FastAPI as _FastAPI
from starlette.responses import RedirectResponse as _RedirectResponse
except ImportError:
raise ImportError("Please install deepsparse[server] to use this pathway")

from .cli import main


Expand Down
8 changes: 8 additions & 0 deletions src/deepsparse/transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
_analytics.send_event("python__transformers__init")


try:
import transformers as _transformers

import datasets as _datasets
except ImportError:
raise ImportError("Please install deepsparse[transformers] to use this pathway")


_LOGGER = _logging.getLogger(__name__)


Expand Down
8 changes: 8 additions & 0 deletions src/deepsparse/yolo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@

from deepsparse.analytics import deepsparse_analytics as _analytics


try:
import torchvision as _torchvision

import cv2 as _cv2
except ImportError:
raise ImportError("Please install deepsparse[yolo] to use this pathway")

from .annotate import *
from .pipelines import *
from .schemas import *
Expand Down
7 changes: 7 additions & 0 deletions src/deepsparse/yolov8/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@

from deepsparse.analytics import deepsparse_analytics as _analytics


try:
import ultralytics as _ultralytics
except ImportError:
raise ImportError("Please install deepsparse[yolov8] to use this pathway")


from .annotate import *
from .pipelines import *
from .schemas import *
Expand Down
Loading