Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
a4e6839
1
Parent(s):
0a2ac2e
add torch cuda empty cache for oom
Browse files
app.py
CHANGED
@@ -308,7 +308,11 @@ def http_bot(state, temperature, top_p, max_new_tokens, speaker):
|
|
308 |
|
309 |
id = str(uuid.uuid4())
|
310 |
os.makedirs("./demo_audio", exist_ok=True)
|
311 |
-
|
|
|
|
|
|
|
|
|
312 |
temp_file = f"./demo_audio/{id}_temp_audio.wav"
|
313 |
except Exception as e:
|
314 |
os.system("nvidia-smi")
|
|
|
308 |
|
309 |
id = str(uuid.uuid4())
|
310 |
os.makedirs("./demo_audio", exist_ok=True)
|
311 |
+
try:
|
312 |
+
synthesis(content_unit, style_centroid_embedding, hps, net_g, f"./demo_audio/{id}_temp_audio.wav")
|
313 |
+
except:
|
314 |
+
torch.cuda.empty_cache()
|
315 |
+
synthesis(content_unit, style_centroid_embedding, hps, net_g, f"./demo_audio/{id}_temp_audio.wav")
|
316 |
temp_file = f"./demo_audio/{id}_temp_audio.wav"
|
317 |
except Exception as e:
|
318 |
os.system("nvidia-smi")
|