From 9703afb8145ef1bb70fb514f4bf53a31c2f724cd Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Mon, 16 Aug 2021 16:04:45 -0700 Subject: [PATCH] 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 --- main.py | 2 +- {search_types => search_type}/__init__.py | 0 {search_types => search_type}/asymmetric.py | 4 ++-- {search_types => search_type}/image-search.py | 0 {search_types => search_type}/symmetric.py | 0 5 files changed, 3 insertions(+), 3 deletions(-) rename {search_types => search_type}/__init__.py (100%) rename {search_types => search_type}/asymmetric.py (98%) rename {search_types => search_type}/image-search.py (100%) rename {search_types => search_type}/symmetric.py (100%) 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