File size: 880 Bytes
08080f2
 
b4eb3ca
 
08080f2
 
 
b4eb3ca
 
43cda2e
08080f2
 
 
b4eb3ca
 
 
 
 
 
 
2716ba4
08080f2
2716ba4
08080f2
 
 
 
140e383
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
#!/usr/bin/env python

import os

import gradio as gr

from papers import PaperList, get_df
from update_scheduler import UpdateScheduler

DESCRIPTION = '''# [Daily Papers](https://huggingface.co/papers)'''

paper_list = PaperList(get_df('papers.csv'))

if (SPACE_ID := os.getenv('SPACE_ID')) is not None:
    CRON_HOUR = os.getenv('CRON_HOUR', '*/4')
    CRON_MINUTE = os.getenv('CRON_MINUTE', '0')
    scheduler = UpdateScheduler(space_id=SPACE_ID,
                                cron_hour=CRON_HOUR,
                                cron_minute=CRON_MINUTE)
    scheduler.start()

with gr.Blocks(css='style.css') as demo:
    gr.Markdown(DESCRIPTION)
    df = gr.Dataframe(value=paper_list.df_prettified,
                      datatype=paper_list.column_datatype,
                      type='pandas',
                      interactive=False)
demo.queue(api_open=False).launch()