ccnasef-cyber
Add protein function prediction API
3d5b11c
Raw
History Blame Contribute Delete
1.13 kB
from pathlib import Path
# ── Paths ────────────────────────────────────────────────────────────────────
BASE_DIR = Path(__file__).resolve().parent.parent
MODEL_PATH = BASE_DIR / "models" / "best_model.pt"
GO_TERMS_PATH = BASE_DIR / "models" / "go_terms_list.txt"
# ── Model Architecture (must match training exactly) ──────────────────────────
ESM2_MODEL_NAME = "facebook/esm2_t33_650M_UR50D"
ESM2_DIM = 1280
HIDDEN_DIM = 512
NUM_LABELS = 4201
# ── Inference ─────────────────────────────────────────────────────────────────
THRESHOLD = 0.5 # sigmoid threshold for positive prediction
MAX_SEQ_LEN = 1022 # ESM2 max tokens (excluding special tokens)
WINDOW_SIZE = 1022
WINDOW_STRIDE = 1022 - 256 # = 766 (same overlap used in training)