| from pathlib import Path |
|
|
|
|
| APP_ROOT = Path(__file__).resolve().parents[1] |
| RUNTIME_ROOT = Path("/tmp/sesa") |
| JOB_ROOT = RUNTIME_ROOT / "jobs" |
| MODEL_ROOT = RUNTIME_ROOT / "model-cache" |
| DOWNLOAD_ROOT = RUNTIME_ROOT / "downloads" |
| EXAMPLE_ROOT = RUNTIME_ROOT / "examples" |
| DATASET_SAMPLE_ROOT = EXAMPLE_ROOT / "dataset-samples" |
| MAX_DATASET_SAMPLE_FILE_BYTES = 500_000_000 |
| MAX_DATASET_SAMPLE_ARCHIVE_BYTES = 1_000_000_000 |
|
|
| MAX_FILES = 8 |
| MAX_MODELS = 6 |
| MAX_FILE_BYTES = 1_500_000_000 |
| MAX_WEIGHT_BYTES = 10_000_000_000 |
| MAX_CONFIG_BYTES = 5_000_000 |
| CPU_MAX_SECONDS = 120.0 |
| JOB_TTL_SECONDS = 6 * 60 * 60 |
|
|
| AUDIO_EXTENSIONS = { |
| ".wav", ".flac", ".mp3", ".ogg", ".opus", ".m4a", ".aiff", ".aif", ".ac3", ".wma" |
| } |
| VIDEO_EXTENSIONS = { |
| ".mp4", ".mov", ".mkv", ".webm", ".avi", ".mpeg", ".mpg", ".m4v" |
| } |
| INPUT_EXTENSIONS = AUDIO_EXTENSIONS | VIDEO_EXTENSIONS |
| OUTPUT_FORMATS = ["WAV", "FLAC", "MP3", "OGG", "OPUS", "M4A", "AIFF"] |
| ENSEMBLE_ALGORITHMS = [ |
| "avg_wave", "median_wave", "min_wave", "max_wave", |
| "avg_fft", "median_fft", "min_fft", "max_fft", |
| "uvr_max_spec", "uvr_min_spec", "ensemble_wav", |
| ] |
| STEM_CHOICES = ["All stems", "Vocals", "Instrumental", "Drums", "Bass", "Other", "Guitar", "Piano"] |
|
|
| SAFE_PACKAGE_MODELS = [ |
| ("MDX β Instrumental HQ 5", "UVR-MDX-NET-Inst_HQ_5.onnx"), |
| ("MDX β Instrumental HQ 3", "UVR-MDX-NET-Inst_HQ_3.onnx"), |
| ("MDX β Vocal FT", "UVR-MDX-NET-Voc_FT.onnx"), |
| ("MDX β Karaoke 2", "UVR_MDXNET_KARA_2.onnx"), |
| ("VR β De-Reverb", "UVR-De-Reverb-aufr33-jarredou.pth"), |
| ] |
|
|
| ALLOWED_INITIAL_HOSTS = { |
| "huggingface.co", |
| "www.huggingface.co", |
| "github.com", |
| "www.github.com", |
| "raw.githubusercontent.com", |
| } |
| ALLOWED_REDIRECT_HOSTS = ALLOWED_INITIAL_HOSTS | { |
| "cdn-lfs.hf.co", |
| "cas-bridge.xethub.hf.co", |
| "cas-server.xethub.hf.co", |
| "objects.githubusercontent.com", |
| "release-assets.githubusercontent.com", |
| } |
|
|