Spaces:
Runtime error
Runtime error
do not apply headers before, after because not everyone is on top of the list
Browse files
app.py
CHANGED
@@ -507,18 +507,13 @@ def search_bar_in_df_fn(search_text):
|
|
507 |
dfs = [models_df, dataset_df, spaces_df]
|
508 |
headers = [headers_models, headers_datasets, headers_spaces]
|
509 |
how_much_list = [400, 250, 200]
|
510 |
-
|
511 |
-
for index in range(len(dfs)):
|
512 |
-
dfs[index] = apply_headers(dfs[index], headers[index]).head(how_much_list[index])
|
513 |
-
|
514 |
-
|
515 |
-
if not search_text:
|
516 |
-
return dfs
|
517 |
|
518 |
-
|
519 |
lists_to_return = []
|
520 |
for df in dfs:
|
521 |
-
lists_to_return.append(df[df['
|
|
|
|
|
|
|
522 |
|
523 |
return lists_to_return
|
524 |
|
|
|
507 |
dfs = [models_df, dataset_df, spaces_df]
|
508 |
headers = [headers_models, headers_datasets, headers_spaces]
|
509 |
how_much_list = [400, 250, 200]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
510 |
|
|
|
511 |
lists_to_return = []
|
512 |
for df in dfs:
|
513 |
+
lists_to_return.append(df[df['Author Name'].str.contains(f'https://huggingface.co/{search_text}', case=False, na=False)])
|
514 |
+
|
515 |
+
for index in range(len(lists_to_return)):
|
516 |
+
lists_to_return[index] = apply_headers(lists_to_return[index], headers[index]).head(how_much_list[index])
|
517 |
|
518 |
return lists_to_return
|
519 |
|