From 09727ac3be5bd264d6d2df2a5b6fbfda53f974a6 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Wed, 27 Jul 2022 07:26:02 +0400 Subject: [PATCH] Make bi-encoder return fewer results to reduce cross-encoder latency --- src/search_type/text_search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/search_type/text_search.py b/src/search_type/text_search.py index 81c92605..73f48930 100644 --- a/src/search_type/text_search.py +++ b/src/search_type/text_search.py @@ -20,7 +20,7 @@ def initialize_model(search_config: TextSearchConfig): torch.set_num_threads(4) # Number of entries we want to retrieve with the bi-encoder - top_k = 30 + top_k = 15 # The bi-encoder encodes all entries to use for semantic search bi_encoder = load_model(