Spaces:
Running on Zero
Running on Zero
Download src/utils/config.py from SAJIDIUBAT/bangla-ser-api: direct link, hf CLI and curl.
- Browser
- Download file 1.47 kB
-
https://huggingface.co/spaces/SAJIDIUBAT/bangla-ser-api/resolve/main/src/utils/config.py
- Command line
-
hf download hf://spaces/SAJIDIUBAT/bangla-ser-api/src/utils/config.py
-
curl -L -o config.py https://huggingface.co/spaces/SAJIDIUBAT/bangla-ser-api/resolve/main/src/utils/config.py
1.47 kB
| """Global configuration constants and project path definitions.""" | |
| import os | |
| from pathlib import Path | |
| # Root directory of the project | |
| PROJECT_ROOT = Path(__file__).resolve().parent.parent.parent | |
| # Dataset paths | |
| DATASET_DIR = PROJECT_ROOT / "dataset" | |
| RAW_DATA_DIR = DATASET_DIR / "BASE" | |
| PROCESSED_DATA_DIR = DATASET_DIR / "processed" | |
| METADATA_DIR = DATASET_DIR / "metadata" | |
| # Research and paper | |
| RESEARCH_DIR = PROJECT_ROOT / "research" | |
| # Output directories | |
| EXPERIMENTS_DIR = PROJECT_ROOT / "experiments" | |
| MODELS_DIR = PROJECT_ROOT / "models" | |
| RESULTS_DIR = PROJECT_ROOT / "results" | |
| REPORTS_DIR = PROJECT_ROOT / "reports" | |
| AUDIT_RESULTS_DIR = RESULTS_DIR / "audit" | |
| AUDIT_REPORTS_DIR = REPORTS_DIR / "audit" | |
| # Audio standardization parameters | |
| TARGET_SAMPLE_RATE = 16000 | |
| TARGET_CHANNELS = 1 # Mono | |
| AUDIO_BIT_DEPTH = 16 | |
| MAX_DURATION_SECONDS = 10.0 # Max window length for models | |
| MIN_DURATION_SECONDS = 1.0 | |
| # Emotion classes (strictly defined from BASE dataset) | |
| EMOTION_CLASSES = ["Angry", "Excited", "Happy", "Neutral", "Sad"] | |
| NUM_CLASSES = len(EMOTION_CLASSES) | |
| EMOTION_TO_ID = {emotion: idx for idx, emotion in enumerate(EMOTION_CLASSES)} | |
| ID_TO_EMOTION = {idx: emotion for idx, emotion in enumerate(EMOTION_CLASSES)} | |
| # Reproducibility | |
| RANDOM_SEED = 42 | |
| # Ensure key directories exist | |
| for path in [PROCESSED_DATA_DIR, METADATA_DIR, EXPERIMENTS_DIR, MODELS_DIR, RESULTS_DIR, REPORTS_DIR, AUDIT_RESULTS_DIR, AUDIT_REPORTS_DIR]: | |
| path.mkdir(parents=True, exist_ok=True) | |