-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
61 lines (51 loc) · 1.81 KB
/
Copy pathconfig.py
File metadata and controls
61 lines (51 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"""
Configuration for Hepatotoxicity Prediction Web Application
"""
import os
from pathlib import Path
# Base paths
BASE_DIR = Path(__file__).parent
PROJECT_ROOT = BASE_DIR.parent
# Detect if running on Render (deployment) or locally
IS_PRODUCTION = os.environ.get('RENDER') is not None or not (BASE_DIR / "models_local").exists()
# Model paths - use demo mode on Render, real models locally
if IS_PRODUCTION:
# DEMO MODE for Render deployment (no model files)
MODELS_DIR = BASE_DIR / "models"
GAHT_MODEL_PATH = None # GAHT disabled in demo mode
RF_MODEL_PATH = None # Use demo RF
MLP_MODEL_PATH = None # Use demo MLP
else:
# FULL MODE for local PC (real models with GAHT)
MODELS_DIR = BASE_DIR / "models_local"
GAHT_MODEL_PATH = MODELS_DIR / "gaht_fold_0.pth"
RF_MODEL_PATH = MODELS_DIR / "rf_fold_0.pkl"
MLP_MODEL_PATH = MODELS_DIR / "mlp_fold_0.pkl"
# Data paths - demo data on Render, full data locally
DATA_DIR = BASE_DIR / "data"
if IS_PRODUCTION:
DATASET_PATH = DATA_DIR / "demo_molecules.csv"
else:
DATASET_PATH = DATA_DIR / "combined_tox21_hepatotoxicity.csv"
# Results paths
RESULTS_DIR = PROJECT_ROOT / "submission_workspace" / "results"
METRICS_PATH = RESULTS_DIR / "metrics" / "final_results_summary.json"
STATS_PATH = RESULTS_DIR / "metrics" / "statistical_tests.json"
# Web application settings
APP_NAME = "HepatoTox Predictor"
APP_VERSION = "1.0.0"
SECRET_KEY = "hepatotox-research-2025-secure-key" # Change in production
# Model settings
USE_ENSEMBLE = False # Set True to use all 5 folds (slower but more accurate)
DEVICE = "cpu" # Change to "cuda" if GPU available
# Feature extraction settings
ECFP_RADIUS = 2
ECFP_BITS = 2048
MAX_CONFORMERS = 1
# UI settings
MOLECULES_PER_PAGE = 20
MAX_BATCH_SIZE = 100
# Flask settings
DEBUG = True
HOST = "0.0.0.0"
PORT = 5000