File size: 2,790 Bytes
69f0c15
 
 
 
4b36346
69f0c15
 
 
aac14c4
69f0c15
 
 
 
 
 
 
aac14c4
69f0c15
 
 
 
 
 
 
 
 
 
aac14c4
69f0c15
 
aac14c4
69f0c15
 
 
 
 
 
 
aac14c4
f829ba3
 
69f0c15
f829ba3
69f0c15
 
 
f829ba3
69f0c15
 
 
f829ba3
aac14c4
f829ba3
aac14c4
69f0c15
 
 
4b36346
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
"""
Configuration constants and logging setup.
"""

import logging
import os
import sys
import torch

# ── Logging ─────────────────────────────────────────────────────────────────
logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
    handlers=[logging.StreamHandler(sys.stdout)],
)
logger = logging.getLogger("rvc")

# ── Device detection ────────────────────────────────────────────────────────
if torch.cuda.is_available():
    DEVICE = "cuda"
    DEVICE_LABEL = "GPU (CUDA)"
elif torch.backends.mps.is_available():
    DEVICE = "mps"
    DEVICE_LABEL = "GPU (Apple Metal)"
else:
    DEVICE = "cpu"
    DEVICE_LABEL = "CPU"

# ── Limits ──────────────────────────────────────────────────────────────────
MAX_INPUT_DURATION = 600  # seconds (10 minutes)

# ── Built-in models ─────────────────────────────────────────────────────────
BUILTIN_MODELS = {
    "Vestia Zeta v1": "vestia_zeta_v1",
    "Vestia Zeta v2": "vestia_zeta_v2",
    "Ayunda Risu": "ayunda_risu",
    "Gawr Gura": "gawr_gura",
}

# ── Demucs configuration ────────────────────────────────────────────────────
DEMUCS_MODEL = "htdemucs"
DEMUCS_DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
DEMUCS_SEPARATION_DIR = "separated"

# ── Output formats ──────────────────────────────────────────────────────────
OUTPUT_FORMATS = ["WAV", "MP3", "FLAC", "OPUS"]
DEFAULT_OUTPUT_FORMAT = "MP3"

# ── Paths ───────────────────────────────────────────────────────────────────
MODELS_DIR = "models"
OUTPUTS_DIR = "outputs"

# ── Gradio CSS ──────────────────────────────────────────────────────────────
CSS = """
    #header { text-align: center; margin-bottom: 1rem; }
    #status { text-align: center; font-weight: bold; }
    footer { visibility: hidden; }
"""