lwpyh commited on
Commit
f1013fe
·
verified ·
1 Parent(s): 9affac1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -25
app.py CHANGED
@@ -476,31 +476,39 @@ with block:
476
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
477
  # Table 0
478
  df = pd.read_csv("https://huggingface.co/spaces/V-STaR-Bench/V-STaR-LeaderBoard/resolve/main/results.csv")
479
-
480
- with gr.TabItem("📊 V-STaR"):
481
- with gr.Row():
482
- with gr.Accordion("Citation", open=False):
483
- citation_button = gr.Textbox(
484
- value=CITATION_BUTTON_TEXT,
485
- label=CITATION_BUTTON_LABEL,
486
- lines=14,
487
- )
488
-
489
- gr.Markdown(TABLE_INTRODUCTION)
490
-
491
- # Display the CSV data directly
492
- data_component = gr.components.Dataframe(
493
- value=df,
494
- type="pandas",
495
- interactive=False,
496
- visible=True,
497
- # Optionally adjust other parameters, but note that 'height' is not supported in the latest version.
498
- )
499
-
500
- # If you need to update or refresh the table later, you can add additional controls/callbacks here.
501
-
502
- # For now, simply display the loaded DataFrame.
503
- # data_component.render()
 
 
 
 
 
 
 
 
504
 
505
  # table info
506
  with gr.TabItem("📝 About", elem_id="mvbench-tab-table", id=5):
 
476
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
477
  # Table 0
478
  df = pd.read_csv("https://huggingface.co/spaces/V-STaR-Bench/V-STaR-LeaderBoard/resolve/main/results.csv")
479
+ all_columns = df.columns.tolist()[1:]
480
+ choices_from_csv = [col.strip() for col in all_columns if col.strip()]
481
+
482
+ with gr.Tabs(elem_classes="tab-buttons") as tabs:
483
+ with gr.TabItem("📊 V-STaR"):
484
+ with gr.Row():
485
+ with gr.Accordion("Citation", open=False):
486
+ citation_button = gr.Textbox(
487
+ value=CITATION_BUTTON_TEXT,
488
+ label=CITATION_BUTTON_LABEL,
489
+ lines=14,
490
+ )
491
+ gr.Markdown(TABLE_INTRODUCTION)
492
+
493
+ # 添加一个 CheckboxGroup,用 CSV 中的类别作为选项
494
+ checkbox_group = gr.CheckboxGroup(
495
+ choices=choices_from_csv,
496
+ value=choices_from_csv, # 默认全部选中,可根据需要调整
497
+ label="Evaluation Dimension",
498
+ interactive=True,
499
+ )
500
+
501
+ # 将 checkbox_group 放在一行中展示(可选)
502
+ with gr.Row():
503
+ checkbox_group
504
+
505
+ # 显示 CSV 数据的 Dataframe 组件
506
+ data_component = gr.components.Dataframe(
507
+ value=df,
508
+ type="pandas",
509
+ interactive=False,
510
+ visible=True,
511
+ )
512
 
513
  # table info
514
  with gr.TabItem("📝 About", elem_id="mvbench-tab-table", id=5):