Skip to content

Commit

Permalink
add output type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
thigm85 committed Jun 2, 2022
1 parent 7361065 commit 015feaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vespa/ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def export_to_onnx(self, output_path: str) -> None:
pipeline, opset=11, output=Path(output_path), use_external_format=False
)

def predict(self, text: str):
def predict(self, text: str) -> List:
"""
Predict using a local instance of the model
Expand All @@ -102,7 +102,7 @@ def predict(self, text: str):
return [x["score"] for x in predictions]

@staticmethod
def parse_vespa_prediction(prediction):
def parse_vespa_prediction(prediction) -> List:
return [cell["value"] for cell in prediction["cells"]]

def create_url_encoded_tokens(self, x):
Expand Down

0 comments on commit 015feaf

Please sign in to comment.