Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.
Merged
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
15 changes: 15 additions & 0 deletions src/deepsparse/v2/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,21 @@ def _apply_split(self, inp: Any, inference_state: InferenceState):
)
return self.condense_inputs(outputs)

@staticmethod
def create(task: str, **kwargs) -> "Pipeline":
"""
:param task: Pipeline task
:param kwargs: extra task specific kwargs to be passed to the Pipeline
:return: pipeline object initialized for the given task
"""
pipeline = Operator.create(task=task, **kwargs)
if not isinstance(pipeline, Pipeline):
raise RuntimeError(
"Pipeline was not created for the given task. The "
"provided task should be registered using the OperatorRegistry"
)
return pipeline

def run(
self,
*args,
Expand Down