[Bugfix] Do not add extra \n for image-only cases when constructing multimodal text prompts. (#33647)
Signed-off-by: wang.yuqi <yuqi.wang@daocloud.io>
This commit is contained in:
@@ -1164,7 +1164,10 @@ def _get_full_multimodal_text_prompt(
|
|||||||
|
|
||||||
# NOTE: Default behaviour: we always add missing placeholders
|
# NOTE: Default behaviour: we always add missing placeholders
|
||||||
# at the front of the prompt, if interleave_strings=False
|
# at the front of the prompt, if interleave_strings=False
|
||||||
return "\n".join(missing_placeholders + [text_prompt])
|
if text_prompt:
|
||||||
|
return "\n".join(missing_placeholders + [text_prompt])
|
||||||
|
else:
|
||||||
|
return "\n".join(missing_placeholders)
|
||||||
|
|
||||||
|
|
||||||
# No need to validate using Pydantic again
|
# No need to validate using Pydantic again
|
||||||
|
|||||||
Reference in New Issue
Block a user