mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 13:18:18 +00:00
Update the search_config instantiated for tests in conftest
This commit is contained in:
@@ -14,7 +14,7 @@ def model_dir(tmp_path_factory):
|
||||
# Generate Image Embeddings from Test Images
|
||||
search_config = ContentTypeConfig()
|
||||
search_config.image = ImageSearchConfig(
|
||||
input_directory = Path('tests/data'),
|
||||
input_directory = 'tests/data',
|
||||
embeddings_file = model_dir.joinpath('.image_embeddings.pt'),
|
||||
batch_size = 10,
|
||||
use_xmp_metadata = False)
|
||||
@@ -23,12 +23,12 @@ def model_dir(tmp_path_factory):
|
||||
|
||||
# Generate Notes Embeddings from Test Notes
|
||||
search_config.org = TextSearchConfig(
|
||||
input_files = [Path('tests/data/main_readme.org'), Path('tests/data/interface_emacs_readme.org')],
|
||||
input_files = ['tests/data/main_readme.org', 'tests/data/interface_emacs_readme.org'],
|
||||
input_filter = None,
|
||||
compressed_jsonl = model_dir.joinpath('.notes.jsonl.gz'),
|
||||
embeddings_file = model_dir.joinpath('.note_embeddings.pt'))
|
||||
|
||||
asymmetric.setup(search_config.notes, regenerate=False, verbose=True)
|
||||
asymmetric.setup(search_config.org, regenerate=False, verbose=True)
|
||||
|
||||
return model_dir
|
||||
|
||||
@@ -37,14 +37,14 @@ def model_dir(tmp_path_factory):
|
||||
def search_config(model_dir):
|
||||
search_config = ContentTypeConfig()
|
||||
search_config.org = TextSearchConfig(
|
||||
input_files = [Path('tests/data/main_readme.org'), Path('tests/data/interface_emacs_readme.org')],
|
||||
input_files = ['tests/data/main_readme.org', 'tests/data/interface_emacs_readme.org'],
|
||||
input_filter = None,
|
||||
compressed_jsonl = model_dir.joinpath('.notes.jsonl.gz'),
|
||||
embeddings_file = model_dir.joinpath('.note_embeddings.pt'))
|
||||
|
||||
search_config.image = ImageSearchConfig(
|
||||
input_directory = Path('tests/data'),
|
||||
embeddings_file = Path('tests/data/.image_embeddings.pt'),
|
||||
input_directory = 'tests/data',
|
||||
embeddings_file = 'tests/data/.image_embeddings.pt',
|
||||
batch_size = 10,
|
||||
use_xmp_metadata = False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user