Spaces:
Build error
Build error
Update app_rvc.py
Browse files- app_rvc.py +9 -2
app_rvc.py
CHANGED
|
@@ -1,9 +1,15 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
-
os.system("pip install -q piper-
|
|
|
|
|
|
|
| 4 |
os.system("pip install -q -r requirements_xtts.txt")
|
| 5 |
os.system("pip install -q TTS==0.21.1 --no-deps")
|
| 6 |
import spaces
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
import librosa
|
| 8 |
from soni_translate.logging_setup import (
|
| 9 |
logger,
|
|
@@ -11,7 +17,6 @@ from soni_translate.logging_setup import (
|
|
| 11 |
configure_logging_libs,
|
| 12 |
); configure_logging_libs() # noqa
|
| 13 |
import whisperx
|
| 14 |
-
import torch
|
| 15 |
import os
|
| 16 |
from soni_translate.audio_segments import create_translated_audio
|
| 17 |
from soni_translate.text_to_speech import (
|
|
@@ -1312,6 +1317,8 @@ class SoniTranslate(SoniTrCache):
|
|
| 1312 |
):
|
| 1313 |
if "gpt" in translate_process:
|
| 1314 |
check_openai_api_key()
|
|
|
|
|
|
|
| 1315 |
|
| 1316 |
SOURCE_LANGUAGE = LANGUAGES[origin_language]
|
| 1317 |
if translate_process != "disable_translation":
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
+
os.system("pip install -q https://github.com/R3gm/piper-phonemize/releases/download/1.2.0/piper_phonemize-1.2.0-cp310-cp310-win_amd64.whl")
|
| 4 |
+
os.system("pip install -q sherpa-onnx==1.9.12")
|
| 5 |
+
os.system("pip install -q piper-tts==1.2.0 --no-deps")
|
| 6 |
os.system("pip install -q -r requirements_xtts.txt")
|
| 7 |
os.system("pip install -q TTS==0.21.1 --no-deps")
|
| 8 |
import spaces
|
| 9 |
+
import torch
|
| 10 |
+
if os.environ.get("ZERO_GPU") != "TRUE" and torch.cuda.is_available():
|
| 11 |
+
# onnxruntime GPU
|
| 12 |
+
os.system("pip install ort-nightly-gpu --index-url=https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ort-cuda-12-nightly/pypi/simple/")
|
| 13 |
import librosa
|
| 14 |
from soni_translate.logging_setup import (
|
| 15 |
logger,
|
|
|
|
| 17 |
configure_logging_libs,
|
| 18 |
); configure_logging_libs() # noqa
|
| 19 |
import whisperx
|
|
|
|
| 20 |
import os
|
| 21 |
from soni_translate.audio_segments import create_translated_audio
|
| 22 |
from soni_translate.text_to_speech import (
|
|
|
|
| 1317 |
):
|
| 1318 |
if "gpt" in translate_process:
|
| 1319 |
check_openai_api_key()
|
| 1320 |
+
elif "gemini" in translate_process:
|
| 1321 |
+
check_gemini_api_key()
|
| 1322 |
|
| 1323 |
SOURCE_LANGUAGE = LANGUAGES[origin_language]
|
| 1324 |
if translate_process != "disable_translation":
|