Spaces:
Running
Running
Commit
·
c8b76df
1
Parent(s):
d099713
Update app.py
Browse files
app.py
CHANGED
|
@@ -196,12 +196,6 @@ def predict(prompt, language, audio_file_pth, mic_file_path, use_mic, voice_clea
|
|
| 196 |
if "Failed to decode" in str(e):
|
| 197 |
print("Speaker encoding error", str(e))
|
| 198 |
gr.Warning("It appears something wrong with reference, did you unmute your microphone?")
|
| 199 |
-
return (
|
| 200 |
-
None,
|
| 201 |
-
None,
|
| 202 |
-
None,
|
| 203 |
-
None,
|
| 204 |
-
)
|
| 205 |
|
| 206 |
latent_calculation_time = time.time() - t_latent
|
| 207 |
##metrics_text=f"Embedding calculation time: {latent_calculation_time:.2f} seconds\n"
|
|
@@ -280,9 +274,13 @@ def predict(prompt, language, audio_file_pth, mic_file_path, use_mic, voice_clea
|
|
| 280 |
# HF Space specific.. This error is unrecoverable need to restart space
|
| 281 |
api.restart_space(repo_id=repo_id)
|
| 282 |
else:
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 286 |
return (
|
| 287 |
None,
|
| 288 |
None,
|
|
|
|
| 196 |
if "Failed to decode" in str(e):
|
| 197 |
print("Speaker encoding error", str(e))
|
| 198 |
gr.Warning("It appears something wrong with reference, did you unmute your microphone?")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
|
| 200 |
latent_calculation_time = time.time() - t_latent
|
| 201 |
##metrics_text=f"Embedding calculation time: {latent_calculation_time:.2f} seconds\n"
|
|
|
|
| 274 |
# HF Space specific.. This error is unrecoverable need to restart space
|
| 275 |
api.restart_space(repo_id=repo_id)
|
| 276 |
else:
|
| 277 |
+
if "Failed to decode" in str(e):
|
| 278 |
+
print("Speaker encoding error", str(e))
|
| 279 |
+
gr.Warning("It appears something wrong with reference, did you unmute your microphone?")
|
| 280 |
+
else:
|
| 281 |
+
print("RuntimeError: non device-side assert error:", str(e))
|
| 282 |
+
gr.Warning("Something unexpected happened please retry again.")
|
| 283 |
+
|
| 284 |
return (
|
| 285 |
None,
|
| 286 |
None,
|