Update app.py
Browse files
app.py
CHANGED
@@ -1,32 +1,32 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
from fetch_paper_data import fetch_paper_data
|
3 |
-
|
4 |
-
theme = gr.themes.Soft(
|
5 |
-
primary_hue="purple",
|
6 |
-
secondary_hue="cyan",
|
7 |
-
neutral_hue="slate",
|
8 |
-
font=[
|
9 |
-
gr.themes.GoogleFont('Syne'),
|
10 |
-
gr.themes.GoogleFont('Poppins'),
|
11 |
-
gr.themes.GoogleFont('Poppins'),
|
12 |
-
gr.themes.GoogleFont('Poppins')
|
13 |
-
],
|
14 |
-
)
|
15 |
-
|
16 |
-
def clear_data(id, raw_data):
|
17 |
-
id = None
|
18 |
-
raw_data = None
|
19 |
-
return id, raw_data
|
20 |
-
|
21 |
-
with gr.Blocks(theme=theme, title="Fetch Research Paper Data") as app:
|
22 |
-
with gr.Row():
|
23 |
-
with gr.Column():
|
24 |
-
id = gr.Textbox(label="Enter PMCID or arXiv ID", placeholder="PMC1234567 or 1234.56789")
|
25 |
-
with gr.Row():
|
26 |
-
fetch_data_btn = gr.Button(value="Fetch Data")
|
27 |
-
reset_btn = gr.Button(value="Reset")
|
28 |
-
raw_data = gr.Textbox(lines=15, label="Raw Data", interactive=False, show_copy_button=True)
|
29 |
-
fetch_data_btn.click(fn=fetch_paper_data, inputs=[id], outputs=[raw_data], api_name="fetch_paper_data")
|
30 |
-
reset_btn.click(fn=clear_data, inputs=[id, raw_data], outputs=[id, raw_data])
|
31 |
-
|
32 |
-
app.queue(default_concurrency_limit=25).launch(
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from fetch_paper_data import fetch_paper_data
|
3 |
+
|
4 |
+
theme = gr.themes.Soft(
|
5 |
+
primary_hue="purple",
|
6 |
+
secondary_hue="cyan",
|
7 |
+
neutral_hue="slate",
|
8 |
+
font=[
|
9 |
+
gr.themes.GoogleFont('Syne'),
|
10 |
+
gr.themes.GoogleFont('Poppins'),
|
11 |
+
gr.themes.GoogleFont('Poppins'),
|
12 |
+
gr.themes.GoogleFont('Poppins')
|
13 |
+
],
|
14 |
+
)
|
15 |
+
|
16 |
+
def clear_data(id, raw_data):
|
17 |
+
id = None
|
18 |
+
raw_data = None
|
19 |
+
return id, raw_data
|
20 |
+
|
21 |
+
with gr.Blocks(theme=theme, title="Fetch Research Paper Data") as app:
|
22 |
+
with gr.Row():
|
23 |
+
with gr.Column():
|
24 |
+
id = gr.Textbox(label="Enter PMCID or arXiv ID", placeholder="PMC1234567 or 1234.56789")
|
25 |
+
with gr.Row():
|
26 |
+
fetch_data_btn = gr.Button(value="Fetch Data")
|
27 |
+
reset_btn = gr.Button(value="Reset")
|
28 |
+
raw_data = gr.Textbox(lines=15, label="Raw Data", interactive=False, show_copy_button=True)
|
29 |
+
fetch_data_btn.click(fn=fetch_paper_data, inputs=[id], outputs=[raw_data], api_name="fetch_paper_data")
|
30 |
+
reset_btn.click(fn=clear_data, inputs=[id, raw_data], outputs=[id, raw_data])
|
31 |
+
|
32 |
+
app.queue(default_concurrency_limit=25).launch(show_api=True, ssr_mode=False)
|