Spaces:
Running
on
T4
Running
on
T4
gorkemgoknar
commited on
Commit
•
4e13633
1
Parent(s):
8d2ef4c
Update app.py
Browse files
app.py
CHANGED
@@ -201,12 +201,7 @@ def predict(prompt, language, audio_file_pth, mic_file_path, use_mic, voice_clea
|
|
201 |
if "Failed to decode" in str(e):
|
202 |
print("Speaker encoding error", str(e))
|
203 |
gr.Warning("It appears something wrong with reference, did you unmute your microphone?")
|
204 |
-
|
205 |
-
None,
|
206 |
-
None,
|
207 |
-
None,
|
208 |
-
None,
|
209 |
-
)
|
210 |
|
211 |
latent_calculation_time = time.time() - t_latent
|
212 |
#metrics_text=f"Embedding calculation time: {latent_calculation_time:.2f} seconds\n"
|
@@ -276,8 +271,12 @@ def predict(prompt, language, audio_file_pth, mic_file_path, use_mic, voice_clea
|
|
276 |
# HF Space specific.. This error is unrecoverable need to restart space
|
277 |
api.restart_space(repo_id=repo_id)
|
278 |
else:
|
279 |
-
|
280 |
-
|
|
|
|
|
|
|
|
|
281 |
return (
|
282 |
None,
|
283 |
None,
|
|
|
201 |
if "Failed to decode" in str(e):
|
202 |
print("Speaker encoding error", str(e))
|
203 |
gr.Warning("It appears something wrong with reference, did you unmute your microphone?")
|
204 |
+
|
|
|
|
|
|
|
|
|
|
|
205 |
|
206 |
latent_calculation_time = time.time() - t_latent
|
207 |
#metrics_text=f"Embedding calculation time: {latent_calculation_time:.2f} seconds\n"
|
|
|
271 |
# HF Space specific.. This error is unrecoverable need to restart space
|
272 |
api.restart_space(repo_id=repo_id)
|
273 |
else:
|
274 |
+
if "Failed to decode" in str(e):
|
275 |
+
print("Speaker encoding error", str(e))
|
276 |
+
gr.Warning("It appears something wrong with reference, did you unmute your microphone?")
|
277 |
+
else:
|
278 |
+
print("RuntimeError: non device-side assert error:", str(e))
|
279 |
+
gr.Warning("Something unexpected happened please retry again.")
|
280 |
return (
|
281 |
None,
|
282 |
None,
|