diff --git a/bin/embeddings_manager b/bin/embeddings_manager index c3327e7..088ad82 100755 --- a/bin/embeddings_manager +++ b/bin/embeddings_manager @@ -2,6 +2,7 @@ import os import re +import sys from argparse import ArgumentParser from pathlib import Path, PurePosixPath from shutil import rmtree @@ -12,6 +13,13 @@ import boto3 from botocore import UNSIGNED from botocore.client import Config + +# Run from anywhere without setting PYTHONPATH, like the other bin/ scripts. +# The Dockerfile and CI both set it (`/app/src`, `./bin:./src`), so importing +# worked there and nowhere else -- including in this script's own documented +# usage. +sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "src")) + from data_generation.alliance import generate_alliance_embeddings from data_generation.reactome import generate_reactome_embeddings from data_generation.uniprot import generate_uniprot_embeddings diff --git a/bin/retrieval_baseline b/bin/retrieval_baseline index 8763dcd..bacd808 100755 --- a/bin/retrieval_baseline +++ b/bin/retrieval_baseline @@ -38,6 +38,13 @@ from langchain_core.documents import Document from langchain_core.retrievers import BaseRetriever from nltk.tokenize import word_tokenize + +# Run from anywhere without setting PYTHONPATH, like the other bin/ scripts. +# The Dockerfile and CI both set it (`/app/src`, `./bin:./src`), so importing +# worked there and nowhere else -- including in this script's own documented +# usage. +sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "src")) + from agent.models import get_embedding, get_llm from retrievers.csv_chroma import ( VECTOR_OVERFETCH,