protein_binding_search / get_index.py
roni
showing gene info
b2a3d53
raw
history blame
624 Bytes
import sys
from pathlib import Path
from huggingface_hub import snapshot_download
from credentials import get_token
def get_engine(index_repo: str, model_repo: str):
index_path = Path(
snapshot_download(index_repo, use_auth_token=get_token(), repo_type="dataset")
)
local_arch_path = Path(
snapshot_download(model_repo, use_auth_token=get_token(), repo_type="model")
)
sys.path.append(str(local_arch_path))
from protein_index import ( # pylint: disable=import-error,import-outside-toplevel
ProteinSearchEngine,
)
return ProteinSearchEngine(data_path=index_path)