Spaces:
Runtime error
Runtime error
Clean up
Browse files- paper_list.py +9 -7
paper_list.py
CHANGED
@@ -71,9 +71,10 @@ class PaperList:
|
|
71 |
has_hf_dataset = 'HF Dataset' in filter_names
|
72 |
df = self.filter_table(df, has_supp, has_arxiv, has_github,
|
73 |
has_hf_space, has_hf_model, has_hf_dataset)
|
74 |
-
return len(df), self.to_html(df)
|
75 |
|
76 |
-
|
|
|
77 |
has_github: bool, has_hf_space: bool, has_hf_model: bool,
|
78 |
has_hf_dataset: bool) -> pd.DataFrame:
|
79 |
if has_supp:
|
@@ -90,11 +91,12 @@ class PaperList:
|
|
90 |
df = df[~df.hf_dataset.isna()]
|
91 |
return df
|
92 |
|
93 |
-
|
94 |
-
|
95 |
-
table_data = ''.join(
|
96 |
-
html = f'''
|
97 |
-
|
|
|
98 |
{table_data}
|
99 |
</table>'''
|
100 |
return html
|
|
|
71 |
has_hf_dataset = 'HF Dataset' in filter_names
|
72 |
df = self.filter_table(df, has_supp, has_arxiv, has_github,
|
73 |
has_hf_space, has_hf_model, has_hf_dataset)
|
74 |
+
return len(df), self.to_html(df, self.table_header)
|
75 |
|
76 |
+
@staticmethod
|
77 |
+
def filter_table(df: pd.DataFrame, has_supp: bool, has_arxiv: bool,
|
78 |
has_github: bool, has_hf_space: bool, has_hf_model: bool,
|
79 |
has_hf_dataset: bool) -> pd.DataFrame:
|
80 |
if has_supp:
|
|
|
91 |
df = df[~df.hf_dataset.isna()]
|
92 |
return df
|
93 |
|
94 |
+
@staticmethod
|
95 |
+
def to_html(df: pd.DataFrame, table_header: str) -> str:
|
96 |
+
table_data = ''.join(df.html_table_content)
|
97 |
+
html = f'''
|
98 |
+
<table>
|
99 |
+
{table_header}
|
100 |
{table_data}
|
101 |
</table>'''
|
102 |
return html
|