Skip to content

Commit a21e16e

Browse files
authored
[XPU] fix XPU CI bug (#4358)
* Update assertions for response content in test_45t fix XPU CI bug * Comment out base_response print statement Comment out the print statement for base_response. * Refactor assertion for clarity in run_45T.py * Add blank line before main function call
1 parent a2ec2c4 commit a21e16e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/ci_use/XPU_45T/run_45T.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ def test_45t():
1919
ip = "0.0.0.0"
2020
service_http_port = "8188" # 服务配置的
2121
client = openai.Client(base_url=f"http://{ip}:{service_http_port}/v1", api_key="EMPTY_API_KEY")
22-
base_response = "你好!我是一个基于人工智能技术开发的助手,可以帮你解答问题、提供建议、聊天交流或者完成一些任务。无论是学习、工作还是生活中的疑问,都可以随时告诉我哦~😊 你有什么想聊的吗?"
22+
base_response_110 = "你好!我是一个基于人工智能技术开发的助手,可以帮你解答问题、提供建议、聊天交流或者完成一些任务。无论是学习、工作还是生活中的疑问,都可以随时告诉我哦~😊 你有什么想聊的吗?"
23+
base_response_104 = "你好!我是一个基于人工智能技术打造的助手,可以帮你解答问题、提供建议、分享知识,或者陪你聊聊天~😊 无论是学习、工作、生活还是娱乐相关的问题,都可以随时告诉我哦!你今天有什么想聊的吗?"
2324
# 非流式对话
2425
response = client.chat.completions.create(
2526
model="default",
@@ -32,8 +33,11 @@ def test_45t():
3233
stream=False,
3334
)
3435
print(response.choices[0].message.content)
35-
print(base_response)
36-
assert response.choices[0].message.content == base_response
36+
# print(base_response)
37+
assert (
38+
response.choices[0].message.content == base_response_110
39+
or response.choices[0].message.content == base_response_104
40+
)
3741

3842

3943
if __name__ == "__main__":

0 commit comments

Comments
 (0)