Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,7 +24,16 @@ whisper_modelpath_translator= {
|
|
| 24 |
def speech_to_text(audio_path, whisper_model):
|
| 25 |
|
| 26 |
if(audio_path is None):
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
print(audio_path)
|
| 29 |
try:
|
| 30 |
|
|
|
|
| 24 |
def speech_to_text(audio_path, whisper_model):
|
| 25 |
|
| 26 |
if(audio_path is None):
|
| 27 |
+
retry_cnt = 0
|
| 28 |
+
for retry_cnt in range(3):
|
| 29 |
+
if(audio_path is None):
|
| 30 |
+
print(f'Retrying, retry counter: {retry_cnt +1}')
|
| 31 |
+
time.sleep(0.5)
|
| 32 |
+
retry_cnt +=1
|
| 33 |
+
if retry_cnt == 3:
|
| 34 |
+
raise ValueError("Error no audio input")
|
| 35 |
+
else:
|
| 36 |
+
break
|
| 37 |
print(audio_path)
|
| 38 |
try:
|
| 39 |
|