Skip to content

Commit 06e958e

Browse files
committed
move docstring; add params
1 parent 4674c95 commit 06e958e

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

Diff for: src/deepsparse/clip/zeroshot_pipeline.py

+14-7
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,21 @@ class CLIPZeroShotOutput(BaseModel):
4848

4949
@BasePipeline.register(task="clip_zeroshot", default_model_path=None)
5050
class CLIPZeroShotPipeline(BasePipeline):
51+
"""
52+
Pipeline designed to run zero-shot classification given a list of images and
53+
possible classes. The CLIPZeroShotPipeline relies on two pipelines, the
54+
CLIPTextPipeline which handles CLIP's text branch adn the CLIPVisualPipeline
55+
which handles CLIP's visual branch. The final score calculations are handled and
56+
returned by the CLIPZeroShotPipeline. See README.md for a detailed example.
57+
58+
:param visual_model_path: either a local path or sparsezoo stub for the CLIP visual
59+
branch onnx model
60+
:param text_model_path: either a local path or sparsezoo stub for the CLIP text
61+
branch onnx model
62+
63+
"""
64+
5165
def __init__(self, visual_model_path: str, text_model_path: str, **kwargs):
52-
"""
53-
Pipeline designed to run zero-shot classification given a list of images and
54-
possible classes. The CLIPZeroShotPipeline relies on two pipelines, the
55-
CLIPTextPipeline which handles CLIP's text branch adn the CLIPVisualPipeline
56-
which handles CLIP's visual branch. The final score calculations are handled and
57-
returned by the CLIPZeroShotPipeline. See README.md for a detailed example.
58-
"""
5966
self.visual = Pipeline.create(
6067
task="clip_visual", **{"model_path": visual_model_path}
6168
)

0 commit comments

Comments
 (0)