Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -18,13 +18,13 @@ def query1(fetch_url):
|
|
18 |
drop_box = []
|
19 |
for obj in json_obj:
|
20 |
print (obj)
|
21 |
-
out_config = obj[0]
|
22 |
-
out_split = obj[
|
23 |
print (out_config)
|
24 |
print (out_split)
|
25 |
drop_box.append(obj[0])
|
26 |
#df = pd.DataFrame.from_dict(json_obj)
|
27 |
-
return
|
28 |
|
29 |
|
30 |
def query2(fetch_url,config="TEST",split="test",offset=0,length=10):
|
@@ -52,9 +52,9 @@ with gr.Blocks() as app:
|
|
52 |
data_set_url=gr.Textbox(label="Dataset (repo/name)")
|
53 |
fetch_btn=gr.Button()
|
54 |
with gr.Row():
|
55 |
-
|
56 |
-
|
57 |
-
config_drop = gr.Dropdown(label="Config/Split", choices=[])
|
58 |
view_data=gr.Button(label="View")
|
59 |
with gr.Row():
|
60 |
find_string=gr.Textbox()
|
@@ -65,7 +65,7 @@ with gr.Blocks() as app:
|
|
65 |
out_find = gr.JSON()
|
66 |
out_gal = gr.Gallery()
|
67 |
|
68 |
-
view_data.click(query2,[data_set_url,
|
69 |
find_btn.click(find_fn,[find_string,out_json],[out_find,out_gal])
|
70 |
-
fetch_btn.click(query1,data_set_url,
|
71 |
app.launch()
|
|
|
18 |
drop_box = []
|
19 |
for obj in json_obj:
|
20 |
print (obj)
|
21 |
+
out_config = obj[0]
|
22 |
+
out_split = obj[1]
|
23 |
print (out_config)
|
24 |
print (out_split)
|
25 |
drop_box.append(obj[0])
|
26 |
#df = pd.DataFrame.from_dict(json_obj)
|
27 |
+
return json_obj
|
28 |
|
29 |
|
30 |
def query2(fetch_url,config="TEST",split="test",offset=0,length=10):
|
|
|
52 |
data_set_url=gr.Textbox(label="Dataset (repo/name)")
|
53 |
fetch_btn=gr.Button()
|
54 |
with gr.Row():
|
55 |
+
config_set=gr.Textbox(label="Config")
|
56 |
+
split_set=gr.Textbox(label="Split")
|
57 |
+
#config_drop = gr.Dropdown(label="Config/Split", choices=[])
|
58 |
view_data=gr.Button(label="View")
|
59 |
with gr.Row():
|
60 |
find_string=gr.Textbox()
|
|
|
65 |
out_find = gr.JSON()
|
66 |
out_gal = gr.Gallery()
|
67 |
|
68 |
+
view_data.click(query2,[data_set_url,config_set,split_set],[out_find])
|
69 |
find_btn.click(find_fn,[find_string,out_json],[out_find,out_gal])
|
70 |
+
fetch_btn.click(query1,data_set_url,out_json)
|
71 |
app.launch()
|