From eccacec4f119897e9dc6f3bf9273f7fc7966a973 Mon Sep 17 00:00:00 2001 From: Chessing234 <134995372+Chessing234@users.noreply.github.com> Date: Mon, 4 May 2026 22:37:41 +0530 Subject: [PATCH] fix(arena): pass full conversation history to moderate_input in vision anony arena The third argument to moderate_input should be all_conv_text (the full conversation history from both models), not just the current user message. Without this, multi-turn conversations bypass content moderation because only the current short input is checked, not prior model responses. --- fastchat/serve/gradio_block_arena_vision_anony.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fastchat/serve/gradio_block_arena_vision_anony.py b/fastchat/serve/gradio_block_arena_vision_anony.py index d4d4d484e..1e3df8c5f 100644 --- a/fastchat/serve/gradio_block_arena_vision_anony.py +++ b/fastchat/serve/gradio_block_arena_vision_anony.py @@ -311,8 +311,15 @@ def add_text( images = convert_images_to_conversation_format(images) + all_conv_text_left = states[0].conv.get_prompt() + all_conv_text_right = states[1].conv.get_prompt() + all_conv_text = ( + all_conv_text_left[-1000:] + all_conv_text_right[-1000:] + " +user: " + text + ) + text, image_flagged, csam_flag = moderate_input( - state0, text, text, model_list, images, ip + state0, text, all_conv_text, model_list, images, ip ) conv = states[0].conv