Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,6 @@ file_path3_2 = 'Revision Image Integrity.csv'
|
|
| 13 |
file_path3_3 = 'Revision Image Aesthetics.csv'
|
| 14 |
|
| 15 |
|
| 16 |
-
# 读取 Excel 文件
|
| 17 |
dff1_1 = pd.read_csv(file_path1_1)
|
| 18 |
dff1_2 = pd.read_csv(file_path1_2)
|
| 19 |
dff1_3 = pd.read_csv(file_path1_3)
|
|
@@ -25,7 +24,6 @@ dff3_2 = pd.read_csv(file_path3_2)
|
|
| 25 |
dff3_3 = pd.read_csv(file_path3_3)
|
| 26 |
|
| 27 |
|
| 28 |
-
# 定义一个函数,根据用户选择的表格返回相应的表格
|
| 29 |
def display_table(table_choice):
|
| 30 |
if table_choice == "Option 1: Image Generation Test Ranking":
|
| 31 |
return dff1_1
|
|
@@ -67,10 +65,8 @@ with gr.Blocks() as demo:
|
|
| 67 |
value="Option 1: Image Generation Test Ranking") # 设置默认值为"Table 1"
|
| 68 |
|
| 69 |
with gr.Row():
|
| 70 |
-
output = gr.DataFrame(value=dff1_1, height=850)
|
| 71 |
|
| 72 |
-
# 通过更新函数实现交互
|
| 73 |
dropdown.change(fn=display_table, inputs=dropdown, outputs=output)
|
| 74 |
|
| 75 |
-
# 启动Gradio界面
|
| 76 |
demo.launch()
|
|
|
|
| 13 |
file_path3_3 = 'Revision Image Aesthetics.csv'
|
| 14 |
|
| 15 |
|
|
|
|
| 16 |
dff1_1 = pd.read_csv(file_path1_1)
|
| 17 |
dff1_2 = pd.read_csv(file_path1_2)
|
| 18 |
dff1_3 = pd.read_csv(file_path1_3)
|
|
|
|
| 24 |
dff3_3 = pd.read_csv(file_path3_3)
|
| 25 |
|
| 26 |
|
|
|
|
| 27 |
def display_table(table_choice):
|
| 28 |
if table_choice == "Option 1: Image Generation Test Ranking":
|
| 29 |
return dff1_1
|
|
|
|
| 65 |
value="Option 1: Image Generation Test Ranking") # 设置默认值为"Table 1"
|
| 66 |
|
| 67 |
with gr.Row():
|
| 68 |
+
output = gr.DataFrame(value=dff1_1, height=850)
|
| 69 |
|
|
|
|
| 70 |
dropdown.change(fn=display_table, inputs=dropdown, outputs=output)
|
| 71 |
|
|
|
|
| 72 |
demo.launch()
|