hysts HF staff commited on
Commit
6d5352f
1 Parent(s): 5092824

Update to ICML 2023

Browse files
Files changed (7) hide show
  1. .pre-commit-config.yaml +3 -2
  2. .vscode/settings.json +18 -0
  3. README.md +2 -2
  4. app.py +58 -56
  5. paper_list.py +13 -42
  6. papers.csv +2 -2
  7. requirements.txt +1 -0
.pre-commit-config.yaml CHANGED
@@ -20,14 +20,15 @@ repos:
20
  - id: docformatter
21
  args: ['--in-place']
22
  - repo: https://github.com/pycqa/isort
23
- rev: 5.10.1
24
  hooks:
25
  - id: isort
26
  - repo: https://github.com/pre-commit/mirrors-mypy
27
- rev: v0.812
28
  hooks:
29
  - id: mypy
30
  args: ['--ignore-missing-imports']
 
31
  - repo: https://github.com/google/yapf
32
  rev: v0.32.0
33
  hooks:
 
20
  - id: docformatter
21
  args: ['--in-place']
22
  - repo: https://github.com/pycqa/isort
23
+ rev: 5.12.0
24
  hooks:
25
  - id: isort
26
  - repo: https://github.com/pre-commit/mirrors-mypy
27
+ rev: v0.991
28
  hooks:
29
  - id: mypy
30
  args: ['--ignore-missing-imports']
31
+ additional_dependencies: ['types-python-slugify']
32
  - repo: https://github.com/google/yapf
33
  rev: v0.32.0
34
  hooks:
.vscode/settings.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "python.linting.enabled": true,
3
+ "python.linting.flake8Enabled": true,
4
+ "python.linting.pylintEnabled": false,
5
+ "python.linting.lintOnSave": true,
6
+ "python.formatting.provider": "yapf",
7
+ "python.formatting.yapfArgs": [
8
+ "--style={based_on_style: pep8, indent_width: 4, blank_line_before_nested_class_or_def: false, spaces_before_comment: 2, split_before_logical_operator: true}"
9
+ ],
10
+ "[python]": {
11
+ "editor.formatOnType": true,
12
+ "editor.codeActionsOnSave": {
13
+ "source.organizeImports": true
14
+ }
15
+ },
16
+ "editor.formatOnSave": true,
17
+ "files.insertFinalNewline": true
18
+ }
README.md CHANGED
@@ -1,10 +1,10 @@
1
  ---
2
- title: ICML2022 Papers
3
  emoji: 🦀
4
  colorFrom: green
5
  colorTo: gray
6
  sdk: gradio
7
- sdk_version: 3.0.24
8
  app_file: app.py
9
  pinned: true
10
  duplicated_from: ICML2022/ICML2022_papers
 
1
  ---
2
+ title: ICML2023 Papers
3
  emoji: 🦀
4
  colorFrom: green
5
  colorTo: gray
6
  sdk: gradio
7
+ sdk_version: 3.34.0
8
  app_file: app.py
9
  pinned: true
10
  duplicated_from: ICML2022/ICML2022_papers
app.py CHANGED
@@ -6,65 +6,67 @@ import gradio as gr
6
 
7
  from paper_list import PaperList
8
 
9
- DESCRIPTION = '# ICML 2022 Papers'
10
- NOTES = '''
11
- - [ICML 2022](https://icml.cc/Conferences/2022/)
12
- - [Proceedings](https://proceedings.mlr.press/v162/)
13
- '''
14
- FOOTER = '<img id="visitor-badge" alt="visitor badge" src="https://visitor-badge.glitch.me/badge?page_id=hysts.icml2022_papers" />'
15
 
 
16
 
17
- def main():
18
- paper_list = PaperList()
19
 
