x
This commit is contained in:
@@ -7,18 +7,17 @@ import tempfile
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
# Add benchmarks dir to path to import config
|
||||
SCRIPT_DIR = Path(__file__).parent.resolve()
|
||||
BENCH_DIR = SCRIPT_DIR.parent / "benchmarks"
|
||||
# Add script dir to path
|
||||
SCRIPT_DIR = Path("/opt/script")
|
||||
OPT_DIR = Path("/opt")
|
||||
|
||||
# Config file path (check container path first, then local path)
|
||||
CONFIG_PATH = Path("/config.json")
|
||||
CONFIG_PATH = Path("/config/config.json")
|
||||
if not CONFIG_PATH.exists():
|
||||
CONFIG_PATH = SCRIPT_DIR.parent / "config.json"
|
||||
CONFIG_PATH = Path("/config.json")
|
||||
|
||||
# Local model directory (container path)
|
||||
LOCAL_MODEL_DIR = os.getenv("LOCAL_MODEL_DIR", str(SCRIPT_DIR.parent / "models"))
|
||||
LOCAL_MODEL_DIR = os.getenv("LOCAL_MODEL_DIR", "/opt/model")
|
||||
|
||||
# Load configuration from config.json
|
||||
try:
|
||||
@@ -31,10 +30,11 @@ except Exception as e:
|
||||
print(f"Error: Could not load config.json: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
# Results file path
|
||||
if (OPT_DIR / "max_context_results.json").exists():
|
||||
RESULTS_FILE = OPT_DIR / "max_context_results.json"
|
||||
else:
|
||||
RESULTS_FILE = BENCH_DIR / "max_context_results.json"
|
||||
RESULTS_FILE = SCRIPT_DIR / "max_context_results.json"
|
||||
HOST = os.getenv("HOST", "0.0.0.0")
|
||||
PORT = os.getenv("PORT", "8000")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user