Skip to content

Commit 83bd551

Browse files
AuferGachetYzc216LiqinruiGCopilot
authored
[Optimize]Error messages about Model api. (#3839)
* add v1/models interface related * add model parameters * default model verification * unit test * check model err_msg * unit test * type annotation * model parameter in response * modify document description * modify document description * unit test * verification * verification update * model_name * pre-commit * update test case * update test case * Update tests/entrypoints/openai/test_serving_models.py Co-authored-by: Copilot <[email protected]> * Update tests/entrypoints/openai/test_serving_models.py Co-authored-by: Copilot <[email protected]> * Update tests/entrypoints/openai/test_serving_models.py Co-authored-by: Copilot <[email protected]> * Update tests/entrypoints/openai/test_serving_models.py Co-authored-by: Copilot <[email protected]> * Update fastdeploy/entrypoints/openai/serving_models.py Co-authored-by: Copilot <[email protected]> * 优化报错信息。 --------- Co-authored-by: yangzichao01 <[email protected]> Co-authored-by: Yzc216 <[email protected]> Co-authored-by: LiqinruiG <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent aadd6a9 commit 83bd551

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

fastdeploy/entrypoints/openai/serving_chat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ async def create_chat_completion(self, request: ChatCompletionRequest):
9191
if self.models:
9292
is_supported, request.model = self.models.is_supported_model(request.model)
9393
if not is_supported:
94-
err_msg = f"Unsupported model: {request.model}, support {', '.join([x.name for x in self.models.model_paths])} or default"
94+
err_msg = f"Unsupported model: [{request.model}], support [{', '.join([x.name for x in self.models.model_paths])}] or default"
9595
api_server_logger.error(err_msg)
9696
return ErrorResponse(message=err_msg, code=400)
9797

fastdeploy/entrypoints/openai/serving_completion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async def create_completion(self, request: CompletionRequest):
6767
if self.models:
6868
is_supported, request.model = self.models.is_supported_model(request.model)
6969
if not is_supported:
70-
err_msg = f"Unsupported model: {request.model}, support {', '.join([x.name for x in self.models.model_paths])} or default"
70+
err_msg = f"Unsupported model: [{request.model}], support [{', '.join([x.name for x in self.models.model_paths])}] or default"
7171
api_server_logger.error(err_msg)
7272
return ErrorResponse(message=err_msg, code=400)
7373
created_time = int(time.time())

tests/entrypoints/openai/test_serving_models.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
"""
2-
# Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
3-
#
4-
# Licensed under the Apache License, Version 2.0 (the "License"
5-
# you may not use this file except in compliance with the License.
6-
# You may obtain a copy of the License at
7-
#
8-
# http://www.apache.org/licenses/LICENSE-2.0
9-
#
10-
# Unless required by applicable law or agreed to in writing, software
11-
# distributed under the License is distributed on an "AS IS" BASIS,
12-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
# See the License for the specific language governing permissions and
14-
# limitations under the License.
15-
"""
16-
171
import asyncio
182
import unittest
193

0 commit comments

Comments
 (0)