Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
|
@@ -34,10 +34,18 @@ from f5_tts.infer.utils_infer import (
|
|
| 34 |
load_model,
|
| 35 |
preprocess_ref_audio_text,
|
| 36 |
infer_process,
|
| 37 |
-
removeSilence_for_generated_wav,
|
| 38 |
save_spectrogram,
|
| 39 |
)
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
# Инициализация моделей
|
| 42 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 43 |
DEFAULT_TTS_MODEL = "F5-TTS_v1"
|
|
|
|
| 34 |
load_model,
|
| 35 |
preprocess_ref_audio_text,
|
| 36 |
infer_process,
|
|
|
|
| 37 |
save_spectrogram,
|
| 38 |
)
|
| 39 |
|
| 40 |
+
# Проверка наличия remove_silence_for_generated_wav
|
| 41 |
+
try:
|
| 42 |
+
from f5_tts.infer.utils_infer import remove_silence_for_generated_wav
|
| 43 |
+
except ImportError:
|
| 44 |
+
print("Warning: remove_silence_for_generated_wav not found in f5_tts.infer.utils_infer. Silence removal disabled.")
|
| 45 |
+
def remove_silence_for_generated_wav(wav_path):
|
| 46 |
+
print(f"Silence removal not available for {wav_path}. Returning original audio.")
|
| 47 |
+
return wav_path
|
| 48 |
+
|
| 49 |
# Инициализация моделей
|
| 50 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 51 |
DEFAULT_TTS_MODEL = "F5-TTS_v1"
|