search bar not return the whole 100 mb dataset, return first n rows with head function
Browse files
app.py
CHANGED
|
@@ -506,15 +506,17 @@ def search_df(author):
|
|
| 506 |
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 |
-
|
|
|
|
| 510 |
for index in range(len(dfs)):
|
| 511 |
-
dfs[index] = apply_headers(dfs[index], headers[index])
|
| 512 |
|
|
|
|
| 513 |
if not search_text:
|
| 514 |
return dfs
|
| 515 |
|
|
|
|
| 516 |
lists_to_return = []
|
| 517 |
-
|
| 518 |
for df in dfs:
|
| 519 |
lists_to_return.append(df[df['👤 Author Name'].str.contains(f'https://huggingface.co/{search_text}', case=False, na=False)])
|
| 520 |
|
|
|
|
| 506 |
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['👤 Author Name'].str.contains(f'https://huggingface.co/{search_text}', case=False, na=False)])
|
| 522 |
|