Spaces:
BAAI
/
Running on L40S

ryanzhangfan commited on
Commit
532bbbc
1 Parent(s): 24e3e3c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -213,21 +213,22 @@ with gr.Blocks() as demo:
213
  "This is a chatbot demo for image generation and vision-language understanding using Emu3 models."
214
  )
215
  gr.Markdown(
216
- "Please pass only text input for image generation and both image and text for vision-language understanding"
217
  )
218
 
219
- chatbot = gr.Chatbot()
220
  state = gr.State([])
221
  with gr.Row():
222
- with gr.Column(scale=0.85):
223
  user_input = gr.Textbox(
224
- show_label=False, placeholder="Type your message here...", lines=2, container=False,
 
 
 
225
  )
226
- with gr.Column(scale=0.15, min_width=0):
227
  submit_btn = gr.Button("Send")
228
- user_image = gr.Image(
229
- sources="upload", type="pil", label="Upload an image (optional)"
230
- )
231
 
232
  submit_btn.click(
233
  chat,
@@ -240,4 +241,4 @@ with gr.Blocks() as demo:
240
  outputs=[chatbot, state, user_image],
241
  ).then(fn=clear_input, inputs=[], outputs=user_input)
242
 
243
- demo.launch()
 
213
  "This is a chatbot demo for image generation and vision-language understanding using Emu3 models."
214
  )
215
  gr.Markdown(
216
+ "Please pass <b>only text input</b> for image generation (~20s) and <b>both image and text</b> for vision-language understanding (~600s)"
217
  )
218
 
 
219
  state = gr.State([])
220
  with gr.Row():
221
+ with gr.Column(scale=0.2):
222
  user_input = gr.Textbox(
223
+ show_label=False, placeholder="Type your message here...", lines=15, container=False,
224
+ )
225
+ user_image = gr.Image(
226
+ sources="upload", type="pil", label="Upload an image (optional)"
227
  )
 
228
  submit_btn = gr.Button("Send")
229
+
230
+ with gr.Column(scale=0.8):
231
+ chatbot = gr.Chatbot(height=800)
232
 
233
  submit_btn.click(
234
  chat,
 
241
  outputs=[chatbot, state, user_image],
242
  ).then(fn=clear_input, inputs=[], outputs=user_input)
243
 
244
+ demo.launch(max_threads=1)