Skip to content

Commit

Permalink
Make mypy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
sjrl committed Aug 20, 2024
1 parent 27d89b0 commit e172240
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions haystack/components/samplers/top_p.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ def _get_doc_score_from_meta(self, doc: Document) -> Optional[float]:
:param doc: Document object.
:return: Score of the document.
"""
score = doc.meta.get(self.score_field) # type: ignore
score: Optional[float] = doc.meta.get(self.score_field)
if not isinstance(score, float):
score = None
return score # type: ignore
return score

def _get_doc_score(self, doc: Document) -> Optional[float]:
"""
Expand Down

0 comments on commit e172240

Please sign in to comment.