ola13 commited on
Commit
1f58c5b
1 Parent(s): be21dae
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -402,11 +402,15 @@ if __name__ == "__main__":
402
  result_page_html,
403
  datasets,
404
  ) = run_query(query, lang, k, dropdown_input, received_results)
405
- num_processed_results = len(next(iter(processed_results.values())))
406
- has_more_results = exact_search and (num_results > k)
407
- print("num_processed_results", num_processed_results)
408
- print("has_more_results", has_more_results)
 
 
409
  print("received_results", received_results)
 
 
410
  return [
411
  processed_results,
412
  highlight_terms,
@@ -414,8 +418,8 @@ if __name__ == "__main__":
414
  exact_search,
415
  gr.update(visible=True),
416
  gr.Dropdown.update(choices=datasets, value=datasets),
417
- gr.update(visible=num_processed_results >= k and has_more_results),
418
- received_results + num_processed_results,
419
  result_page_html,
420
  ]
421
 
 
402
  result_page_html,
403
  datasets,
404
  ) = run_query(query, lang, k, dropdown_input, received_results)
405
+ current_results = sum(
406
+ len(results) for results in processed_results.values()
407
+ )
408
+ has_more_results = exact_search and (
409
+ received_results + current_results < num_results
410
+ )
411
  print("received_results", received_results)
412
+ print("current_results", current_results)
413
+ print("has_more_results", has_more_results)
414
  return [
415
  processed_results,
416
  highlight_terms,
 
418
  exact_search,
419
  gr.update(visible=True),
420
  gr.Dropdown.update(choices=datasets, value=datasets),
421
+ gr.update(visible=current_results >= k and has_more_results),
422
+ received_results + current_results,
423
  result_page_html,
424
  ]
425