Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
BabyChouSr committed Nov 28, 2024
1 parent d7a152a commit 2ef314b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion fastchat/serve/gradio_block_arena_vision_anony.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ def add_text(

# Use the first state to get the moderation response because this is based on user input so it is independent of the model
moderation_image_input = images[0] if len(images) > 0 else None
moderation_type_to_response_map = states[0].content_moderator.image_and_text_moderation_filter(
moderation_type_to_response_map = states[
0
].content_moderator.image_and_text_moderation_filter(
moderation_image_input, text, model_list, do_moderation=True
)
text_flagged, nsfw_flag, csam_flag = (
Expand Down
4 changes: 3 additions & 1 deletion fastchat/serve/gradio_block_arena_vision_named.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ def add_text(

# Use the first state to get the moderation response because this is based on user input so it is independent of the model
moderation_image_input = images[0] if len(images) > 0 else None
moderation_type_to_response_map = states[0].content_moderator.image_and_text_moderation_filter(
moderation_type_to_response_map = states[
0
].content_moderator.image_and_text_moderation_filter(
moderation_image_input, text, model_list, do_moderation=False
)
text_flagged, nsfw_flag, csam_flag = (
Expand Down

0 comments on commit 2ef314b

Please sign in to comment.