mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 17:35:07 +01:00
Ensure top_k never more than total entries to run symmetric search on
This commit is contained in:
parent
8c858d1a94
commit
46661b3057
1 changed files with 1 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue