mtmd: Fix API text completion when no images are sent

This commit is contained in:
oobabooga 2025-08-10 06:54:44 -07:00
parent 0ea62d88f6
commit 1fb5807859

View file

@ -405,7 +405,7 @@ def completions_common(body: dict, is_legacy: bool = False, stream=False):
echo = body['echo']
# Add messages to generate_params if present for multimodal processing
if 'messages' in body:
if body.get('messages'):
generate_params['messages'] = body['messages']
raw_images = convert_openai_messages_to_images(generate_params['messages'])
if raw_images: