mtmd: Fix "continue" when an image is present

This commit is contained in:
oobabooga 2025-08-09 21:47:02 -07:00
parent 4663b1a56e
commit 0ea62d88f6

View file

@ -868,6 +868,8 @@ def chatbot_wrapper(text, state, regenerate=False, _continue=False, loading_mess
'metadata': output['metadata'] 'metadata': output['metadata']
} }
row_idx = len(output['internal']) - 1
# Collect image attachments for multimodal generation # Collect image attachments for multimodal generation
image_attachments = [] image_attachments = []
if 'metadata' in output: if 'metadata' in output:
@ -895,7 +897,6 @@ def chatbot_wrapper(text, state, regenerate=False, _continue=False, loading_mess
prompt = generate_chat_prompt(text, state, **kwargs) prompt = generate_chat_prompt(text, state, **kwargs)
# Add timestamp for assistant's response at the start of generation # Add timestamp for assistant's response at the start of generation
row_idx = len(output['internal']) - 1
update_message_metadata(output['metadata'], "assistant", row_idx, timestamp=get_current_timestamp(), model_name=shared.model_name) update_message_metadata(output['metadata'], "assistant", row_idx, timestamp=get_current_timestamp(), model_name=shared.model_name)
# Generate # Generate