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:
Debanjum Singh Solanky 2021-08-16 16:04:45 -07:00
parent 19d6678eb1
commit 9703afb814
5 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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}")