xxx1 commited on
Commit
e528922
1 Parent(s): 6f78835

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -13
app.py CHANGED
@@ -1,10 +1,8 @@
1
  import string
2
  import gradio as gr
3
  import requests
4
- def inference_caption():
5
- return
6
  def inference_chat(input_image,input_text):
7
- return "hello"
8
 
9
  with gr.Blocks(
10
  css="""
@@ -13,7 +11,7 @@ with gr.Blocks(
13
  """
14
  ) as iface:
15
  state = gr.State([])
16
- #caption_output = state
17
  #gr.Markdown(title)
18
  #gr.Markdown(description)
19
  #gr.Markdown(article)
@@ -22,13 +20,8 @@ with gr.Blocks(
22
  with gr.Column(scale=1):
23
  image_input = gr.Image(type="pil")
24
 
25
-
26
-
27
- with gr.Column(scale=1.8):
28
-
29
  with gr.Row():
30
- with gr.Column():
31
- caption_output = gr.Textbox(lines=1, label="VQA Output")
32
  with gr.Column(scale=1):
33
  chat_input = gr.Textbox(lines=1, label="VQA Input")
34
  chat_input.submit(
@@ -39,7 +32,7 @@ with gr.Blocks(
39
  ],
40
  [ caption_output],
41
  )
42
-
43
  with gr.Row():
44
  clear_button = gr.Button(value="Clear", interactive=True)
45
  clear_button.click(
@@ -48,7 +41,7 @@ with gr.Blocks(
48
  [chat_input, state],
49
  queue=False,
50
  )
51
-
52
  submit_button = gr.Button(
53
  value="Submit", interactive=True, variant="primary"
54
  )
@@ -61,13 +54,15 @@ with gr.Blocks(
61
  [caption_output],
62
  )
63
 
64
-
65
  image_input.change(
66
  lambda: ("", "", []),
67
  [],
68
  [ caption_output, state],
69
  queue=False,
70
  )
 
 
71
 
72
  # examples = gr.Examples(
73
  # examples=examples,
 
1
  import string
2
  import gradio as gr
3
  import requests
 
 
4
  def inference_chat(input_image,input_text):
5
+ return input_text
6
 
7
  with gr.Blocks(
8
  css="""
 
11
  """
12
  ) as iface:
13
  state = gr.State([])
14
+ caption_output = None
15
  #gr.Markdown(title)
16
  #gr.Markdown(description)
17
  #gr.Markdown(article)
 
20
  with gr.Column(scale=1):
21
  image_input = gr.Image(type="pil")
22
 
 
 
 
 
23
  with gr.Row():
24
+
 
25
  with gr.Column(scale=1):
26
  chat_input = gr.Textbox(lines=1, label="VQA Input")
27
  chat_input.submit(
 
32
  ],
33
  [ caption_output],
34
  )
35
+
36
  with gr.Row():
37
  clear_button = gr.Button(value="Clear", interactive=True)
38
  clear_button.click(
 
41
  [chat_input, state],
42
  queue=False,
43
  )
44
+
45
  submit_button = gr.Button(
46
  value="Submit", interactive=True, variant="primary"
47
  )
 
54
  [caption_output],
55
  )
56
 
57
+
58
  image_input.change(
59
  lambda: ("", "", []),
60
  [],
61
  [ caption_output, state],
62
  queue=False,
63
  )
64
+ with gr.Column():
65
+ caption_output = gr.Textbox(lines=1, label="VQA Output")
66
 
67
  # examples = gr.Examples(
68
  # examples=examples,