20
- with gr.Blocks(css='style.css') as demo:
21
- gr.Markdown(DESCRIPTION)
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
- search_box = gr.Textbox(
24
- label='Search Title',
25
- placeholder=
26
- 'You can search for titles with regular expressions. e.g. (?<!sur)face'
27
- )
28
- case_sensitive = gr.Checkbox(label='Case Sensitive')
29
- filter_names = gr.CheckboxGroup(choices=[
30
- 'arXiv',
31
- 'GitHub',
32
- 'HF Space',
33
- 'HF Model',
34
- 'HF Dataset',
35
- ],
36
- label='Filter')
37
- search_button = gr.Button('Search')
38
-
39
- number_of_papers = gr.Textbox(label='Number of Papers Found')
40
- table = gr.HTML(show_label=False)
41
-
42
- gr.Markdown(NOTES)
43
- gr.Markdown(FOOTER)
44
-
45
- demo.load(paper_list.render,
46
- inputs=[
47
- search_box,
48
- case_sensitive,
49
- filter_names,
50
- ],
51
- outputs=[
52
- number_of_papers,
53
- table,
54
- ])
55
- search_button.click(paper_list.render,
56
- inputs=[
57
- search_box,
58
- case_sensitive,
59
- filter_names,
60
- ],
61
- outputs=[
62
- number_of_papers,
63
- table,
64
- ])
65
-
66
- demo.launch(enable_queue=True, share=False)
67
 
 
 
 
 
 
 
 
 
 
 
 
 
68
 
69
- if __name__ == '__main__':
70
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  from paper_list import PaperList
8
 
9
+ DESCRIPTION = '# ICML 2023 Papers'
 
 
 
 
 
10
 
11
+ paper_list = PaperList()
12
 
13
+ with gr.Blocks(css='style.css') as demo:
14
+ gr.Markdown(DESCRIPTION)
15
 
16
+ search_box = gr.Textbox(
17
+ label='Search Title',
18
+ placeholder=
19
+ 'You can search for titles with regular expressions. e.g. (?<!sur)face'
20
+ )
21
+ case_sensitive = gr.Checkbox(label='Case Sensitive')
22
+ filter_names = gr.CheckboxGroup(choices=[
23
+ 'arXiv',
24
+ 'GitHub',
25
+ 'Space',
26
+ 'Model',
27
+ 'Dataset',
28
+ ],
29
+ label='Filter')
30
+ search_button = gr.Button('Search')
31
 
32
+ number_of_papers = gr.Textbox(label='Number of Papers Found')
33
+ table = gr.HTML(show_label=False)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
+ demo.load(
36
+ fn=paper_list.render,
37
+ inputs=[
38
+ search_box,
39
+ case_sensitive,
40
+ filter_names,
41
+ ],
42
+ outputs=[
43
+ number_of_papers,
44
+ table,
45
+ ],
46
+ )
47
 
48
+ search_box.submit(
49
+ fn=paper_list.render,
50
+ inputs=[
51
+ search_box,
52
+ case_sensitive,
53
+ filter_names,
54
+ ],
55
+ outputs=[
56
+ number_of_papers,
57
+ table,
58
+ ],
59
+ )
60
+ search_button.click(
61
+ fn=paper_list.render,
62
+ inputs=[
63
+ search_box,
64
+ case_sensitive,
65
+ filter_names,
66
+ ],
67
+ outputs=[
68
+ number_of_papers,
69
+ table,
70
+ ],
71
+ )
72
+ demo.queue().launch()
paper_list.py CHANGED
@@ -1,59 +1,31 @@
1
  from __future__ import annotations
2
 
3
- import numpy as np
4
  import pandas as pd
5
- import requests
6
- from huggingface_hub.hf_api import SpaceInfo
7
 
8
 
9
  class PaperList:
10
  def __init__(self):
11
- self.organization_name = 'ICML2022'
12
  self.table = pd.read_csv('papers.csv')
13
- self._preprcess_table()
14
 
15
  self.table_header = '''
16
  <tr>
17
- <td width="50%">Paper</td>
18
- <td width="26%">Authors</td>
19
- <td width="4%">pdf</td>
20
- <td width="4%">arXiv</td>
21
- <td width="4%">GitHub</td>
22
- <td width="4%">HF Spaces</td>
23
- <td width="4%">HF Models</td>
24
- <td width="4%">HF Datasets</td>
25
  </tr>'''
26
 
