Skip to content

Commit 47a91e8

Browse files
author
Denis Megerle
committed
fix: ensure compatibility with downstream image processing in ToolAgentLoop
- Updated ToolAgentLoop to handle cases where no new images or videos are available by passing None, maintaining compatibility with downstream processing logic.
1 parent b5979db commit 47a91e8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

verl/experimental/agent_loop/tool_agent_loop.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,14 @@ async def _handle_processing_tools_state(self, agent_data: AgentData) -> AgentSt
353353
None, lambda: self.tokenizer.encode(tool_response_text, add_special_tokens=False)
354354
)
355355
else:
356+
# Note that we have to pass None to the images and videos if there are no new images / videos
357+
# to stay compatible with downstream image processing logic!
358+
images = new_images_this_turn if new_images_this_turn else None
359+
videos = None
356360
response_ids = await self.apply_chat_template(
357361
add_messages,
358-
images=new_images_this_turn, # Using local variable
359-
videos=None,
362+
images=images,
363+
videos=videos,
360364
remove_system_prompt=True,
361365
)
362366

0 commit comments

Comments
 (0)