Dongxu Li commited on
Commit
7ca3a4a
1 Parent(s): 20366bb
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -125,11 +125,11 @@ def inference_caption(
125
  return output[0]
126
 
127
 
128
- def clear_fn(image_input, chatbot, chat_input, caption_output, state):
129
- if image_input is None:
130
- return (None, "", "", [])
131
- else:
132
- return chatbot, chat_input, caption_output, state
133
 
134
 
135
  title = """<h1 align="center">BLIP-2</h1>"""
@@ -249,9 +249,9 @@ with gr.Blocks() as iface:
249
  )
250
 
251
  image_input.change(
252
- clear_fn,
253
- [image_input, chatbot, chat_input, caption_output, state],
254
- [chatbot, chat_input, caption_output, state]
255
  )
256
 
257
  examples = gr.Examples(
 
125
  return output[0]
126
 
127
 
128
+ # def clear_fn(image_input, chatbot, chat_input, caption_output, state):
129
+ # # if image_input is None:
130
+ # return (None, "", "", [])
131
+ # else:
132
+ # return chatbot, chat_input, caption_output, state
133
 
134
 
135
  title = """<h1 align="center">BLIP-2</h1>"""
 
249
  )
250
 
251
  image_input.change(
252
+ lambda: ("", "", []),
253
+ [],
254
+ [chatbot, caption_output, state]
255
  )
256
 
257
  examples = gr.Examples(