Weyaxi commited on
Commit
ab1a3ae
1 Parent(s): ec3e454

search bar not return the whole 100 mb dataset, return first n rows with head function

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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