Refactor error handling for multiple exceptions in preprocessing (#15650)

Signed-off-by: JasonZhu1313 <jasonchu13@outlook.com>
This commit is contained in:
Jason (Siyu) Zhu
2025-03-28 03:27:20 +00:00
committed by GitHub
parent 4d0ec37267
commit cec8c7d7f8
4 changed files with 5 additions and 28 deletions
+1 -4
View File
@@ -139,10 +139,7 @@ class OpenAIServingEmbedding(OpenAIServing):
truncate_prompt_tokens=truncate_prompt_tokens,
add_special_tokens=request.add_special_tokens,
)
except ValueError as e:
logger.exception("Error in preprocessing prompt inputs")
return self.create_error_response(str(e))
except TypeError as e:
except (ValueError, TypeError) as e:
logger.exception("Error in preprocessing prompt inputs")
return self.create_error_response(str(e))