274 строки
6.6 KiB
Plaintext
274 строки
6.6 KiB
Plaintext
# Vibevoice - TTS (Text-to-Speech) + ASR (Speech Recognition)
|
|
|
|
C++ inference engine per Microsoft VibeVoice con supporto per Text-to-Speech con voice cloning e Automatic Speech Recognition con diarizzazione.
|
|
|
|
## Requisiti
|
|
|
|
- Podman rootless
|
|
- Network `internal.network` configurata
|
|
- Nginx come reverse proxy
|
|
- GPU AMD con Vulkan (opzionale, per performance)
|
|
- Spazio disco: almeno 40 GB per i modelli
|
|
- Dipendenze di compilazione (cmake, git, gcc, etc.)
|
|
|
|
## Build Container
|
|
|
|
### 1. Compilare vibevoice.cpp
|
|
|
|
```bash
|
|
cd /home/badstorm/Source/bdi/bdi_podman_serverconf/containers/vibevoice
|
|
./build-container.sh
|
|
```
|
|
|
|
Lo script:
|
|
- Installa dipendenze (cmake, git, vulkan-dev, glslc, etc.)
|
|
- Clona vibevoice.cpp con submoduli
|
|
- Compila con supporto Vulkan
|
|
- Copia i binari in `bin-vulkan/`
|
|
- Crea l'entrypoint
|
|
|
|
### 2. Buildare l'immagine Podman
|
|
|
|
```bash
|
|
podman build -t vibevoice:vulkan-amd64 -f vibevoice-vulkan.Containerfile .
|
|
```
|
|
|
|
### 3. Verificare l'immagine
|
|
|
|
```bash
|
|
podman images | grep vibevoice
|
|
podman run --rm vibevoice:vulkan-amd64 --help
|
|
```
|
|
|
|
## Setup Runtime
|
|
|
|
### 1. Creare le directory di dati
|
|
|
|
```bash
|
|
mkdir -p /srv/containers/vibevoice/models
|
|
mkdir -p /srv/containers/vibevoice/audio
|
|
chmod 755 /srv/containers/vibevoice
|
|
```
|
|
|
|
### 2. Scaricare i modelli
|
|
|
|
I modelli sono disponibili su Hugging Face. Puoi scaricarli in diversi formati:
|
|
|
|
**Modelli TTS (Text-to-Speech):**
|
|
```bash
|
|
# Download vibevoice-realtime-0.5B (più veloce, ~2GB)
|
|
cd /srv/containers/vibevoice/models
|
|
pip install huggingface-hub
|
|
huggingface-cli download mudler/vibevoice.cpp-models \
|
|
vibevoice-realtime-0.5B-q8_0.gguf \
|
|
tokenizer.gguf \
|
|
voice-en-Carter_man.gguf \
|
|
--local-dir .
|
|
```
|
|
|
|
**Modelli TTS con Voice Cloning (1.5B):**
|
|
```bash
|
|
# Download vibevoice-1.5B (supporta voice cloning, ~6.8GB quantizzato)
|
|
huggingface-cli download microsoft/VibeVoice-1.5B \
|
|
--local-dir /srv/containers/vibevoice/models/vibevoice-1.5B
|
|
```
|
|
|
|
**Modelli ASR (Speech-to-Text):**
|
|
```bash
|
|
# Download vibevoice-asr (~33GB, quantizzato a Q4_K ~8GB)
|
|
huggingface-cli download mudler/vibevoice.cpp-models \
|
|
vibevoice-asr-q4_k.gguf \
|
|
tokenizer.gguf \
|
|
--local-dir .
|
|
```
|
|
|
|
### 3. Copiare il file quadlet
|
|
|
|
```bash
|
|
cp vibevoice.container ~/.config/containers/systemd/
|
|
```
|
|
|
|
### 4. Configurare il dominio
|
|
|
|
Modifica il file `~/.config/containers/systemd/vibevoice.container` se necessario per adattare i volumi ai tuoi modelli.
|
|
|
|
### 5. Copiare la configurazione Nginx
|
|
|
|
```bash
|
|
cp vibevoice.nginx /etc/nginx/conf.d/vibevoice.conf
|
|
```
|
|
|
|
Modifica il file per sostituire:
|
|
- `vibevoice.example.com` con il tuo dominio reale
|
|
- Percorsi SSL se diversi da Let's Encrypt default
|
|
|
|
### 6. Configurare i certificati SSL
|
|
|
|
```bash
|
|
sudo certbot certonly --standalone -d vibevoice.tuodominio.com
|
|
```
|
|
|
|
### 7. Riavviare Nginx
|
|
|
|
```bash
|
|
sudo systemctl reload nginx
|
|
# oppure per container nginx:
|
|
systemctl --user restart nginx
|
|
```
|
|
|
|
### 8. Avviare Vibevoice
|
|
|
|
```bash
|
|
systemctl --user daemon-reload
|
|
systemctl --user start vibevoice
|
|
systemctl --user enable vibevoice
|
|
```
|
|
|
|
## Verifica
|
|
|
|
Controlla che il container sia in esecuzione:
|
|
|
|
```bash
|
|
podman ps | grep vibevoice
|
|
```
|
|
|
|
Visualizza i log:
|
|
|
|
```bash
|
|
podman logs vibevoice
|
|
```
|
|
|
|
## Utilizzo CLI
|
|
|
|
Vibevoice.cpp fornisce una CLI per TTS e ASR:
|
|
|
|
### Text-to-Speech
|
|
|
|
```bash
|
|
podman exec vibevoice vibevoice-cli tts \
|
|
--model /app/models/vibevoice-realtime-0.5B-q8_0.gguf \
|
|
--tokenizer /app/models/tokenizer.gguf \
|
|
--voice /app/models/voice-en-Carter_man.gguf \
|
|
--text "Hello from vibevoice" \
|
|
--out /app/audio/output.wav
|
|
```
|
|
|
|
### Voice Cloning (1.5B)
|
|
|
|
```bash
|
|
podman exec vibevoice vibevoice-cli tts \
|
|
--model /app/models/vibevoice-1.5B-q8_0.gguf \
|
|
--tokenizer /app/models/tokenizer.gguf \
|
|
--ref-audio /app/audio/reference_voice.wav \
|
|
--text "Hello, I am cloning this voice" \
|
|
--out /app/audio/cloned.wav
|
|
```
|
|
|
|
### Multi-Speaker Dialog (1.5B)
|
|
|
|
```bash
|
|
podman exec vibevoice vibevoice-cli tts \
|
|
--model /app/models/vibevoice-1.5B-q8_0.gguf \
|
|
--tokenizer /app/models/tokenizer.gguf \
|
|
--ref-audio /app/audio/voice_carter.wav \
|
|
--ref-audio /app/audio/voice_emma.wav \
|
|
--text "Speaker 0: Hello, I am Carter. Speaker 1: And I am Emma." \
|
|
--out /app/audio/dialog.wav
|
|
```
|
|
|
|
### Automatic Speech Recognition
|
|
|
|
```bash
|
|
podman exec vibevoice vibevoice-cli asr \
|
|
--model /app/models/vibevoice-asr-q4_k.gguf \
|
|
--tokenizer /app/models/tokenizer.gguf \
|
|
--audio /app/audio/my_audio.wav
|
|
```
|
|
|
|
## Modelli Disponibili
|
|
|
|
### TTS Models
|
|
- **vibevoice-realtime-0.5B**: Modello veloce per TTS real-time con voci preregistrate
|
|
- Size: ~2 GB (quantizzato Q8_0)
|
|
- Velocità: RTF < 1x su GPU
|
|
- Voci: Multiple lingue (en, de, fr, etc.)
|
|
|
|
- **vibevoice-1.5B**: Modello con voice cloning e multi-speaker
|
|
- Size: ~6.8 GB (quantizzato Q8_0), ~11 GB (float32)
|
|
- Caratteristiche: Voice cloning, dialog multi-speaker
|
|
- Richiede: ~16GB RAM disponibili
|
|
|
|
### ASR Models
|
|
- **vibevoice-asr**: Modello per transcription long-form con diarizzazione
|
|
- Size: ~33 GB (float32), ~8 GB (quantizzato Q4_K)
|
|
- Caratteristiche: Multi-speaker diarizzazione, timestamp precisi
|
|
- Lingue: Multiple lingue supportate
|
|
|
|
### Quantization Options
|
|
```bash
|
|
# Q8_0: No quality loss, ~50% size reduction
|
|
# Q6_K: Mixed quantization, best quality/size ratio
|
|
# Q5_K: Smaller, some quality trade-off
|
|
# Q4_K: Smallest, ASR only (TTS non supportato)
|
|
```
|
|
|
|
## Performance
|
|
|
|
### CPU Benchmarks (AMD Ryzen 9950X3D)
|
|
- ASR (68.5s audio): ~2.195 RTF (5.9s load + 150.4s processing)
|
|
- TTS: ~1-3s per senso dipendentemente dalla lunghezza
|
|
|
|
### GPU Benchmarks (NVIDIA GB10)
|
|
- ASR (68.5s audio): ~0.408 RTF (2.2s load + 28s processing)
|
|
|
|
### AMD Vulkan (Recommended)
|
|
Simile a CUDA per velocità con migliore compatibilità hardware.
|
|
|
|
## Troubleshooting
|
|
|
|
### Build fails con dipendenze mancanti
|
|
```bash
|
|
# Esegui lo script con sudo o aggiungi il tuo utente al sudoers
|
|
sudo ./build-container.sh
|
|
```
|
|
|
|
### Memory Issues durante il build
|
|
Se hai meno di 8GB di RAM, il build potrebbe essere lento:
|
|
```bash
|
|
# Build single-threaded
|
|
cmake --build build -j 1
|
|
```
|
|
|
|
### GPU Non Riconosciuta
|
|
```bash
|
|
# Verifica che il container veda la GPU
|
|
podman run --rm --device=/dev/dri --device=/dev/kfd ghcr.io/localai-org/vibevoice rocm-smi
|
|
```
|
|
|
|
### Modelli Non Trovati
|
|
```bash
|
|
# Verifica che il mounting dei volumi sia corretto
|
|
podman exec vibevoice ls -la /app/models
|
|
```
|
|
|
|
## Aggiornamento
|
|
|
|
Per aggiornare a una versione più recente di vibevoice.cpp:
|
|
|
|
```bash
|
|
# Ricompila
|
|
./build-container.sh --no-cache
|
|
|
|
# Rebuild immagine
|
|
podman build -t vibevoice:vulkan-amd64 -f vibevoice-vulkan.Containerfile .
|
|
|
|
# Riavvia container
|
|
systemctl --user restart vibevoice
|
|
```
|
|
|
|
## References
|
|
|
|
- [Vibevoice.cpp GitHub](https://github.com/localai-org/vibevoice.cpp)
|
|
- [Models on Hugging Face](https://huggingface.co/mudler/vibevoice.cpp-models)
|
|
- [VibeVoice Paper](https://microsoft.github.io/VibeVoice/)
|