mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 21:29:13 +00:00
Rename search_types to search_type to standardize to singular naming
Using singular names for other directories in application already - processor instead of processors - interface instead of interfaces
This commit is contained in:
2
main.py
2
main.py
@@ -1,6 +1,6 @@
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
from search_types import asymmetric
|
from search_type import asymmetric
|
||||||
import argparse
|
import argparse
|
||||||
import pathlib
|
import pathlib
|
||||||
import uvicorn
|
import uvicorn
|
||||||
|
|||||||
@@ -40,10 +40,10 @@ def extract_entries(notesfile, verbose=False):
|
|||||||
return entries
|
return entries
|
||||||
|
|
||||||
|
|
||||||
def compute_embeddings(entries, bi_encoder, embeddings_file, verbose=False):
|
def compute_embeddings(entries, bi_encoder, embeddings_file, regenerate=False, verbose=False):
|
||||||
"Compute (and Save) Embeddings or Load Pre-Computed Embeddings"
|
"Compute (and Save) Embeddings or Load Pre-Computed Embeddings"
|
||||||
# Load pre-computed embeddings from file if exists
|
# Load pre-computed embeddings from file if exists
|
||||||
if embeddings_file.exists():
|
if embeddings_file.exists() and not regenerate:
|
||||||
corpus_embeddings = torch.load(get_absolute_path(embeddings_file))
|
corpus_embeddings = torch.load(get_absolute_path(embeddings_file))
|
||||||
if verbose:
|
if verbose:
|
||||||
print(f"Loaded embeddings from {embeddings_file}")
|
print(f"Loaded embeddings from {embeddings_file}")
|
||||||
Reference in New Issue
Block a user