Spaces:
Runtime error
Runtime error
Malikeh Ehghaghi
commited on
Update dataset_list.py
Browse files- dataset_list.py +1 -6
dataset_list.py
CHANGED
|
@@ -66,21 +66,16 @@ class DatasetList:
|
|
| 66 |
df = df[df.dataset_name.str.contains(search_query)]
|
| 67 |
else:
|
| 68 |
df = df[df.dataset_name_lowercase.str.contains(search_query.lower())]
|
| 69 |
-
has_dataset = 'Dataset' in filter_names
|
| 70 |
has_datalink = 'Data Link' in filter_names
|
| 71 |
has_paper = 'Paper' in filter_names
|
| 72 |
-
df = self.filter_table(df,
|
| 73 |
-
#df = self.filter_table(df, has_paper, has_github, has_model, data_types, model_types)
|
| 74 |
return len(df), self.to_html(df, self.table_header)
|
| 75 |
|
| 76 |
@staticmethod
|
| 77 |
def filter_table(df: pd.DataFrame,
|
| 78 |
-
has_dataset: bool,
|
| 79 |
has_datalink: bool,
|
| 80 |
has_paper: bool
|
| 81 |
) -> pd.DataFrame:
|
| 82 |
-
# if has_dataset:
|
| 83 |
-
# df = df[~df.dataset_name.isna()]
|
| 84 |
if has_datalink:
|
| 85 |
df = df[~df.huggingface_link.isna() | ~df.original_link.isna()]
|
| 86 |
if has_paper:
|
|
|
|
| 66 |
df = df[df.dataset_name.str.contains(search_query)]
|
| 67 |
else:
|
| 68 |
df = df[df.dataset_name_lowercase.str.contains(search_query.lower())]
|
|
|
|
| 69 |
has_datalink = 'Data Link' in filter_names
|
| 70 |
has_paper = 'Paper' in filter_names
|
| 71 |
+
df = self.filter_table(df, has_datalink, has_paper)
|
|
|
|
| 72 |
return len(df), self.to_html(df, self.table_header)
|
| 73 |
|
| 74 |
@staticmethod
|
| 75 |
def filter_table(df: pd.DataFrame,
|
|
|
|
| 76 |
has_datalink: bool,
|
| 77 |
has_paper: bool
|
| 78 |
) -> pd.DataFrame:
|
|
|
|
|
|
|
| 79 |
if has_datalink:
|
| 80 |
df = df[~df.huggingface_link.isna() | ~df.original_link.isna()]
|
| 81 |
if has_paper:
|