mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +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 fastapi import FastAPI
|
||||
from search_types import asymmetric
|
||||
from search_type import asymmetric
|
||||
import argparse
|
||||
import pathlib
|
||||
import uvicorn
|
||||
|
||||
@@ -40,10 +40,10 @@ def extract_entries(notesfile, verbose=False):
|
||||
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"
|
||||
# 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))
|
||||
if verbose:
|
||||
print(f"Loaded embeddings from {embeddings_file}")
|
||||
Reference in New Issue
Block a user