« CrispASR » : différence entre les versions
Autres actions
| Ligne 29 : | Ligne 29 : | ||
Les exécutables sont générés dans le répertoire <code>/opt/CrispASR/build/bin/</code>. | Les exécutables sont générés dans le répertoire <code>/opt/CrispASR/build/bin/</code>. | ||
=== Mise à jour === | |||
# cd /opt/CrispASR/ | |||
# rm -r build | |||
# git pull --recurse-submodules | |||
# export CUDACXX=/usr/local/cuda-<font color=blue>13.3</font>/bin/nvcc | |||
# cmake -B build -DCMAKE_BUILD_TYPE=Release -DGGML_CUDA=ON -DGGML_CUDA_FA_ALL_QUANTS=ON -DGGML_LTO=ON | |||
# cmake --build build -j$(nproc) | |||
=== Fix temporaire : traiter les fichiers WebM via FFmpeg === | === Fix temporaire : traiter les fichiers WebM via FFmpeg === | ||
Version du 4 septembre 2026 à 09:37
Installation
- On récupère le projet :
# cd /opt/ # git clone --recurse-submodules https://github.com/CrispStrobe/CrispASR # cd CrispASR
- On installe quelques dépendances avant la compilation ( activer les dépôts contrib et non-free si nécessaire) :
# apt update # apt install libopencore-amrnb-dev libopencore-amrwb-dev libopus-dev libopusfile-dev libopenblas-dev ccache libfdk-aac-dev libsentencepiece-dev sentencepiece libopenblas-dev libnccl2 libnccl-dev libmp3lame-dev ffmepg # ln -s /usr/lib/x86_64-linux-gnu/libopenblas.so /usr/local/lib/libcblas.so # ldconfig
- On configure la compilation en choisissant le backend adapté au matériel utilisé.
Version CPU :
# cmake -B build -DCMAKE_BUILD_TYPE=Release
Version NVIDIA avec CUDA — nécessite l’installation préalable du CUDA Toolkit :
# export CUDACXX=/usr/local/cuda-13.3/bin/nvcc # cmake -B build -DCMAKE_BUILD_TYPE=Release -DGGML_CUDA=ON -DGGML_CUDA_FA_ALL_QUANTS=ON -DGGML_LTO=ON
Version Apple Silicon avec Metal :
# cmake -B build -DCMAKE_BUILD_TYPE=Release -DGGML_METAL=ON
Version Vulkan — nécessite l’installation préalable des bibliothèques et outils de développement Vulkan :
# cmake -B build -DCMAKE_BUILD_TYPE=Release -DGGML_VULKAN=ON
- On lance ensuite la compilation :
# cmake --build build -j$(nproc)
Les exécutables sont générés dans le répertoire /opt/CrispASR/build/bin/.
Mise à jour
# cd /opt/CrispASR/ # rm -r build # git pull --recurse-submodules # export CUDACXX=/usr/local/cuda-13.3/bin/nvcc # cmake -B build -DCMAKE_BUILD_TYPE=Release -DGGML_CUDA=ON -DGGML_CUDA_FA_ALL_QUANTS=ON -DGGML_LTO=ON # cmake --build build -j$(nproc)
Fix temporaire : traiter les fichiers WebM via FFmpeg
Les fichiers WebM générés par Chrome/Chromium avec MediaRecorder peuvent être tronqués par le décodeur WebM natif de CrispASR.
Ce contournement force l'utilisation du binaire FFmpeg externe pour les fichiers .webm.
Éditer le fichier :
# vi /opt/CrispASR/examples/common-crispasr.cpp
Ajouter après la ligne :
const int effective_rate = (target_rate > 0) ? target_rate : CRISPASR_SAMPLE_RATE;
Le code suivant :
// Workaround: Chrome MediaRecorder WebM/Opus can be incorrectly
// truncated by the native WebM loader. Force external ffmpeg for WebM.
if (fname.size() >= 5 &&
fname.compare(fname.size() - 5, 5, ".webm") == 0 &&
effective_rate == CRISPASR_SAMPLE_RATE) {
if (ffmpeg_subprocess_decode(fname, pcmf32)) {
if (stereo) {
pcmf32s.resize(2);
pcmf32s[0] = pcmf32;
pcmf32s[1] = pcmf32;
}
return true;
}
fprintf(stderr, "crispasr: ffmpeg subprocess failed for WebM '%s'\n",
fname.c_str());
}
Soit au final :
const int effective_rate = (target_rate > 0) ? target_rate : CRISPASR_SAMPLE_RATE;
// Workaround: Chrome MediaRecorder WebM/Opus can be incorrectly
// truncated by the native WebM loader. Force external ffmpeg for WebM.
if (fname.size() >= 5 &&
fname.compare(fname.size() - 5, 5, ".webm") == 0 &&
effective_rate == CRISPASR_SAMPLE_RATE) {
if (ffmpeg_subprocess_decode(fname, pcmf32)) {
if (stereo) {
pcmf32s.resize(2);
pcmf32s[0] = pcmf32;
pcmf32s[1] = pcmf32;
}
return true;
}
fprintf(stderr, "crispasr: ffmpeg subprocess failed for WebM '%s'\n",
fname.c_str());
}
Puis recompiler CrispASR :
# cd /opt/CrispASR # cmake --build build -j$(nproc)
Enfin, redémarrer le ou les services CrispASR :
# systemctl restart NOM_DU_SERVICE
Exemples
Speech-to-Text
Voir Client Hugging Face
# hf download cstr/parakeet-tdt-0.6b-v3-GGUF --include "*q8_0*.gguf" --local-dir /opt/models/stt/parakeet-tdt-0.6b-v3/q8_0
# vi /etc/systemd/system/crispasr-stt.service
[Unit]
Description=CrispASR Speech-to-Text Server
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/CrispASR
Environment="CRISPASR_API_KEYS=masuperclef"
ExecStart=/opt/CrispASR/build/bin/crispasr \
--server \
--backend parakeet \
-m /opt/models/stt/parakeet-tdt-0.6b-v3/q8_0/parakeet-tdt-0.6b-v3-q8_0.gguf \
--language auto \
--host 0.0.0.0 \
--port 7980
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
Text-to-Speech
Voir Client Hugging Face
# hf download cstr/qwen3-tts-0.6b-base-GGUF --include "*q8_0*.gguf" --local-dir /opt/models/tts/qwen3-tts-0.6b-base-GGUF/q8_0 # hf download cstr/qwen3-tts-tokenizer-12hz-GGUF --include "qwen3-tts-tokenizer-12hz.gguf" --local-dir /opt/models/tts/qwen3-tts-0.6b-base-GGUF/q8_0
# vi /etc/systemd/system/crispasr-tts.service
[Unit]
Description=CrispASR Text-to-Speech Server
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/CrispASR
Environment="CRISPASR_API_KEYS=masuperclef"
ExecStart=/opt/CrispASR/build/bin/crispasr \
--server \
--backend qwen3-tts \
-m /opt/models/tts/qwen3-tts-0.6b-base-GGUF/q8_0/qwen3-tts-12hz-0.6b-base-q8_0.gguf \
--codec-model /opt/models/tts/qwen3-tts-0.6b-base-GGUF/q8_0/qwen3-tts-tokenizer-12hz.gguf \
--voice-dir /opt/voices \
--i-have-rights \
--language fr \
--host 0.0.0.0 \
--port 7981
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
Voir Client Hugging Face
# hf download cstr/chatterbox-GGUF --include "*q8_0*.gguf" --local-dir /opt/models/tts/chatterbox-GGUF/q8_0
- Installer des voix :
# mkdir /opt/voices
Fichier .wav avec un nom de personnalité dans le dossier /opt/voices
Optionnellement on joint le fichier de la transcription exacte de l’enregistrement, exemple :
# vi /opt/voices/henriette.txt
bla bla bla
GGUF : :
cd /opt/CrispASR python3 -m venv .venv-chatterbox source .venv-chatterbox/bin/activate pip install --upgrade pip pip install numpy source /opt/CrispASR/.venv-chatterbox/bin/activate pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu128 pip install chatterbox-tts pip install gguf
# python models/bake-chatterbox-voice-from-wav.py --input /opt/voices/henriette.wav --output /opt/voices/henriette.gguf
# vi /etc/systemd/system/crispasr-tts.service
[Unit]
Description=CrispASR Text-to-Speech Server
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/CrispASR
ExecStart=/opt/CrispASR/build/bin/crispasr \
--server \
--backend chatterbox \
-m /opt/models/tts/chatterbox-GGUF/q8_0/chatterbox-t3-q8_0.gguf \
--codec-model /opt/models/tts/chatterbox-GGUF/q8_0/chatterbox-s3gen-q8_0.gguf \
--voice-dir /opt/voices \
--i-have-rights \
--language fr \
--host 0.0.0.0 \
--port 7981
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
Voir Client Hugging Face
# hf download cstr/omnivoice-GGUF --include "*q8_0*.gguf" --local-dir /opt/models/tts/omnivoice-GGUF/q8_0
# vi /etc/systemd/system/crispasr-tts.service
[Unit]
Description=CrispASR Text-to-Speech Server
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/CrispASR
ExecStart=/opt/CrispASR/build/bin/crispasr \
--server \
--backend omnivoice \
-m /opt/models/tts/omnivoice-GGUF/q8_0/omnivoice-q8_0.gguf \
--codec-model /opt/models/tts/omnivoice-GGUF/q8_0/omnivoice-tokenizer-q8_0.gguf \
--voice-dir /opt/voices \
--i-have-rights \
--language fr \
--host 0.0.0.0 \
--port 7981
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target