mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 15:38:55 +01:00
Remove additional references to image content config
This commit is contained in:
parent
105dbf49e4
commit
d11354f9c8
3 changed files with 1 additions and 37 deletions
|
@ -53,17 +53,8 @@ class NotionContentConfig(ConfigBase):
|
|||
token: str
|
||||
|
||||
|
||||
class ImageContentConfig(ConfigBase):
|
||||
input_directories: Optional[List[Path]] = None
|
||||
input_filter: Optional[List[str]] = None
|
||||
embeddings_file: Path
|
||||
use_xmp_metadata: bool
|
||||
batch_size: int
|
||||
|
||||
|
||||
class ContentConfig(ConfigBase):
|
||||
org: Optional[TextContentConfig] = None
|
||||
image: Optional[ImageContentConfig] = None
|
||||
markdown: Optional[TextContentConfig] = None
|
||||
pdf: Optional[TextContentConfig] = None
|
||||
plaintext: Optional[TextContentConfig] = None
|
||||
|
|
|
@ -30,12 +30,7 @@ from khoj.utils import fs_syncer, state
|
|||
from khoj.utils.config import SearchModels
|
||||
from khoj.utils.constants import web_directory
|
||||
from khoj.utils.helpers import resolve_absolute_path
|
||||
from khoj.utils.rawconfig import (
|
||||
ContentConfig,
|
||||
ImageContentConfig,
|
||||
ImageSearchConfig,
|
||||
SearchConfig,
|
||||
)
|
||||
from khoj.utils.rawconfig import ContentConfig, ImageSearchConfig, SearchConfig
|
||||
from tests.helpers import (
|
||||
ChatModelOptionsFactory,
|
||||
OfflineChatProcessorConversationConfigFactory,
|
||||
|
@ -223,13 +218,6 @@ def content_config(tmp_path_factory, search_models: SearchModels, default_user:
|
|||
|
||||
# Generate Image Embeddings from Test Images
|
||||
content_config = ContentConfig()
|
||||
content_config.image = ImageContentConfig(
|
||||
input_filter=None,
|
||||
input_directories=["tests/data/images"],
|
||||
embeddings_file=content_dir.joinpath("image_embeddings.pt"),
|
||||
batch_size=1,
|
||||
use_xmp_metadata=False,
|
||||
)
|
||||
|
||||
LocalOrgConfig.objects.create(
|
||||
input_files=None,
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
import pytest
|
||||
|
||||
from khoj.utils.rawconfig import ImageContentConfig, TextContentConfig
|
||||
|
||||
|
||||
# Test
|
||||
# ----------------------------------------------------------------------------------------------------
|
||||
def test_input_filter_or_directories_required_in_image_content_config():
|
||||
# Act
|
||||
with pytest.raises(ValueError):
|
||||
ImageContentConfig(
|
||||
input_directories=None,
|
||||
input_filter=None,
|
||||
embeddings_file="note_embeddings.pt",
|
||||
)
|
Loading…
Reference in a new issue