Omnibus commited on
Commit
0692207
1 Parent(s): 6a3f081

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -209,7 +209,7 @@ function() {
209
  return [link_url];
210
  }
211
  """
212
- def update_im(im=None):
213
  return im
214
 
215
  with gr.Blocks() as app:
@@ -235,12 +235,13 @@ with gr.Blocks() as app:
235
  title=gr.Textbox(label="Title")
236
  description=gr.Textbox(label="Description")
237
  link_list=gr.Textbox(label="Image URL")
238
-
239
  with gr.Column():
240
- prvw_btn=gr.Button("Update")
241
  bld_btn=gr.Button("Build Card")
242
  app.load(None,None,link_list,js=load_js)
243
  app.load(None,None,link_list,js=link_js)
 
244
  images.change(update_im,None,link_list,trigger_mode="multiple",js=link_js)
245
  search_btn.click(search_fn,[search_box,num_return],output)
246
  btn.click(first,None,output).then(test_single,input,output).then(details_fn,input,[details,images,title,description])
 
209
  return [link_url];
210
  }
211
  """
212
+ def prepare_card(im):
213
  return im
214
 
215
  with gr.Blocks() as app:
 
235
  title=gr.Textbox(label="Title")
236
  description=gr.Textbox(label="Description")
237
  link_list=gr.Textbox(label="Image URL")
238
+ img_card=gr.Image()
239
  with gr.Column():
240
+ prepare_btn=gr.Button("Prepare Card")
241
  bld_btn=gr.Button("Build Card")
242
  app.load(None,None,link_list,js=load_js)
243
  app.load(None,None,link_list,js=link_js)
244
+ prepare_btn.click(None,None,[link_list],js=link_js).then(prepare_card,link_list,img_card)
245
  images.change(update_im,None,link_list,trigger_mode="multiple",js=link_js)
246
  search_btn.click(search_fn,[search_box,num_return],output)
247
  btn.click(first,None,output).then(test_single,input,output).then(details_fn,input,[details,images,title,description])