Spaces:
Runtime error
Runtime error
| demo = gr.Blocks(css=css) | |
| with demo: | |
| with gr.Column(elem_classes=["container"]): | |
| gr.Markdown("# Daily Papers", elem_classes=["title"]) | |
| with gr.Row(elem_classes=["search-row"]): | |
| search_input = gr.Textbox(label="", placeholder="Search papers...") | |
| refresh_button = gr.Button("↻", variant="primary") | |
| paper_list = gr.HTML(elem_classes=["paper-list"]) | |
| with gr.Row(elem_classes=["footer"]): | |
| prev_button = gr.Button("← Prev", interactive=True) | |
| page_info = gr.Markdown() | |
| next_button = gr.Button("Next →", interactive=True) | |
| # Initialize app and set button states | |
| demo.load(initialize_app, outputs=[paper_list, page_info, prev_button, next_button]) | |
| search_input.change(paper_manager.search_papers, inputs=[search_input], outputs=[paper_list]) | |
| refresh_button.click(refresh_papers, outputs=[paper_list, page_info, prev_button, next_button]) | |
| prev_button.click(paper_manager.prev_page, outputs=[paper_list, page_info, prev_button, next_button]) | |
| next_button.click(paper_manager.next_page, outputs=[paper_list, page_info, prev_button, next_button]) | |
| demo.launch() | |