Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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,
|
41 |
#print(out_json['rows'])
|
42 |
#print (inp)
|
43 |
img_list=[]
|
44 |
-
|
45 |
|
46 |
inp=inp.strip("[]")
|
47 |
print(inp)
|
48 |
-
for ea
|
49 |
#img_ea = ea['row']['image']['src']
|
50 |
-
img_list.append(
|
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,
|
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()
|