Spaces:
Runtime error
Runtime error
| #!/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() | |