mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 05:39:12 +00:00
Re-enable tests for image search
Verify if recent fixes resolve test flakiness
This commit is contained in:
@@ -39,14 +39,14 @@ def model_dir(search_config):
|
|||||||
model_dir = search_config.asymmetric.model_directory
|
model_dir = search_config.asymmetric.model_directory
|
||||||
|
|
||||||
# Generate Image Embeddings from Test Images
|
# Generate Image Embeddings from Test Images
|
||||||
# content_config = ContentConfig()
|
content_config = ContentConfig()
|
||||||
# content_config.image = ImageContentConfig(
|
content_config.image = ImageContentConfig(
|
||||||
# input_directories = ['tests/data/images'],
|
input_directories = ['tests/data/images'],
|
||||||
# embeddings_file = model_dir.joinpath('image_embeddings.pt'),
|
embeddings_file = model_dir.joinpath('image_embeddings.pt'),
|
||||||
# batch_size = 10,
|
batch_size = 10,
|
||||||
# use_xmp_metadata = False)
|
use_xmp_metadata = False)
|
||||||
|
|
||||||
# image_search.setup(content_config.image, search_config.image, regenerate=False, verbose=True)
|
image_search.setup(content_config.image, search_config.image, regenerate=False, verbose=True)
|
||||||
|
|
||||||
# Generate Notes Embeddings from Test Notes
|
# Generate Notes Embeddings from Test Notes
|
||||||
content_config.org = TextContentConfig(
|
content_config.org = TextContentConfig(
|
||||||
@@ -69,10 +69,10 @@ def content_config(model_dir):
|
|||||||
compressed_jsonl = model_dir.joinpath('notes.jsonl.gz'),
|
compressed_jsonl = model_dir.joinpath('notes.jsonl.gz'),
|
||||||
embeddings_file = model_dir.joinpath('note_embeddings.pt'))
|
embeddings_file = model_dir.joinpath('note_embeddings.pt'))
|
||||||
|
|
||||||
# content_config.image = ImageContentConfig(
|
content_config.image = ImageContentConfig(
|
||||||
# input_directories = ['tests/data/images'],
|
input_directories = ['tests/data/images'],
|
||||||
# embeddings_file = model_dir.joinpath('image_embeddings.pt'),
|
embeddings_file = model_dir.joinpath('image_embeddings.pt'),
|
||||||
# batch_size = 10,
|
batch_size = 1,
|
||||||
# use_xmp_metadata = False)
|
use_xmp_metadata = False)
|
||||||
|
|
||||||
return content_config
|
return content_config
|
||||||
@@ -90,7 +90,6 @@ def test_regenerate_with_valid_content_type(content_config: ContentConfig, searc
|
|||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------------------------------
|
||||||
@pytest.mark.skip(reason="Flaky test. Search doesn't always return expected image path.")
|
|
||||||
def test_image_search(content_config: ContentConfig, search_config: SearchConfig):
|
def test_image_search(content_config: ContentConfig, search_config: SearchConfig):
|
||||||
# Arrange
|
# Arrange
|
||||||
config.content_type = content_config
|
config.content_type = content_config
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ from src.utils.rawconfig import ContentConfig, SearchConfig
|
|||||||
|
|
||||||
# Test
|
# Test
|
||||||
# ----------------------------------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------------------------------
|
||||||
@pytest.mark.skip(reason="upstream issues in loading image search model. disabled for now")
|
|
||||||
def test_image_search_setup(content_config: ContentConfig, search_config: SearchConfig):
|
def test_image_search_setup(content_config: ContentConfig, search_config: SearchConfig):
|
||||||
# Act
|
# Act
|
||||||
# Regenerate image search embeddings during image setup
|
# Regenerate image search embeddings during image setup
|
||||||
@@ -27,7 +26,6 @@ def test_image_search_setup(content_config: ContentConfig, search_config: Search
|
|||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------------------------------
|
||||||
@pytest.mark.skip(reason="results inconsistent currently")
|
|
||||||
def test_image_search(content_config: ContentConfig, search_config: SearchConfig):
|
def test_image_search(content_config: ContentConfig, search_config: SearchConfig):
|
||||||
# Arrange
|
# Arrange
|
||||||
output_directory = resolve_absolute_path(web_directory)
|
output_directory = resolve_absolute_path(web_directory)
|
||||||
|
|||||||
Reference in New Issue
Block a user