Skip to content

Commit

Permalink
Merge pull request #24 from ViseshXX/all-1.1-dev-fastapi
Browse files Browse the repository at this point in the history
Update get-text-matrices to handle empty hypothesis.
  • Loading branch information
sudeeppr1998 authored Jun 4, 2024
2 parents 36393bf + 1ce73bf commit 4625653
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
async def compute_errors(data: TextData):
try:
# Validate input data
if not data.reference or not data.hypothesis:
raise HTTPException(status_code=400, detail="Reference and hypothesis texts must be provided.")
if not data.reference:
raise HTTPException(status_code=400, detail="Reference text must be provided.")

reference = data.reference
hypothesis = data.hypothesis
hypothesis = data.hypothesis if data.hypothesis is not None else ""
language = data.language

# Validate language
Expand Down

0 comments on commit 4625653

Please sign in to comment.