mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-06 05:39:12 +00:00
Move tests out to project root. Use absolute import in project
tests/ directory in project root is more standard. Just had to use absolute path for internal module imports to get it to work
This commit is contained in:
@@ -15,9 +15,9 @@ import torch
|
||||
from sentence_transformers import SentenceTransformer, CrossEncoder, util
|
||||
|
||||
# Internal Packages
|
||||
from utils.helpers import get_absolute_path, resolve_absolute_path
|
||||
from processor.org_mode.org_to_jsonl import org_to_jsonl
|
||||
from utils.config import TextSearchModel, TextSearchConfig
|
||||
from src.utils.helpers import get_absolute_path, resolve_absolute_path
|
||||
from src.processor.org_mode.org_to_jsonl import org_to_jsonl
|
||||
from src.utils.config import TextSearchModel, TextSearchConfig
|
||||
|
||||
|
||||
def initialize_model():
|
||||
@@ -106,7 +106,7 @@ def explicit_filter(hits, entries, required_words, blocked_words):
|
||||
hits_by_word_set = [(set(word.lower()
|
||||
for word
|
||||
in re.split(
|
||||
',|\.| |\]|\[\(|\)|\{|\}',
|
||||
r',|\.| |\]|\[\(|\)|\{|\}',
|
||||
entries[hit['corpus_id']])
|
||||
if word != ""),
|
||||
hit)
|
||||
|
||||
@@ -10,9 +10,9 @@ from tqdm import trange
|
||||
import torch
|
||||
|
||||
# Internal Packages
|
||||
from utils.helpers import get_absolute_path, resolve_absolute_path
|
||||
import utils.exiftool as exiftool
|
||||
from utils.config import ImageSearchModel, ImageSearchConfig
|
||||
from src.utils.helpers import get_absolute_path, resolve_absolute_path
|
||||
import src.utils.exiftool as exiftool
|
||||
from src.utils.config import ImageSearchModel, ImageSearchConfig
|
||||
|
||||
|
||||
def initialize_model():
|
||||
|
||||
@@ -13,9 +13,9 @@ import torch
|
||||
from sentence_transformers import SentenceTransformer, CrossEncoder, util
|
||||
|
||||
# Internal Packages
|
||||
from utils.helpers import get_absolute_path, resolve_absolute_path
|
||||
from processor.ledger.beancount_to_jsonl import beancount_to_jsonl
|
||||
from utils.config import TextSearchModel, TextSearchConfig
|
||||
from src.utils.helpers import get_absolute_path, resolve_absolute_path
|
||||
from src.processor.ledger.beancount_to_jsonl import beancount_to_jsonl
|
||||
from src.utils.config import TextSearchModel, TextSearchConfig
|
||||
|
||||
|
||||
def initialize_model():
|
||||
@@ -98,7 +98,7 @@ def explicit_filter(hits, entries, required_words, blocked_words):
|
||||
hits_by_word_set = [(set(word.lower()
|
||||
for word
|
||||
in re.split(
|
||||
',|\.| |\]|\[\(|\)|\{|\}',
|
||||
r',|\.| |\]|\[\(|\)|\{|\}',
|
||||
entries[hit['corpus_id']])
|
||||
if word != ""),
|
||||
hit)
|
||||
|
||||
Reference in New Issue
Block a user