mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-03 13:19:16 +00:00
Enable Semantic Search on Images
This commit is contained in:
@@ -53,6 +53,10 @@ default_config = {
|
||||
{
|
||||
'compressed-jsonl': '.transactions.jsonl.gz',
|
||||
'embeddings-file': '.transaction_embeddings.pt'
|
||||
},
|
||||
'image':
|
||||
{
|
||||
'embeddings-file': '.image_embeddings.pt'
|
||||
}
|
||||
},
|
||||
'search-type':
|
||||
@@ -61,6 +65,10 @@ default_config = {
|
||||
{
|
||||
'encoder': "sentence-transformers/msmarco-MiniLM-L-6-v3",
|
||||
'cross-encoder': "cross-encoder/ms-marco-MiniLM-L-6-v2"
|
||||
},
|
||||
'image':
|
||||
{
|
||||
'encoder': "clip-ViT-B-32"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@ def get_absolute_path(filepath):
|
||||
return str(pathlib.Path(filepath).expanduser().absolute())
|
||||
|
||||
|
||||
def resolve_absolute_path(filepath, strict=False):
|
||||
return pathlib.Path(filepath).expanduser().absolute().resolve(strict=strict)
|
||||
|
||||
|
||||
def get_from_dict(dictionary, *args):
|
||||
'''null-aware get from a nested dictionary
|
||||
Returns: dictionary[args[0]][args[1]]... or None if any keys missing'''
|
||||
|
||||
Reference in New Issue
Block a user