Omnibus commited on
Commit
a8a0883
1 Parent(s): 3840b5a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -29,10 +29,13 @@ def query2(fetch_url):
29
  def find_fn(inp,out_json):
30
  print(out_json['rows'])
31
  print (inp)
 
32
  for rows in out_json['rows']:
33
- print (rows['row']['image']['src'])
34
- return(f'{out_json}["rows"][0]')
35
- with gr.Blocks() as app:
 
 
36
  with gr.Row():
37
  data_set_url=gr.Textbox()
38
  fetch_btn=gr.Button()
@@ -41,8 +44,10 @@ with gr.Blocks() as app:
41
  find_btn=gr.Button("Search")
42
  with gr.Row():
43
  out_json = gr.JSON()
44
- out_find = gr.JSON()
 
 
45
 
46
- find_btn.click(find_fn,[find_string,out_json],out_find)
47
  fetch_btn.click(query2,data_set_url,out_json)
48
  app.launch()
 
29
  def find_fn(inp,out_json):
30
  print(out_json['rows'])
31
  print (inp)
32
+ img_list=[]
33
  for rows in out_json['rows']:
34
+ img_ea = rows['row']['image']['src']
35
+ img_list.append(img_ea)
36
+
37
+ return img_list,img_list
38
+ with gr.Blocks() as app:
39
  with gr.Row():
40
  data_set_url=gr.Textbox()
41
  fetch_btn=gr.Button()
 
44
  find_btn=gr.Button("Search")
45
  with gr.Row():
46
  out_json = gr.JSON()
47
+ with gr.Column():
48
+ out_gal = gr.Gallery()
49
+ out_find = gr.JSON()
50
 
51
+ find_btn.click(find_fn,[find_string,out_json],[out_find,out_gal])
52
  fetch_btn.click(query2,data_set_url,out_json)
53
  app.launch()