Spaces:
Running
Running
Rename argument
Browse files- app.py +4 -4
- paper_list.py +5 -5
app.py
CHANGED
@@ -16,13 +16,13 @@ def main():
|
|
16 |
with gr.Blocks(css='style.css') as demo:
|
17 |
gr.Markdown(DESCRIPTION)
|
18 |
|
19 |
-
|
20 |
'Supp',
|
21 |
'arXiv',
|
22 |
'GitHub',
|
23 |
'HF Space',
|
24 |
],
|
25 |
-
|
26 |
search_box = gr.Textbox(
|
27 |
label='Keywords',
|
28 |
placeholder=
|
@@ -40,7 +40,7 @@ def main():
|
|
40 |
inputs=[
|
41 |
search_box,
|
42 |
case_sensitive,
|
43 |
-
|
44 |
],
|
45 |
outputs=[
|
46 |
number_of_papers,
|
@@ -50,7 +50,7 @@ def main():
|
|
50 |
inputs=[
|
51 |
search_box,
|
52 |
case_sensitive,
|
53 |
-
|
54 |
],
|
55 |
outputs=[
|
56 |
number_of_papers,
|
|
|
16 |
with gr.Blocks(css='style.css') as demo:
|
17 |
gr.Markdown(DESCRIPTION)
|
18 |
|
19 |
+
filter_names = gr.CheckboxGroup(choices=[
|
20 |
'Supp',
|
21 |
'arXiv',
|
22 |
'GitHub',
|
23 |
'HF Space',
|
24 |
],
|
25 |
+
label='With')
|
26 |
search_box = gr.Textbox(
|
27 |
label='Keywords',
|
28 |
placeholder=
|
|
|
40 |
inputs=[
|
41 |
search_box,
|
42 |
case_sensitive,
|
43 |
+
filter_names,
|
44 |
],
|
45 |
outputs=[
|
46 |
number_of_papers,
|
|
|
50 |
inputs=[
|
51 |
search_box,
|
52 |
case_sensitive,
|
53 |
+
filter_names,
|
54 |
],
|
55 |
outputs=[
|
56 |
number_of_papers,
|
paper_list.py
CHANGED
@@ -48,17 +48,17 @@ class PaperList:
|
|
48 |
self.table['html_table_content'] = rows
|
49 |
|
50 |
def render(self, search_query: str, case_sensitive: bool,
|
51 |
-
|
52 |
df = self.table
|
53 |
if search_query:
|
54 |
if case_sensitive:
|
55 |
df = df[df.title.str.contains(search_query)]
|
56 |
else:
|
57 |
df = df[df.title_lowercase.str.contains(search_query.lower())]
|
58 |
-
has_supp = 'Supp' in
|
59 |
-
has_arxiv = 'arXiv' in
|
60 |
-
has_github = 'GitHub' in
|
61 |
-
has_hf_space = 'HF Space' in
|
62 |
df = self.filter_table(df, has_supp, has_arxiv, has_github,
|
63 |
has_hf_space)
|
64 |
return len(df), self.to_html(df)
|
|
|
48 |
self.table['html_table_content'] = rows
|
49 |
|
50 |
def render(self, search_query: str, case_sensitive: bool,
|
51 |
+
filter_names: list[str]) -> tuple[int, str]:
|
52 |
df = self.table
|
53 |
if search_query:
|
54 |
if case_sensitive:
|
55 |
df = df[df.title.str.contains(search_query)]
|
56 |
else:
|
57 |
df = df[df.title_lowercase.str.contains(search_query.lower())]
|
58 |
+
has_supp = 'Supp' in filter_names
|
59 |
+
has_arxiv = 'arXiv' in filter_names
|
60 |
+
has_github = 'GitHub' in filter_names
|
61 |
+
has_hf_space = 'HF Space' in filter_names
|
62 |
df = self.filter_table(df, has_supp, has_arxiv, has_github,
|
63 |
has_hf_space)
|
64 |
return len(df), self.to_html(df)
|