xxx1 commited on
Commit
9e7d233
1 Parent(s): ce95a1e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -17
app.py CHANGED
@@ -41,28 +41,18 @@ with gr.Blocks(
41
  with gr.Column(scale=1):
42
  caption_output = None
43
  chat_input = gr.Textbox(lines=1, label="VQA Input")
44
- chat_input.submit(
45
- inference_chat,
46
- [
47
- image_input,
48
- chat_input,
49
- ],
50
- [ caption_output],
51
- )
52
 
53
  with gr.Row():
54
  clear_button = gr.Button(value="Clear", interactive=True)
55
- clear_button.click(
56
- lambda: ("", [], []),
57
- [],
58
- [chat_input, state],
59
- queue=False,
60
- )
61
 
62
  submit_button = gr.Button(
63
  value="Submit", interactive=True, variant="primary"
64
  )
65
- submit_button.click(
 
 
66
  inference_chat,
67
  [
68
  image_input,
@@ -70,8 +60,20 @@ with gr.Blocks(
70
  ],
71
  [caption_output],
72
  )
73
- caption_output = gr.Textbox(lines=1, label="VQA Output")
74
-
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
  image_input.change(
77
  lambda: ("", "", []),
41
  with gr.Column(scale=1):
42
  caption_output = None
43
  chat_input = gr.Textbox(lines=1, label="VQA Input")
44
+
 
 
 
 
 
 
 
45
 
46
  with gr.Row():
47
  clear_button = gr.Button(value="Clear", interactive=True)
48
+
 
 
 
 
 
49
 
50
  submit_button = gr.Button(
51
  value="Submit", interactive=True, variant="primary"
52
  )
53
+
54
+ caption_output = gr.Textbox(lines=1, label="VQA Output")
55
+ submit_button.click(
56
  inference_chat,
57
  [
58
  image_input,
60
  ],
61
  [caption_output],
62
  )
63
+ clear_button.click(
64
+ lambda: ("", [], []),
65
+ [],
66
+ [chat_input, state],
67
+ queue=False,
68
+ )
69
+ chat_input.submit(
70
+ inference_chat,
71
+ [
72
+ image_input,
73
+ chat_input,
74
+ ],
75
+ [ caption_output],
76
+ )
77
 
78
  image_input.change(
79
  lambda: ("", "", []),