mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 13:25:11 +00:00
Only create model directory if the optional field is set in SearchConfig
This commit is contained in:
@@ -27,11 +27,12 @@ def initialize_model(search_config: TextSearchConfig):
|
|||||||
# Number of entries we want to retrieve with the bi-encoder
|
# Number of entries we want to retrieve with the bi-encoder
|
||||||
top_k = 15
|
top_k = 15
|
||||||
|
|
||||||
# Convert model directory to absolute path
|
# If model directory is configured
|
||||||
search_config.model_directory = resolve_absolute_path(search_config.model_directory)
|
if search_config.model_directory:
|
||||||
|
# Convert model directory to absolute path
|
||||||
# Create model directory if it doesn't exist
|
search_config.model_directory = resolve_absolute_path(search_config.model_directory)
|
||||||
search_config.model_directory.parent.mkdir(parents=True, exist_ok=True)
|
# Create model directory if it doesn't exist
|
||||||
|
search_config.model_directory.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
# The bi-encoder encodes all entries to use for semantic search
|
# The bi-encoder encodes all entries to use for semantic search
|
||||||
bi_encoder = load_model(
|
bi_encoder = load_model(
|
||||||
|
|||||||
Reference in New Issue
Block a user