Skip to content

Commit

Permalink
fix: Remove incorrect output types line (#8371)
Browse files Browse the repository at this point in the history
* Remove incorrect output types line

* Same update to zero shot text router

* Update haystack/components/routers/zero_shot_text_router.py

Co-authored-by: Amna Mubashar <[email protected]>

---------

Co-authored-by: Amna Mubashar <[email protected]>
  • Loading branch information
sjrl and Amnah199 authored Sep 17, 2024
1 parent 5071e47 commit d76e654
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions haystack/components/routers/transformers_text_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ def from_dict(cls, data: Dict[str, Any]) -> "TransformersTextRouter":
deserialize_hf_model_kwargs(data["init_parameters"]["huggingface_pipeline_kwargs"])
return default_from_dict(cls, data)

@component.output_types(documents=Dict[str, str])
def run(self, text: str):
def run(self, text: str) -> Dict[str, str]:
"""
Routes the text strings to different connections based on a category label.
Expand Down
3 changes: 1 addition & 2 deletions haystack/components/routers/zero_shot_text_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ def from_dict(cls, data: Dict[str, Any]) -> "TransformersZeroShotTextRouter":
deserialize_hf_model_kwargs(data["init_parameters"]["huggingface_pipeline_kwargs"])
return default_from_dict(cls, data)

@component.output_types(documents=Dict[str, str])
def run(self, text: str):
def run(self, text: str) -> Dict[str, str]:
"""
Routes the text strings to different connections based on a category label.
Expand Down

0 comments on commit d76e654

Please sign in to comment.