Niki Zhang commited on
Commit
4fc5f55
·
verified ·
1 Parent(s): ecd56c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -623,9 +623,7 @@ async def chat_input_callback(*args):
623
 
624
 
625
  def upload_callback(image_input, state, visual_chatgpt=None, openai_api_key=None,language="English"):
626
- if isinstance(image_input, dict): # if upload from sketcher_input, input contains image and mask
627
- image_input, mask = image_input['image'], image_input['mask']
628
-
629
  click_state = [[], [], []]
630
  image_input = image_resize(image_input, res=1024)
631
 
@@ -1342,10 +1340,9 @@ def create_ui():
1342
  sketcher_input = gr.ImageEditor(type="pil", interactive=True,
1343
  elem_id="image_sketcher")
1344
  example_image = gr.Image(type="pil", interactive=False, visible=False)
1345
- with gr.Row():
1346
- clear_button_sketcher = gr.Button(value="Clear Sketch", interactive=True)
1347
  submit_button_sketcher = gr.Button(value="Submit", interactive=True)
1348
-
1349
  with gr.Row():
1350
  with gr.Row():
1351
  focus_type_sketch = gr.Radio(
 
623
 
624
 
625
  def upload_callback(image_input, state, visual_chatgpt=None, openai_api_key=None,language="English"):
626
+
 
 
627
  click_state = [[], [], []]
628
  image_input = image_resize(image_input, res=1024)
629
 
 
1340
  sketcher_input = gr.ImageEditor(type="pil", interactive=True,
1341
  elem_id="image_sketcher")
1342
  example_image = gr.Image(type="pil", interactive=False, visible=False)
1343
+ with gr.Row():
 
1344
  submit_button_sketcher = gr.Button(value="Submit", interactive=True)
1345
+ clear_button_sketcher = gr.Button(value="Clear Sketch", interactive=True)
1346
  with gr.Row():
1347
  with gr.Row():
1348
  focus_type_sketch = gr.Radio(