Spaces:
Runtime error
Runtime error
Ahsen Khaliq
commited on
Commit
·
43b9586
1
Parent(s):
354946e
Update app.py
Browse files
app.py
CHANGED
@@ -62,16 +62,13 @@ def inference(audio):
|
|
62 |
# specs are in [-1, 1], making them in [0, 1]
|
63 |
wav_x = vocoder((x + 1) / 2).squeeze().detach().cpu().numpy()
|
64 |
wav_xrec = vocoder((xrec + 1) / 2).squeeze().detach().cpu().numpy()
|
65 |
-
# Creating a temp folder which will hold the results
|
66 |
-
tmp_dir = os.path.join('./tmp/neural_audio_codec', Path(input_wav).parent.stem)
|
67 |
-
os.makedirs(tmp_dir, exist_ok=True)
|
68 |
# Save paths
|
69 |
-
x_save_path =
|
70 |
-
xrec_save_path =
|
71 |
# Save
|
72 |
soundfile.write(x_save_path, wav_x, model_sr, 'PCM_16')
|
73 |
soundfile.write(xrec_save_path, wav_xrec, model_sr, 'PCM_16')
|
74 |
-
return '
|
75 |
|
76 |
title = "Anime2Sketch"
|
77 |
description = "demo for Anime2Sketch. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
|
|
|
62 |
# specs are in [-1, 1], making them in [0, 1]
|
63 |
wav_x = vocoder((x + 1) / 2).squeeze().detach().cpu().numpy()
|
64 |
wav_xrec = vocoder((xrec + 1) / 2).squeeze().detach().cpu().numpy()
|
|
|
|
|
|
|
65 |
# Save paths
|
66 |
+
x_save_path = 'vocoded_orig_spec.wav'
|
67 |
+
xrec_save_path = f'specvqgan_{bitrate:.2f}kbps.wav'
|
68 |
# Save
|
69 |
soundfile.write(x_save_path, wav_x, model_sr, 'PCM_16')
|
70 |
soundfile.write(xrec_save_path, wav_xrec, model_sr, 'PCM_16')
|
71 |
+
return 'vocoded_orig_spec.wav', f'specvqgan_{bitrate:.2f}kbps.wav'
|
72 |
|
73 |
title = "Anime2Sketch"
|
74 |
description = "demo for Anime2Sketch. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
|