JyuViole commited on
Commit
f74c39c
·
verified ·
1 Parent(s): a0a0b6d

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
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"