[XPU][CI] fix ci case bug#5084
Conversation
Redirect output of stop_processes to kill.log to capture logs.
Added logging of server.log for failed tests.
Updated assertion to check for multiple keywords in response.
|
Thanks for your contribution! |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in the XPU CI test case for the 45VL model. The change updates the assertion logic to be more flexible by checking for any of multiple possible keywords in the response instead of a single hardcoded value.
Key changes:
- Removed the hardcoded
base_responsevariable - Updated assertion to check for multiple acceptable keywords in the model response
| print(response.choices[0].message.content) | ||
| # print(base_response) | ||
| assert base_response in response.choices[0].message.content | ||
| assert any(keyword in response.choices[0].message.content for keyword in ["北魏", "北齐", "释迦牟尼"]) |
There was a problem hiding this comment.
The function assertany does not exist in Python. This should be assert any(...) to properly check if any of the keywords exists in the response content.
| print(response.choices[0].message.content) | ||
| # print(base_response) | ||
| assert base_response in response.choices[0].message.content | ||
| assert any(keyword in response.choices[0].message.content for keyword in ["北魏", "北齐", "释迦牟尼"]) |
There was a problem hiding this comment.
The assertion lacks an error message. Consider adding a descriptive message to help diagnose test failures: assert any(keyword in response.choices[0].message.content for keyword in [\"北魏\", \"北齐\", \"释迦牟尼\"]), f\"Expected one of ['北魏', '北齐', '释迦牟尼'] in response, but got: {response.choices[0].message.content}\"
| assert any(keyword in response.choices[0].message.content for keyword in ["北魏", "北齐", "释迦牟尼"]) | |
| assert any(keyword in response.choices[0].message.content for keyword in ["北魏", "北齐", "释迦牟尼"]), \ | |
| f"Expected one of ['北魏', '北齐', '释迦牟尼'] in response, but got: {response.choices[0].message.content}" |
Motivation
Modifications
Usage or Command
Accuracy Tests
Checklist
[FDConfig],[APIServer],[Engine],[Scheduler],[PD Disaggregation],[Executor],[Graph Optimization],[Speculative Decoding],[RL],[Models],[Quantization],[Loader],[OP],[KVCache],[DataProcessor],[BugFix],[Docs],[CI],[Optimization],[Feature],[Benchmark],[Others],[XPU],[HPU],[GCU],[DCU],[Iluvatar],[Metax]]pre-commitbefore commit.releasebranch, make sure the PR has been submitted to thedevelopbranch, then cherry-pick it to thereleasebranch with the[Cherry-Pick]PR tag.