Download BACKUP_PATH_CONFIG.py from dirven/numerai_all_48_models: direct link, hf CLI and curl.
- Browser
- Download file 2.76 kB
-
https://huggingface.co/datasets/dirven/numerai_all_48_models/resolve/main/BACKUP_PATH_CONFIG.py
- Command line
-
hf download hf://datasets/dirven/numerai_all_48_models/BACKUP_PATH_CONFIG.py
-
curl -L -o BACKUP_PATH_CONFIG.py https://huggingface.co/datasets/dirven/numerai_all_48_models/resolve/main/BACKUP_PATH_CONFIG.py
2.76 kB
| """ | |
| Path configuration for running scripts from backup folder | |
| Import this at the top of each script to automatically adjust paths | |
| """ | |
| from pathlib import Path | |
| import os | |
| # Detect if we're running from backup | |
| BACKUP_DIR = Path("/app") | |
| RUNNING_FROM_BACKUP = Path.cwd().resolve().is_relative_to(BACKUP_DIR.resolve()) | |
| if RUNNING_FROM_BACKUP: | |
| print("🔧 BACKUP MODE: Using backup folder paths") | |
| # Base paths | |
| BASE_DIR = BACKUP_DIR | |
| MODELS_DIR = BACKUP_DIR / "models" | |
| SCRIPTS_DIR = BACKUP_DIR / "scripts" | |
| # Tournament-specific model paths | |
| MODELS = { | |
| 'root': MODELS_DIR / "root", | |
| 'main': MODELS_DIR / "main", | |
| 'signals': MODELS_DIR / "signals", | |
| 'crypto': MODELS_DIR / "crypto", | |
| } | |
| # Output directories | |
| SUBMISSIONS_DIR = BACKUP_DIR / "submissions" | |
| SUBMISSIONS_DIR.mkdir(exist_ok=True) | |
| # Create tournament submission folders | |
| for tournament in ['main', 'signals', 'crypto']: | |
| (SUBMISSIONS_DIR / tournament).mkdir(exist_ok=True) | |
| # Path mapping function | |
| def get_model_path(tournament, filename): | |
| """Get model file path for given tournament""" | |
| if tournament == 'crypto' and 'crypto_full_activations' in filename: | |
| return MODELS['crypto'] / 'crypto_full_activations' / Path(filename).name | |
| elif tournament == 'main' and 'trained_models' in filename: | |
| return MODELS['main'] / 'trained_models' / Path(filename).name | |
| else: | |
| return MODELS[tournament] / filename | |
| def get_submission_path(tournament): | |
| """Get submission directory for tournament""" | |
| return SUBMISSIONS_DIR / tournament | |
| # Config paths | |
| CONFIG_DIR = BACKUP_DIR / "config" | |
| else: | |
| print("📠PRODUCTION MODE: Using production paths") | |
| # Production paths remain as-is | |
| BASE_DIR = Path("C:/tournament_numerai") | |
| def get_model_path(tournament, filename): | |
| """Return production paths""" | |
| if tournament == 'crypto': | |
| return Path("c:/tournament_numerai/crypto/models/crypto_full_activations") / filename | |
| elif tournament == 'main' and 'trained_models' in filename: | |
| return Path("C:/tournament_numerai/main/trained_models") / filename | |
| else: | |
| return Path(f"C:/tournament_numerai/{tournament}") / filename | |
| def get_submission_path(tournament): | |
| """Get production submission directory""" | |
| return Path(f"C:/tournament_numerai/{tournament}/submissions") | |
| CONFIG_DIR = Path("C:/3tournaments/historical_validation") | |
| # Print configuration | |
| print(f" Base: {BASE_DIR}") | |
| if RUNNING_FROM_BACKUP: | |
| print(f" Models: {MODELS_DIR}") | |
| print(f" Submissions: {SUBMISSIONS_DIR}") | |