diff --git a/main.py b/main.py index fc255981..ca32d3a2 100644 --- a/main.py +++ b/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 diff --git a/search_types/__init__.py b/search_type/__init__.py similarity index 100% rename from search_types/__init__.py rename to search_type/__init__.py diff --git a/search_types/asymmetric.py b/search_type/asymmetric.py similarity index 98% rename from search_types/asymmetric.py rename to search_type/asymmetric.py index 8ef1d75a..ddcd526e 100644 --- a/search_types/asymmetric.py +++ b/search_type/asymmetric.py @@ -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}") diff --git a/search_types/image-search.py b/search_type/image-search.py similarity index 100% rename from search_types/image-search.py rename to search_type/image-search.py diff --git a/search_types/symmetric.py b/search_type/symmetric.py similarity index 100% rename from search_types/symmetric.py rename to search_type/symmetric.py