hysts HF Staff commited on
Commit
f279af7
·
1 Parent(s): 2ddae93

Rename argument

Browse files
Files changed (2) hide show
  1. app.py +4 -4
  2. 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
- names_with_link = 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,7 +40,7 @@ def main():
40
  inputs=[
41
  search_box,
42
  case_sensitive,
43
- names_with_link,
44
  ],
45
  outputs=[
46
  number_of_papers,
@@ -50,7 +50,7 @@ def main():
50
  inputs=[
51
  search_box,
52
  case_sensitive,
53
- names_with_link,
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
- names_with_link: 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 names_with_link
59
- has_arxiv = 'arXiv' in names_with_link
60
- has_github = 'GitHub' in names_with_link
61
- has_hf_space = 'HF Space' in names_with_link
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)