27
- @staticmethod
28
- def load_space_info(author: str) -> list[SpaceInfo]:
29
- path = 'https://huggingface.co/api/spaces'
30
- r = requests.get(path, params={'author': author})
31
- d = r.json()
32
- return [SpaceInfo(**x) for x in d]
33
-
34
- def add_spaces_to_table(self, organization_name: str,
35
- df: pd.DataFrame) -> pd.DataFrame:
36
- spaces = self.load_space_info(organization_name)
37
- name2space = {
38
- s.id.split('/')[1].lower(): f'https://huggingface.co/spaces/{s.id}'
39
- for s in spaces
40
- }
41
- df['hf_space'] = df.loc[:, ['hf_space', 'github']].apply(
42
- lambda x: x[0] if isinstance(x[0], str) else name2space.get(
43
- x[1].split('/')[-1].lower()
44
- if isinstance(x[1], str) else '', np.nan),
45
- axis=1)
46
- return df
47
-
48
- def _preprcess_table(self) -> None:
49
- self.table = self.add_spaces_to_table(self.organization_name,
50
- self.table)
51
  self.table['title_lowercase'] = self.table.title.str.lower()
52
 
53
  rows = []
54
  for row in self.table.itertuples():
55
- paper = f'<a href="{row.url}" target="_blank">{row.title}</a>'
56
- pdf = f'<a href="{row.pdf}" target="_blank">pdf</a>'
57
  arxiv = f'<a href="{row.arxiv}" target="_blank">arXiv</a>' if isinstance(
58
  row.arxiv, str) else ''
59
  github = f'<a href="{row.github}" target="_blank">GitHub</a>' if isinstance(
@@ -66,9 +38,8 @@ class PaperList:
66
  row.hf_dataset, str) else ''
67
  row = f'''
68
  <tr>
69
- <td>{paper}</td>
70
  <td>{row.authors}</td>
71
- <td>{pdf}</td>
72
  <td>{arxiv}</td>
73
  <td>{github}</td>
74
  <td>{hf_space}</td>
@@ -80,7 +51,7 @@ class PaperList:
80
 
81
  def render(self, search_query: str, case_sensitive: bool,
82
  filter_names: list[str]) -> tuple[int, str]:
83
- df = self.add_spaces_to_table(self.organization_name, self.table)
84
  if search_query:
85
  if case_sensitive:
86
  df = df[df.title.str.contains(search_query)]
 
1
  from __future__ import annotations
2
 
 
3
  import pandas as pd
 
 
4
 
5
 
6
  class PaperList:
7
  def __init__(self):
8
+ self.organization_name = 'ICML2023'
9
  self.table = pd.read_csv('papers.csv')
10
+ self._preprocess_table()
11
 
12
  self.table_header = '''
13
  <tr>
14
+ <td width="40%">Paper</td>
15
+ <td width="30%">Authors</td>
16
+ <td width="6%">arXiv</td>
17
+ <td width="6%">GitHub</td>
18
+ <td width="6%">Spaces</td>
19
+ <td width="6%">Models</td>
20
+ <td width="6%">Datasets</td>
 
21
  </tr>'''
22
 
23
+ def _preprocess_table(self) -> None:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  self.table['title_lowercase'] = self.table.title.str.lower()
25
 
26
  rows = []
27
  for row in self.table.itertuples():
28
+ title = f'{row.title}'
 
29
  arxiv = f'<a href="{row.arxiv}" target="_blank">arXiv</a>' if isinstance(
30
  row.arxiv, str) else ''
31
  github = f'<a href="{row.github}" target="_blank">GitHub</a>' if isinstance(
 
38
  row.hf_dataset, str) else ''
39
  row = f'''
40
  <tr>
41
+ <td>{title}</td>
42
  <td>{row.authors}</td>
 
43
  <td>{arxiv}</td>
44
  <td>{github}</td>
45
  <td>{hf_space}</td>
 
51
 
52
  def render(self, search_query: str, case_sensitive: bool,
53
  filter_names: list[str]) -> tuple[int, str]:
54
+ df = self.table
55
  if search_query:
56
  if case_sensitive:
57
  df = df[df.title.str.contains(search_query)]
papers.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ddf0077cfd7ce2b23ad1813e47fc3f3efcdeefb25d50447d51da9e3bdea6e3f4
3
- size 335527
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b585cf6312b7e58c0801a3a00d83e4dcde09bc99618b5bbd6e73d02e724118f9
3
+ size 301993
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ pandas==2.0.2