Spaces:
Sleeping
Sleeping
Commit
·
c38b160
1
Parent(s):
f5ede9e
Add validation for positive_arxiv_ids input in
Browse files
app.py
CHANGED
@@ -83,6 +83,8 @@ def get_papers(
|
|
83 |
):
|
84 |
if not hf_user_name:
|
85 |
raise gr.Error("You must be logged in to use this Space")
|
|
|
|
|
86 |
hf_user_name = hf_user_name.preferred_username
|
87 |
positive_arxiv_ids = positive_arxiv_ids.split(",")
|
88 |
potential_authors = query_author(author_name)
|
@@ -152,7 +154,7 @@ with gr.Blocks() as demo:
|
|
152 |
)
|
153 |
positive_arxiv_ids = gr.Textbox(
|
154 |
placeholder="1910.01108",
|
155 |
-
label="ArXiv ID for a paper for which you are an author",
|
156 |
interactive=True,
|
157 |
)
|
158 |
btn = gr.Button("Get papers")
|
|
|
83 |
):
|
84 |
if not hf_user_name:
|
85 |
raise gr.Error("You must be logged in to use this Space")
|
86 |
+
if not positive_arxiv_ids:
|
87 |
+
raise gr.Error("You must enter at least one ArXiv ID")
|
88 |
hf_user_name = hf_user_name.preferred_username
|
89 |
positive_arxiv_ids = positive_arxiv_ids.split(",")
|
90 |
potential_authors = query_author(author_name)
|
|
|
154 |
)
|
155 |
positive_arxiv_ids = gr.Textbox(
|
156 |
placeholder="1910.01108",
|
157 |
+
label="ArXiv ID for a paper for which you are an author, separate multiple IDs with commas",
|
158 |
interactive=True,
|
159 |
)
|
160 |
btn = gr.Button("Get papers")
|