Update app.py
Browse files
app.py
CHANGED
|
@@ -364,9 +364,6 @@ class AudioUpscaler:
|
|
| 364 |
@spaces.GPU(duration=300)
|
| 365 |
def inference(audio_file, model_name, guidance_scale, ddim_steps, seed):
|
| 366 |
audiosr = build_model(model_name=model_name)
|
| 367 |
-
|
| 368 |
-
if torch.cuda.is_avaible():
|
| 369 |
-
torch.cuda.empty_cache() # empty cuda cache
|
| 370 |
|
| 371 |
gc.collect()
|
| 372 |
|
|
@@ -416,8 +413,7 @@ def upscale_audio(
|
|
| 416 |
Returns:
|
| 417 |
tuple: Upscaled audio data and sample rate.
|
| 418 |
"""
|
| 419 |
-
|
| 420 |
-
torch.cuda.empty_cache()
|
| 421 |
|
| 422 |
gc.collect()
|
| 423 |
upscaler = AudioUpscaler()
|
|
@@ -434,8 +430,8 @@ def upscale_audio(
|
|
| 434 |
input_cutoff=input_cutoff,
|
| 435 |
)
|
| 436 |
|
| 437 |
-
|
| 438 |
-
|
| 439 |
|
| 440 |
gc.collect()
|
| 441 |
|
|
|
|
| 364 |
@spaces.GPU(duration=300)
|
| 365 |
def inference(audio_file, model_name, guidance_scale, ddim_steps, seed):
|
| 366 |
audiosr = build_model(model_name=model_name)
|
|
|
|
|
|
|
|
|
|
| 367 |
|
| 368 |
gc.collect()
|
| 369 |
|
|
|
|
| 413 |
Returns:
|
| 414 |
tuple: Upscaled audio data and sample rate.
|
| 415 |
"""
|
| 416 |
+
torch.cuda.empty_cache()
|
|
|
|
| 417 |
|
| 418 |
gc.collect()
|
| 419 |
upscaler = AudioUpscaler()
|
|
|
|
| 430 |
input_cutoff=input_cutoff,
|
| 431 |
)
|
| 432 |
|
| 433 |
+
|
| 434 |
+
torch.cuda.empty_cache()
|
| 435 |
|
| 436 |
gc.collect()
|
| 437 |
|