Skip to content

Commit

Permalink
remove inactive
Browse files Browse the repository at this point in the history
  • Loading branch information
infwinston committed Oct 20, 2023
1 parent bdccc9d commit 4a064f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fastchat/serve/gradio_web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,10 @@ def add_text(state, model_selector, text, request: gr.Request):
state.skip_next = True
return (state, state.to_gradio_chatbot(), "") + (no_change_btn,) * 5

if ip_expiration_dict[ip] < time.time():
logger.info(f"inactive. ip: {request.client.host}. text: {text}")
state.skip_next = True
return (state, state.to_gradio_chatbot(), INACTIVE_MSG) + (no_change_btn,) * 5
# if ip_expiration_dict[ip] < time.time():
# logger.info(f"inactive. ip: {request.client.host}. text: {text}")
# state.skip_next = True
# return (state, state.to_gradio_chatbot(), INACTIVE_MSG) + (no_change_btn,) * 5

if enable_moderation:
flagged = violates_moderation(text)
Expand Down

0 comments on commit 4a064f2

Please sign in to comment.