Omnibus commited on
Commit
adee038
1 Parent(s): b7ddb79

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -37,17 +37,17 @@ def query2(fetch_url,config="TEST",split="test",offset=0,length=10):
37
  dictionary=response.json()
38
  return dictionary
39
 
40
- def find_fn(inp,out_json):
41
  #print(out_json['rows'])
42
  #print (inp)
43
  img_list=[]
44
- #out_json1=query2(,offset=10,length=20)
45
 
46
  inp=inp.strip("[]")
47
  print(inp)
48
- for ea,val in enumerate(out_json[f"{inp}"]):
49
  #img_ea = ea['row']['image']['src']
50
- img_list.append(val)
51
 
52
  return img_list
53
  with gr.Blocks() as app:
@@ -70,6 +70,6 @@ with gr.Blocks() as app:
70
  out_gal = gr.Gallery()
71
 
72
  view_data.click(query2,[data_set_url,config_set,split_set],[out_find])
73
- find_btn.click(find_fn,[find_string,out_json],[out_find,out_gal])
74
  fetch_btn.click(query1,data_set_url,out_json)
75
  app.launch()
 
37
  dictionary=response.json()
38
  return dictionary
39
 
40
+ def find_fn(inp,fetch_url,config="TEST",split="test",offset=0,length=10):
41
  #print(out_json['rows'])
42
  #print (inp)
43
  img_list=[]
44
+ out_json1=query2(fetch_url,config,split,offset=10,length=20)
45
 
46
  inp=inp.strip("[]")
47
  print(inp)
48
+ for ea in out_json[f"{inp}"]:
49
  #img_ea = ea['row']['image']['src']
50
+ img_list.append(ea)
51
 
52
  return img_list
53
  with gr.Blocks() as app:
 
70
  out_gal = gr.Gallery()
71
 
72
  view_data.click(query2,[data_set_url,config_set,split_set],[out_find])
73
+ find_btn.click(find_fn,[find_string,data_set_url,config_set,split_set],[out_find])
74
  fetch_btn.click(query1,data_set_url,out_json)
75
  app.launch()