mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-12-24 13:28:13 +08:00
【Fix】 remove text_after_process & raw_prediction (#4421)
* remove text_after_process & raw_prediction * remove text_after_process & raw_prediction
This commit is contained in:
@@ -57,7 +57,7 @@ class TestCompletionEcho(unittest.IsolatedAsyncioTestCase):
|
||||
model_name="test_model",
|
||||
prompt_batched_token_ids=[[1, 2]],
|
||||
completion_batched_token_ids=[[3, 4, 5]],
|
||||
text_after_process_list=["test prompt"],
|
||||
prompt_tokens_list=["test prompt"],
|
||||
)
|
||||
|
||||
self.assertEqual(response.choices[0].text, "test prompt generated text")
|
||||
@@ -90,7 +90,7 @@ class TestCompletionEcho(unittest.IsolatedAsyncioTestCase):
|
||||
model_name="test_model",
|
||||
prompt_batched_token_ids=[[1, 2]],
|
||||
completion_batched_token_ids=[[3, 4, 5]],
|
||||
text_after_process_list=["test prompt"],
|
||||
prompt_tokens_list=["test prompt"],
|
||||
)
|
||||
self.assertEqual(response.choices[0].text, "decoded_[1, 2, 3] generated text")
|
||||
|
||||
@@ -123,7 +123,7 @@ class TestCompletionEcho(unittest.IsolatedAsyncioTestCase):
|
||||
model_name="test_model",
|
||||
prompt_batched_token_ids=[[1], [2]],
|
||||
completion_batched_token_ids=[[1, 2], [3, 4]],
|
||||
text_after_process_list=["prompt1", "prompt2"],
|
||||
prompt_tokens_list=["prompt1", "prompt2"],
|
||||
)
|
||||
|
||||
self.assertEqual(len(response.choices), 2)
|
||||
@@ -159,7 +159,7 @@ class TestCompletionEcho(unittest.IsolatedAsyncioTestCase):
|
||||
model_name="test_model",
|
||||
prompt_batched_token_ids=[[1], [2]],
|
||||
completion_batched_token_ids=[[1, 2], [3, 4]],
|
||||
text_after_process_list=["prompt1", "prompt2"],
|
||||
prompt_tokens_list=["prompt1", "prompt2"],
|
||||
)
|
||||
|
||||
self.assertEqual(len(response.choices), 2)
|
||||
|
||||
@@ -160,7 +160,7 @@ class TestMaxStreamingResponseTokens(IsolatedAsyncioTestCase):
|
||||
request_id="test-request-id",
|
||||
model_name="test-model",
|
||||
prompt_token_ids=[1, 2, 3],
|
||||
text_after_process="Hello",
|
||||
prompt_tokens="Hello",
|
||||
)
|
||||
|
||||
chunks = []
|
||||
@@ -242,7 +242,7 @@ class TestMaxStreamingResponseTokens(IsolatedAsyncioTestCase):
|
||||
model_name="test-model",
|
||||
created_time=11,
|
||||
prompt_batched_token_ids=[[1, 2, 3]],
|
||||
text_after_process_list=["Hello"],
|
||||
prompt_tokens_list=["Hello"],
|
||||
)
|
||||
|
||||
chunks = []
|
||||
|
||||
@@ -54,8 +54,8 @@ INVALID_INPUT_BATCH = """
|
||||
"""
|
||||
|
||||
BATCH_RESPONSE = """
|
||||
{"id":"fastdeploy-7fcc30e2e4334fca806c4d01ee7ac4ab","custom_id":"req-00001","response":{"status_code":200,"request_id":"fastdeploy-batch-5f4017beded84b15aa3a8b0f1fce154c","body":{"id":"chatcmpl-33b09ae5-a8f1-40ad-9110-efa2b381eac9","object":"chat.completion","created":1758698637,"model":"/root/paddlejob/zhaolei36/ernie-4_5-0_3b-bf16-paddle","choices":[{"index":0,"message":{"role":"assistant","content":"In a sunlit meadow where dreams bloom,\\nA gentle breeze carries the breeze,\\nThe leaves rustle like ancient letters,\\nAnd in the sky, a song of hope and love.","multimodal_content":null,"reasoning_content":null,"tool_calls":null,"prompt_token_ids":null,"completion_token_ids":null,"text_after_process":null,"raw_prediction":null,"prompt_tokens":null,"completion_tokens":null},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":19,"total_tokens":60,"completion_tokens":41,"prompt_tokens_details":{"cached_tokens":0}}}},"error":null}
|
||||
{"id":"fastdeploy-bf549849df2145598ae1758ba260f784","custom_id":"req-00002","response":{"status_code":200,"request_id":"fastdeploy-batch-81223f12fdc345efbfe85114ced10a1d","body":{"id":"chatcmpl-9479e36c-1542-45ff-b364-1dc6d34be9e7","object":"chat.completion","created":1758698637,"model":"/root/paddlejob/zhaolei36/ernie-4_5-0_3b-bf16-paddle","choices":[{"index":0,"message":{"role":"assistant","content":"Based on the given text, here are some possible actions you can take:\\n\\n1. **Read the question**: To understand what you can do, you can read the question (id=2) and analyze its requirements or constraints.\\n2. **Identify the keywords**: Look for specific keywords or phrases that describe what you can do. For example, if the question mentions \\"coding,\\" you can focus on coding skills or platforms.\\n3. **Brainstorm ideas**: You can think creatively about different ways to perform the action. For example, you could brainstorm different methods of communication, data analysis, or problem-solving.\\n4. **Explain your action**: If you have knowledge or skills in a particular area, you can explain how you would use those skills to achieve the desired outcome.\\n5. **Ask for help**: If you need assistance, you can ask for help from a friend, teacher, or mentor.","multimodal_content":null,"reasoning_content":null,"tool_calls":null,"prompt_token_ids":null,"completion_token_ids":null,"text_after_process":null,"raw_prediction":null,"prompt_tokens":null,"completion_tokens":null},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":17,"total_tokens":211,"completion_tokens":194,"prompt_tokens_details":{"cached_tokens":0}}}},"error":null}
|
||||
{"id":"fastdeploy-7fcc30e2e4334fca806c4d01ee7ac4ab","custom_id":"req-00001","response":{"status_code":200,"request_id":"fastdeploy-batch-5f4017beded84b15aa3a8b0f1fce154c","body":{"id":"chatcmpl-33b09ae5-a8f1-40ad-9110-efa2b381eac9","object":"chat.completion","created":1758698637,"model":"/root/paddlejob/zhaolei36/ernie-4_5-0_3b-bf16-paddle","choices":[{"index":0,"message":{"role":"assistant","content":"In a sunlit meadow where dreams bloom,\\nA gentle breeze carries the breeze,\\nThe leaves rustle like ancient letters,\\nAnd in the sky, a song of hope and love.","multimodal_content":null,"reasoning_content":null,"tool_calls":null,"prompt_token_ids":null,"completion_token_ids":null,"prompt_tokens":null,"completion_tokens":null},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":19,"total_tokens":60,"completion_tokens":41,"prompt_tokens_details":{"cached_tokens":0}}}},"error":null}
|
||||
{"id":"fastdeploy-bf549849df2145598ae1758ba260f784","custom_id":"req-00002","response":{"status_code":200,"request_id":"fastdeploy-batch-81223f12fdc345efbfe85114ced10a1d","body":{"id":"chatcmpl-9479e36c-1542-45ff-b364-1dc6d34be9e7","object":"chat.completion","created":1758698637,"model":"/root/paddlejob/zhaolei36/ernie-4_5-0_3b-bf16-paddle","choices":[{"index":0,"message":{"role":"assistant","content":"Based on the given text, here are some possible actions you can take:\\n\\n1. **Read the question**: To understand what you can do, you can read the question (id=2) and analyze its requirements or constraints.\\n2. **Identify the keywords**: Look for specific keywords or phrases that describe what you can do. For example, if the question mentions \\"coding,\\" you can focus on coding skills or platforms.\\n3. **Brainstorm ideas**: You can think creatively about different ways to perform the action. For example, you could brainstorm different methods of communication, data analysis, or problem-solving.\\n4. **Explain your action**: If you have knowledge or skills in a particular area, you can explain how you would use those skills to achieve the desired outcome.\\n5. **Ask for help**: If you need assistance, you can ask for help from a friend, teacher, or mentor.","multimodal_content":null,"reasoning_content":null,"tool_calls":null,"prompt_token_ids":null,"completion_token_ids":null,"prompt_tokens":null,"completion_tokens":null},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":17,"total_tokens":211,"completion_tokens":194,"prompt_tokens_details":{"cached_tokens":0}}}},"error":null}
|
||||
"""
|
||||
|
||||
|
||||
@@ -867,8 +867,6 @@ class TestFileOperations(unittest.TestCase):
|
||||
tool_calls=message_data["tool_calls"],
|
||||
prompt_token_ids=message_data["prompt_token_ids"],
|
||||
completion_token_ids=message_data["completion_token_ids"],
|
||||
text_after_process=message_data["text_after_process"],
|
||||
raw_prediction=message_data["raw_prediction"],
|
||||
prompt_tokens=message_data["prompt_tokens"],
|
||||
completion_tokens=message_data["completion_tokens"],
|
||||
)
|
||||
|
||||
@@ -155,7 +155,7 @@ class TestOpenAIServingCompletion(unittest.TestCase):
|
||||
model_name=model_name,
|
||||
prompt_batched_token_ids=prompt_batched_token_ids,
|
||||
completion_batched_token_ids=completion_batched_token_ids,
|
||||
text_after_process_list=["1", "1"],
|
||||
prompt_tokens_list=["1", "1"],
|
||||
)
|
||||
|
||||
assert completion_response.id == request_id
|
||||
|
||||
Reference in New Issue
Block a user