Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,19 @@ import gradio as gr
|
|
2 |
import xmltodict
|
3 |
import requests
|
4 |
import json
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
def search(q,rn):
|
7 |
api="http://export.arxiv.org/api/query?search_query=SQ&start=0&max_results=MR"
|
8 |
r=requests.get(api.replace("SQ",q).replace("MR",str(rn)))
|
@@ -16,7 +28,7 @@ def search(q,rn):
|
|
16 |
html+=f"<div><a href='{pdflink}' target='_blank'>{pdflink}</a></div>"
|
17 |
html+="</div>"
|
18 |
return(json.dumps(cont,indent=4)),html
|
19 |
-
with gr.Blocks() as b:
|
20 |
with gr.Group():
|
21 |
with gr.Row():
|
22 |
query=gr.Textbox(label="Query")
|
|
|
2 |
import xmltodict
|
3 |
import requests
|
4 |
import json
|
5 |
+
style="""
|
6 |
+
.title_div{
|
7 |
+
font-size: x-large;
|
8 |
+
font-weight: 700;
|
9 |
+
margin-bottom: 10px;
|
10 |
+
}
|
11 |
+
.card_div{
|
12 |
+
background: #050523;
|
13 |
+
margin: 10px;
|
14 |
+
padding: 15px;
|
15 |
+
border-radius: 5px;
|
16 |
+
}
|
17 |
+
"""
|
18 |
def search(q,rn):
|
19 |
api="http://export.arxiv.org/api/query?search_query=SQ&start=0&max_results=MR"
|
20 |
r=requests.get(api.replace("SQ",q).replace("MR",str(rn)))
|
|
|
28 |
html+=f"<div><a href='{pdflink}' target='_blank'>{pdflink}</a></div>"
|
29 |
html+="</div>"
|
30 |
return(json.dumps(cont,indent=4)),html
|
31 |
+
with gr.Blocks(css=style) as b:
|
32 |
with gr.Group():
|
33 |
with gr.Row():
|
34 |
query=gr.Textbox(label="Query")
|