Pin Applio 3.6.5 and verified basis assets, migrate private voice provenance, and coordinate conversion/live/training with Deck GPU leases. Prepare an inactive voice profile and a restricted studio container. Move CUDA and Torch caches out of the small temporary filesystem to prevent OmniVoice reference failures. Package app updates from the explicit allowlist in one Docker layer.
49 lines
1.6 KiB
Python
49 lines
1.6 KiB
Python
"""Tests for presets."""
|
|
|
|
|
|
def test_all_presets_exist():
|
|
from app.services.presets import get_presets
|
|
presets = get_presets()
|
|
assert len(presets) >= 7
|
|
ids = {p["id"] for p in presets}
|
|
assert "sprache-neutral" in ids
|
|
assert "gesang" in ids
|
|
assert "schnelle-vorschau" in ids
|
|
assert "maenner-zu-frauen" in ids
|
|
assert "frauen-zu-maennern" in ids
|
|
assert "gleiche-stimmlage" in ids
|
|
assert "benutzerdefiniert" in ids
|
|
|
|
|
|
def test_preset_parameters_valid():
|
|
from app.services.presets import get_presets
|
|
for p in get_presets():
|
|
params = p["parameters"]
|
|
if "pitch" in params:
|
|
assert -24 <= params["pitch"] <= 24, f"Pitch out of range in {p['id']}"
|
|
if "index_rate" in params:
|
|
assert 0 <= params["index_rate"] <= 1
|
|
if "protect" in params:
|
|
assert 0 <= params["protect"] <= 0.5
|
|
if "f0_method" in params:
|
|
assert params["f0_method"] in [
|
|
"crepe", "crepe-tiny", "rmvpe", "fcpe",
|
|
"hybrid[crepe+rmvpe]", "hybrid[crepe+fcpe]",
|
|
"hybrid[rmvpe+fcpe]", "hybrid[crepe+rmvpe+fcpe]",
|
|
]
|
|
|
|
|
|
def test_get_preset_by_id():
|
|
from app.services.presets import get_preset
|
|
p = get_preset("gesang")
|
|
assert p is not None
|
|
assert p.name == "Gesang"
|
|
assert p.parameters.get("f0_autotune") is True
|
|
assert get_preset("nonexistent") is None
|
|
|
|
|
|
def test_default_f0_method_is_rmvpe():
|
|
from app.services.presets import get_preset
|
|
neutral = get_preset("sprache-neutral")
|
|
assert neutral.parameters["f0_method"] == "rmvpe"
|