Download front/tabs/tab_papers.py from Ekimetrics/climate-question-answering: direct link, hf CLI and curl.
- Browser
- Download file 1.22 kB
-
https://huggingface.co/spaces/Ekimetrics/climate-question-answering/resolve/44bf2a6fa0417ef54a791bcd2c5b6c1156876e63/front/tabs/tab_papers.py
- Command line
-
hf download hf://spaces/Ekimetrics/climate-question-answering@44bf2a6fa0417ef54a791bcd2c5b6c1156876e63/front/tabs/tab_papers.py
-
curl -L -o tab_papers.py https://huggingface.co/spaces/Ekimetrics/climate-question-answering/resolve/44bf2a6fa0417ef54a791bcd2c5b6c1156876e63/front/tabs/tab_papers.py
1.22 kB
| import gradio as gr | |
| from gradio_modal import Modal | |
| def create_papers_tab(): | |
| direct_search_textbox = gr.Textbox(label="Direct search for papers", placeholder= "What is climate change ?", elem_id="papers-search") | |
| with gr.Accordion( | |
| visible=True, | |
| elem_id="papers-summary-popup", | |
| label="See summary of relevant papers", | |
| open=False | |
| ) as summary_popup: | |
| papers_summary = gr.Markdown("", visible=True, elem_id="papers-summary") | |
| with gr.Accordion( | |
| visible=True, | |
| elem_id="papers-relevant-popup", | |
| label="See relevant papers", | |
| open=False | |
| ) as relevant_popup: | |
| papers_html = gr.HTML(show_label=False, elem_id="papers-textbox") | |
| btn_citations_network = gr.Button("Explore papers citations network") | |
| with Modal(visible=False) as papers_modal: | |
| citations_network = gr.HTML( | |
| "<h3>Citations Network Graph</h3>", | |
| visible=True, | |
| elem_id="papers-citations-network" | |
| ) | |
| btn_citations_network.click( | |
| lambda: Modal(visible=True), | |
| None, | |
| papers_modal | |
| ) | |
| return direct_search_textbox, papers_summary, papers_html, citations_network, papers_modal | |