diff --git a/src/search_type/symmetric_ledger.py b/src/search_type/symmetric_ledger.py index b7b23a39..4d091371 100644 --- a/src/search_type/symmetric_ledger.py +++ b/src/search_type/symmetric_ledger.py @@ -153,6 +153,7 @@ def setup(config: TextSearchConfig, regenerate: bool) -> TextSearchModel: # Extract Entries entries = extract_entries(config.compressed_jsonl, config.verbose) + top_k = min(len(entries), top_k) # Compute or Load Embeddings corpus_embeddings = compute_embeddings(entries, bi_encoder, config.embeddings_file, regenerate=regenerate, verbose=config.verbose)