Spaces:
Paused
Paused
style
Browse files
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 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
|
|
|
|
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=
|
418 |
-
received_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 |
|