mtmd: Place the image <__media__> at the top of the prompt

This commit is contained in:
oobabooga 2025-08-09 07:06:07 -07:00
parent 1168004067
commit 3f5ec9644f

View file

@ -289,7 +289,7 @@ def generate_chat_prompt(user_input, state, **kwargs):
if image_refs or attachments_text:
enhanced_user_msg = user_msg
if image_refs:
enhanced_user_msg += f" {image_refs}"
enhanced_user_msg = f"{image_refs}\n\n{enhanced_user_msg}"
if attachments_text:
enhanced_user_msg += f"\n\nATTACHMENTS:\n{attachments_text}"