From 9346df5f55e797e43cc66144220de6d6350f6234 Mon Sep 17 00:00:00 2001 From: Luka Govedic Date: Fri, 26 Jan 2024 23:36:36 +0000 Subject: [PATCH 1/2] warning --- src/deepsparse/pipeline.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/deepsparse/pipeline.py b/src/deepsparse/pipeline.py index e2a1beeab1..e7e1d7502c 100644 --- a/src/deepsparse/pipeline.py +++ b/src/deepsparse/pipeline.py @@ -139,8 +139,9 @@ def create(cls, task: str, **kwargs) -> "Pipeline": "Pipeline was not created for the given task. The " "provided task should be registered using the OperatorRegistry" ) - except Exception: - _LOGGER.warning(f"Could not create v2 '{task}' pipeline, trying legacy") + except Exception as e: + _LOGGER.warning(f"Could not create v2 '{task}' pipeline, with error: {e}") + _LOGGER.warning(f"Attempting to create the legacy pipeline") from deepsparse.legacy import Pipeline pipeline = Pipeline.create(task=task, **kwargs) From 974fb3d258f78dc2dd4cb2791cb466271fb369c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Govedi=C4=8D?= Date: Mon, 5 Feb 2024 11:37:28 -0500 Subject: [PATCH 2/2] Update pipeline.py Single-line and removed `error` keyword --- src/deepsparse/pipeline.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/deepsparse/pipeline.py b/src/deepsparse/pipeline.py index e7e1d7502c..5085344e82 100644 --- a/src/deepsparse/pipeline.py +++ b/src/deepsparse/pipeline.py @@ -140,8 +140,7 @@ def create(cls, task: str, **kwargs) -> "Pipeline": "provided task should be registered using the OperatorRegistry" ) except Exception as e: - _LOGGER.warning(f"Could not create v2 '{task}' pipeline, with error: {e}") - _LOGGER.warning(f"Attempting to create the legacy pipeline") + _LOGGER.warning(f"Could not create v2 '{task}' pipeline, attempting to create the legacy pipeline. Reason: {e}") from deepsparse.legacy import Pipeline pipeline = Pipeline.create(task=task, **kwargs)