mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-12-24 13:28:13 +08:00
[BugFix] Fix finish reason in _create_chat_completion_choice (#4582)
* fix n_param _create_chat_completion_choicel * fix unit test * fix final_res * modify unit tests
This commit is contained in:
@@ -412,7 +412,7 @@ class TestMaxStreamingResponseTokens(IsolatedAsyncioTestCase):
|
||||
"test_data": {
|
||||
"request_id": "test_1",
|
||||
"outputs": {
|
||||
"token_ids": [789],
|
||||
"token_ids": [123, 456, 789],
|
||||
"text": "Edge case response",
|
||||
"reasoning_content": None,
|
||||
"tool_call": None,
|
||||
@@ -424,7 +424,7 @@ class TestMaxStreamingResponseTokens(IsolatedAsyncioTestCase):
|
||||
"previous_num_tokens": 1,
|
||||
},
|
||||
"mock_request": ChatCompletionRequest(
|
||||
model="test", messages=[], return_token_ids=True, max_tokens=5, n=2
|
||||
model="test", messages=[], return_token_ids=True, max_tokens=1, n=2
|
||||
),
|
||||
"expected": {
|
||||
"index": 1,
|
||||
@@ -434,7 +434,7 @@ class TestMaxStreamingResponseTokens(IsolatedAsyncioTestCase):
|
||||
"raw_prediction": None,
|
||||
"num_cached_tokens": 0,
|
||||
"num_image_tokens": 0,
|
||||
"finish_reason": "stop",
|
||||
"finish_reason": "length",
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user