File size: 655 Bytes
e51e8f8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58113ed
e51e8f8
 
 
 
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
#!/usr/bin/env python

from __future__ import annotations

import gradio as gr
import pandas as pd

from demo_list import DemoList

demo_list = DemoList()

DEFAULT_COLUMNS = [
    'title',
    'arxiv',
    'likes',
    'tags',
    'status',
    'hardware',
]


def update_df() -> pd.DataFrame:
    demo_list.update_data()
    return demo_list.df


with gr.Blocks(css='style.css') as demo:
    df = gr.Dataframe(value=demo_list.df,
                      datatype=demo_list.column_datatype,
                      type='pandas')
    refresh_button = gr.Button('Refresh')
    refresh_button.click(fn=update_df, outputs=df)
demo.queue(api_open=False).launch()