File size: 1,563 Bytes
364b314
b381252
2a645f6
b381252
 
2a645f6
 
 
 
 
 
 
 
b381252
 
2a645f6
b381252
2a645f6
b381252
2a645f6
 
b381252
 
2a645f6
 
b381252
2a645f6
 
 
 
 
 
b381252
2a645f6
 
b381252
 
2a645f6
 
 
 
 
 
 
 
 
 
 
 
 
f4dc807
 
 
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
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("πŸ“ About", elem_id="qa-tab-table2", id=2):
        #     gr.Markdown(LEADERBORAD_INFO, elem_classes="markdown-text")
        

block.launch(share=True)