mattb512 commited on
Commit
ab79b9b
1 Parent(s): f5ea725

move warning

Browse files
Files changed (1) hide show
  1. serve/gradio_web_server.py +1 -1
serve/gradio_web_server.py CHANGED
@@ -116,7 +116,6 @@ def add_text(state, text, image, image_process_mode, request: gr.Request):
116
  # logger.info(f"add_text. ip: {request.client.host}. len: {len(text)}")
117
 
118
  if not text or not image:
119
- gr.Warning("Please provide both a prompt and an image.")
120
  state.skip_next = True
121
  return (state, state.to_gradio_chatbot(), "", None) + (no_change_btn,) * 5
122
 
@@ -151,6 +150,7 @@ def http_bot(state, model_selector, interaction_mode, temperature, max_new_token
151
 
152
  if state.skip_next:
153
  # This generate call is skipped due to invalid inputs
 
154
  yield (state, state.to_gradio_chatbot()) + (no_change_btn,) * 5
155
  return
156
 
 
116
  # logger.info(f"add_text. ip: {request.client.host}. len: {len(text)}")
117
 
118
  if not text or not image:
 
119
  state.skip_next = True
120
  return (state, state.to_gradio_chatbot(), "", None) + (no_change_btn,) * 5
121
 
 
150
 
151
  if state.skip_next:
152
  # This generate call is skipped due to invalid inputs
153
+ gr.Warning("Please provide both a prompt and an image.")
154
  yield (state, state.to_gradio_chatbot()) + (no_change_btn,) * 5
155
  return
156