Spaces:
Running
Running
File size: 693 Bytes
27e2770 dfecb5b 27e2770 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
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 ProteinSearchEngine # pylint: disable=import-error,import-outside-toplevel
index_path = Path("/data/indexes/pdb")
return ProteinSearchEngine(data_path=index_path)
|