File size: 2,453 Bytes
364b314
b381252
2a645f6
b381252
 
2a645f6
 
 
 
 
 
 
 
b381252
 
2a645f6
b381252
2a645f6
b381252
2a645f6
 
b381252
 
2a645f6
 
b381252
2a645f6
 
 
 
 
 
b381252
2a645f6
 
b381252
 
2a645f6
 
 
 
 
 
 
 
 
 
 
 
 
3a35e3b
 
f4dc807
d27d2b3
 
 
 
 
 
 
 
 
 
 
 
c90045f
d27d2b3
 
 
 
 
 
 
 
 
 
c90045f
d27d2b3
2a645f6
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
from utils import *

global data_component


css = """
.table-class th:nth-child(1), .table-class td:nth-child(1) {
    min-width: 200px;
    max-width: 300px;
    word-wrap: break-word;
    white-space: normal;
}
"""


block = gr.Blocks(css=css) 

with block:

    gr.Markdown(
        LEADERBORAD_INTRODUCTION
    )
    with gr.Tabs(elem_classes="tab-buttons") as tabs:
        # Table 1
        with gr.TabItem("πŸ“Š VideoScore Leaderboard", elem_id="qa-tab-table1", id=1):
            with gr.Row():
                with gr.Accordion("Citation", open=False):
                    citation_button = gr.Textbox(
                        value=CITATION_BUTTON_TEXT,
                        label=CITATION_BUTTON_LABEL,
                        elem_id="citation-button",
                        lines=20,
                    )
            gr.Markdown(
                TABLE_INTRODUCTION
            )

            data_component=gr.components.Dataframe(
                value=get_df(), 
                headers=COLUMN_NAMES,
                type="pandas", 
                datatype=DATA_TITILE_TYPE,
                interactive=False,
                visible=True,
                elem_classes="table-class" 
                )
            
            refresh_button = gr.Button("Refresh")
            refresh_button.click(fn=refresh_data, outputs=data_component)



        # # Table 2
        with gr.TabItem("πŸ“Š EvalCrafter LeaderBoard (Best-of-K-Sampling with VideoScore)", elem_id="qa-tab-table2", id=2):
            with gr.Row():
                with gr.Accordion("Citation", open=False):
                    citation_button = gr.Textbox(
                        value=CITATION_BUTTON_TEXT,
                        label=CITATION_BUTTON_LABEL,
                        elem_id="citation-button",
                        lines=20,
                    )
            gr.Markdown(
                TABLE_INTRODUCTION
            )
            data_component_2=gr.components.Dataframe(
                value=get_df_t2(), 
                headers=COLUMN_NAMES_T2,
                type="pandas", 
                datatype=DATA_TITILE_TYPE_T2,
                interactive=False,
                visible=True,
                elem_classes="table-class" 
                )
            
            refresh_button = gr.Button("Refresh")
            refresh_button.click(fn=refresh_data_t2, outputs=data_component_2)
        
        

block.launch(share=True)