Shiyu Zhao commited on
Commit
4d52cf5
·
1 Parent(s): c94169d

Update space

Browse files
Files changed (1) hide show
  1. app.py +12 -23
app.py CHANGED
@@ -127,29 +127,18 @@ with gr.Blocks(css=css) as demo:
127
  interactive=True
128
  )
129
 
 
 
130
  with gr.Tabs() as outer_tabs:
131
- with gr.TabItem("Synthesized (full)"):
132
- with gr.Tabs() as inner_tabs_synthesized_full:
133
- syn_full_dfs = [gr.DataFrame(interactive=False) for _ in range(3)]
134
- for df, dataset in zip(syn_full_dfs, ['AMAZON', 'MAG', 'PRIME']):
135
- with gr.TabItem(dataset):
136
- df.render()
137
-
138
- with gr.TabItem("Synthesized (10%)"):
139
- with gr.Tabs() as inner_tabs_synthesized_10:
140
- syn_10_dfs = [gr.DataFrame(interactive=False) for _ in range(3)]
141
- for df, dataset in zip(syn_10_dfs, ['AMAZON', 'MAG', 'PRIME']):
142
- with gr.TabItem(dataset):
143
- df.render()
144
-
145
- with gr.TabItem("Human-Generated"):
146
- with gr.Tabs() as inner_tabs_human:
147
- human_dfs = [gr.DataFrame(interactive=False) for _ in range(3)]
148
- for df, dataset in zip(human_dfs, ['AMAZON', 'MAG', 'PRIME']):
149
- with gr.TabItem(dataset):
150
- df.render()
151
-
152
- all_dfs = syn_full_dfs + syn_10_dfs + human_dfs
153
 
154
  model_type_filter.change(
155
  update_tables,
@@ -163,4 +152,4 @@ with gr.Blocks(css=css) as demo:
163
  outputs=all_dfs
164
  )
165
 
166
- demo.launch()
 
127
  interactive=True
128
  )
129
 
130
+ all_dfs = []
131
+
132
  with gr.Tabs() as outer_tabs:
133
+ for tab_name, df_source in [("Synthesized (full)", df_synthesized_full),
134
+ ("Synthesized (10%)", df_synthesized_10),
135
+ ("Human-Generated", df_human_generated)]:
136
+ with gr.TabItem(tab_name):
137
+ with gr.Tabs() as inner_tabs:
138
+ for dataset in ['AMAZON', 'MAG', 'PRIME']:
139
+ with gr.TabItem(dataset):
140
+ df = gr.DataFrame(interactive=False)
141
+ all_dfs.append(df)
 
 
 
 
 
 
 
 
 
 
 
 
 
142
 
143
  model_type_filter.change(
144
  update_tables,
 
152
  outputs=all_dfs
153
  )
154
 
155
+ demo.launch()