Spaces:
Runtime error
Runtime error
update
Browse files
app.py
CHANGED
|
@@ -39,8 +39,9 @@ coquiTTS = CoquiTTS()
|
|
| 39 |
|
| 40 |
# Driver function
|
| 41 |
def driver_fun(audio, text) :
|
| 42 |
-
|
| 43 |
-
|
|
|
|
| 44 |
translation, lang = whisper_stt(audio)
|
| 45 |
else:
|
| 46 |
translation = text
|
|
@@ -72,6 +73,7 @@ def driver_fun(audio, text) :
|
|
| 72 |
# Whisper - speech-to-text
|
| 73 |
def whisper_stt(audio):
|
| 74 |
print("Inside Whisper TTS")
|
|
|
|
| 75 |
# load audio and pad/trim it to fit 30 seconds
|
| 76 |
audio = whisper.load_audio(audio)
|
| 77 |
audio = whisper.pad_or_trim(audio)
|
|
|
|
| 39 |
|
| 40 |
# Driver function
|
| 41 |
def driver_fun(audio, text) :
|
| 42 |
+
if audio is None:
|
| 43 |
+
|
| 44 |
+
if audio is not None and text == 'dummy':
|
| 45 |
translation, lang = whisper_stt(audio)
|
| 46 |
else:
|
| 47 |
translation = text
|
|
|
|
| 73 |
# Whisper - speech-to-text
|
| 74 |
def whisper_stt(audio):
|
| 75 |
print("Inside Whisper TTS")
|
| 76 |
+
|
| 77 |
# load audio and pad/trim it to fit 30 seconds
|
| 78 |
audio = whisper.load_audio(audio)
|
| 79 |
audio = whisper.pad_or_trim(audio)
|