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.
160 lines
5.9 KiB
Markdown
160 lines
5.9 KiB
Markdown
# Applio-Integration
|
||
|
||
## Fester Applio-Commit
|
||
|
||
Diese Anwendung ist auf exakt diesen Applio-Stand ausgelegt:
|
||
|
||
```
|
||
Commit: 7fa68ec2166ab1331c539704159fa14901e94e5a
|
||
Repo: https://github.com/IAHispano/Applio
|
||
Image: mike-ai/applio-studio:7fa68ec
|
||
```
|
||
|
||
Alle verwendeten Funktionen und Parameter wurden in diesem Commit verifiziert
|
||
(Quellcode aus dem gestoppten Container `mike-ai-applio-studio` gelesen,
|
||
ohne den Container zu starten).
|
||
|
||
## Warum interne Funktionen statt Gradio-API?
|
||
|
||
Applio stellt im laufenden Zustand eine Gradio-generierte Schnittstelle unter
|
||
`/gradio_api/info` bereit. Die automatisch benannten `/lambda_*`-Endpunkte
|
||
sind **keine stabile Grundlage**:
|
||
|
||
- Parameter-Namen wie `api:0`, `api:1` sind nicht semantisch.
|
||
- Die Endpunkt-Struktur ändert sich mit Gradio- und Applio-Versionen.
|
||
- Es gibt keine Versionierung oder Dokumentation.
|
||
|
||
Mikes-Applio-UI nutzt daher die **internen Python-Funktionen** von Applio,
|
||
die über `core.py` importiert werden. Diese sind:
|
||
|
||
- stabil innerhalb des festgelegten Commits,
|
||
- semantisch benannt,
|
||
- direkt testbar.
|
||
|
||
## Verwendete Funktionen und ihre Herkunft
|
||
|
||
### Inferenz (Sprachumwandlung)
|
||
|
||
**Funktion:** `core.run_infer_script()`
|
||
**Datei:** `core.py` (Zeilen 55–181 im Commit 7fa68ec)
|
||
**Aufruf:** Über `rvc.infer.infer.VoiceConverter().convert_audio(**kwargs)`
|
||
|
||
Verwendete Parameter (alle in `run_infer_script()` vorhanden):
|
||
|
||
| Parameter | Typ | Standard | Herkunft |
|
||
|-----------|-----|----------|----------|
|
||
| `pitch` | int | 0 | `run_infer_script(pitch=...)` |
|
||
| `index_rate` | float | 0.3 | `run_infer_script(index_rate=...)` |
|
||
| `volume_envelope` | float | 1.0 | `run_infer_script(volume_envelope=...)` |
|
||
| `protect` | float | 0.33 | `run_infer_script(protect=...)` |
|
||
| `f0_method` | str | "rmvpe" | `run_infer_script(f0_method=...)` |
|
||
| `split_audio` | bool | False | `run_infer_script(split_audio=...)` |
|
||
| `f0_autotune` | bool | False | `run_infer_script(f0_autotune=...)` |
|
||
| `f0_autotune_strength` | float | 1.0 | `run_infer_script(f0_autotune_strength=...)` |
|
||
| `proposed_pitch` | bool | False | `run_infer_script(proposed_pitch=...)` |
|
||
| `proposed_pitch_threshold` | float | – | `run_infer_script(proposed_pitch_threshold=...)` |
|
||
| `clean_audio` | bool | False | `run_infer_script(clean_audio=...)` |
|
||
| `clean_strength` | float | 0.7 | `run_infer_script(clean_strength=...)` |
|
||
| `export_format` | str | "WAV" | `run_infer_script(export_format=...)` |
|
||
| `embedder_model` | str | – | `run_infer_script(embedder_model=...)` |
|
||
| `embedder_model_custom` | str | None | `run_infer_script(embedder_model_custom=...)` |
|
||
| `input_path` | str | – | `run_infer_script(input_path=...)` |
|
||
| `output_path` | str | – | `run_infer_script(output_path=...)` |
|
||
| `pth_path` | str | – | `run_infer_script(pth_path=...)` |
|
||
| `index_path` | str | – | `run_infer_script(index_path=...)` |
|
||
| `sid` | int | 0 | `run_infer_script(sid=...)` |
|
||
|
||
**F0-Methoden:** `rmvpe`, `crepe`, `crepe-tiny`, `contentvec`, `spin-v2`
|
||
(alle in Applio 3.6.4 verfügbar, `rmvpe` als sinnvolle Voreinstellung).
|
||
|
||
### Training
|
||
|
||
**Funktion:** `core.run_train_script()`
|
||
**Datei:** `core.py`
|
||
|
||
Verwendete Parameter:
|
||
|
||
| Parameter | Typ | Standard |
|
||
|-----------|-----|----------|
|
||
| `model_name` | str | – |
|
||
| `vocoder` | str | "HiFi-GAN" |
|
||
| `total_epoch` | int | 100 |
|
||
| `save_every_epoch` | int | 10 |
|
||
| `save_only_latest` | bool | False |
|
||
| `sample_rate` | int | 40000 |
|
||
| `batch_size` | int | 8 |
|
||
| `gpu` | str | "0" |
|
||
| `pretrained` | bool | True |
|
||
| `cache_data_in_gpu` | bool | False |
|
||
| `checkpointing` | bool | False |
|
||
| `cleanup` | bool | False |
|
||
| `index_algorithm` | str | "Auto" |
|
||
|
||
### Preprocessing
|
||
|
||
**Funktion:** `core.run_preprocess_script()`
|
||
**Datei:** `core.py`
|
||
|
||
Parameter: `model_name`, `dataset_path`, `sample_rate`, `cut_preprocess`,
|
||
`noise_reduction`, `noise_reduction_strength`, `chunk_len`, `overlap_len`,
|
||
`normalization_mode`, `cpu_cores`.
|
||
|
||
### Merkmalsextraktion
|
||
|
||
**Funktion:** `core.run_extract_script()`
|
||
**Datei:** `core.py`
|
||
|
||
Parameter: `model_name`, `f0_method`, `sample_rate`, `embedder_model`,
|
||
`include_mutes`, `gpu`, `cpu_cores`.
|
||
|
||
### Index-Erzeugung
|
||
|
||
**Funktion:** `core.run_index_script()`
|
||
**Datei:** `core.py`
|
||
|
||
Parameter: `model_name`, `index_algorithm`.
|
||
|
||
## CLI vs. interne Funktionen
|
||
|
||
Applio bietet eine CLI (`python core.py infer` etc.). Für die Integration
|
||
werden **interne Python-Funktionen** bevorzugt, weil:
|
||
|
||
1. Die CLI-Argumente sind weniger vollständig als die Funktionsparameter.
|
||
2. Interne Aufrufe erlauben saubere Fehlerbehandlung (Exceptions statt
|
||
Exitcodes).
|
||
3. Die Funktionen sind direkt importierbar und testbar.
|
||
|
||
Der RealRunner kapselt den Aufruf über `docker exec` in den Applio-Container
|
||
und nutzt die interne API.
|
||
|
||
## Unterschied: Unsere API vs. Gradio-API
|
||
|
||
| Aspekt | Mikes-Applio-UI API | Applio Gradio-API |
|
||
|--------|---------------------|-------------------|
|
||
| Stabilität | Versioniert, dokumentiert | Ändert sich mit Gradio |
|
||
| Parameter | Semantisch benannt | `api:0`, `api:1` |
|
||
| Fehler | Verständliche deutsche Meldungen | Rohe Tracebacks |
|
||
| Erfolg | Artefakt-Existenzprüfung | Exitcode 0 |
|
||
| Auth | Lokal, keine | Lokal, keine |
|
||
| Fortschritt | Phasen + Prozent + Lebenszeichen | Kein Fortschritt |
|
||
|
||
## Verhalten bei Fehlern
|
||
|
||
- **Exitcode ≠ 0:** Der Runner fängt den Fehler, liest `stderr`, und markiert
|
||
den Job als `fehlgeschlagen` mit verständlicher Meldung.
|
||
- **Fehlende Artefakte:** Selbst bei Exitcode 0 wird der Job als
|
||
`fehlgeschlagen` markiert, wenn die erwarteten Dateien fehlen.
|
||
- **Timeout:** Der Runner bricht den Prozess nach konfigurierbarer Zeit ab.
|
||
- **Abbruch:** `cancel_event` wird geprüft, der Prozess wird sauber beendet.
|
||
|
||
## Erfolgsprüfung
|
||
|
||
Ein Job gilt **nur dann** als erfolgreich, wenn:
|
||
|
||
1. Der Prozess mit Exitcode 0 beendet wurde.
|
||
2. Alle erwarteten Artefakte existieren.
|
||
3. Die Artefakte lesbar sind und eine sinnvolle Größe haben (> 0 Bytes).
|
||
4. Bei Training: Die PTH-Dateien existieren und größer als ein Mindestwert sind.
|
||
|
||
Ein bloßer Exitcode 0 reicht **nicht** als Erfolgsnachweis.
|