Fix NoneType error of outputs#2315
Conversation
|
@fake0fan PTAL |
|
Please add describtion and fix DCO |
@david6666666 Done |
|
Good catch. LGTM. But I’m just wondering if we should also add some tests for this path, so that this issue does not come back later. cc @Gaohan123 @yenuo26 |
lishunyang12
left a comment
There was a problem hiding this comment.
this fixes the text case but final_res is still None for audio/image-only responses. The logging block at L1588 (if choice.index < len(final_res.outputs)) will crash the same way when there's no text output.
Need to guard that access:
if final_res is not None and choice.index < len(final_res.outputs):| role, | ||
| reasoning_parser, | ||
| ) | ||
| final_res = omni_outputs.request_output |
There was a problem hiding this comment.
Good — this was the missing assignment. But the same final_res is used in the logging block ~40 lines below without a None check, so audio/image-only requests still crash.
There was a problem hiding this comment.
audio/image the output_text should be "", and will not crash, anything wrong?
|
fix dco please |
if --enable-log-outputs --enable-log-requests in cli, it will result an error of NoneType for none-stream requests Signed-off-by: Mike_Qiu <qiudayu.qdy@antgroup.com>
2365996 to
c34da1a
Compare
@hsliuustc0106 Done |
Signed-off-by: Mike_Qiu <qiudayu.qdy@antgroup.com> Co-authored-by: Mike_Qiu <qiudayu.qdy@antgroup.com> Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Signed-off-by: Mike_Qiu <qiudayu.qdy@antgroup.com> Co-authored-by: Mike_Qiu <qiudayu.qdy@antgroup.com> Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Signed-off-by: Mike_Qiu <qiudayu.qdy@antgroup.com> Co-authored-by: Mike_Qiu <qiudayu.qdy@antgroup.com> Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Signed-off-by: Mike_Qiu <qiudayu.qdy@antgroup.com> Co-authored-by: Mike_Qiu <qiudayu.qdy@antgroup.com> Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Signed-off-by: Mike_Qiu <qiudayu.qdy@antgroup.com> Co-authored-by: Mike_Qiu <qiudayu.qdy@antgroup.com> Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
if --enable-log-outputs --enable-log-requests in cli, it will result an error of NoneType for none-stream requests
PLEASE FILL IN THE PR DESCRIPTION HERE ENSURING ALL CHECKLIST ITEMS (AT THE BOTTOM) HAVE BEEN CONSIDERED.
Purpose
Fix omni crash when start with --enable-log-outputs --enable-log-requests
Test Plan
python -m vllm_omni.entrypoints.cli.main serve /root/Jonathan1909/Ming-flash-omni-2.0/ --omni --port 8091 --allowed-local-media-path /root/vllm-omni --stage-configs-path vllm_omni/model_executor/stage_configs/ming_flash_omni.yaml --log-stats --enable-log-outputs --enable-log-requests
Test Result
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] Chat completion failed: 'NoneType' object has no attribute 'outputs'
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] Traceback (most recent call last):
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] File "/root/vllm-omni/vllm_omni/entrypoints/openai/api_server.py", line 853, in create_chat_completion
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] generator = await handler.create_chat_completion(request, raw_request)
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] File "/root/vllm-omni/vllm_omni/entrypoints/openai/serving_chat.py", line 418, in create_chat_completion
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] return await self.chat_completion_full_generator(
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] File "/root/vllm-omni/vllm_omni/entrypoints/openai/serving_chat.py", line 1587, in chat_completion_full_generator
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] if choice.index < len(final_res.outputs):
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] AttributeError: 'NoneType' object has no attribute 'outputs'
final_res does not been initialized.
Essential Elements of an Effective PR Description Checklist
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] Chat completion failed: 'NoneType' object has no attribute 'outputs'
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] Traceback (most recent call last):
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] File "/root/vllm-omni/vllm_omni/entrypoints/openai/api_server.py", line 853, in create_chat_completion
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] generator = await handler.create_chat_completion(request, raw_request)
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] File "/root/vllm-omni/vllm_omni/entrypoints/openai/serving_chat.py", line 418, in create_chat_completion
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] return await self.chat_completion_full_generator(
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] File "/root/vllm-omni/vllm_omni/entrypoints/openai/serving_chat.py", line 1587, in chat_completion_full_generator
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] if choice.index < len(final_res.outputs):
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] AttributeError: 'NoneType' object has no attribute 'outputs'
BEFORE SUBMITTING, PLEASE READ https://github.com/vllm-project/vllm-omni/blob/main/CONTRIBUTING.md (anything written below this line will be removed by GitHub Actions)