Spaces:
Runtime error
Runtime error
Commit
·
de47435
1
Parent(s):
a8923f2
Update app.py
Browse files
app.py
CHANGED
|
@@ -87,6 +87,7 @@ def infer1(text):
|
|
| 87 |
import numpy as np
|
| 88 |
import torch
|
| 89 |
from hifi_gan_bwe import BandwidthExtender
|
|
|
|
| 90 |
|
| 91 |
MAX_LENGTH = 600.0
|
| 92 |
|
|
@@ -103,8 +104,9 @@ def extend(audio):
|
|
| 103 |
y = np.stack([model(torch.from_numpy(x), fs) for x in x.T]).T
|
| 104 |
y = (y * 32767.0).astype(np.int16)
|
| 105 |
fs = int(model.sample_rate)
|
|
|
|
| 106 |
|
| 107 |
-
return
|
| 108 |
|
| 109 |
|
| 110 |
app = gr.Blocks()
|
|
|
|
| 87 |
import numpy as np
|
| 88 |
import torch
|
| 89 |
from hifi_gan_bwe import BandwidthExtender
|
| 90 |
+
from scipy.io.wavfile import write
|
| 91 |
|
| 92 |
MAX_LENGTH = 600.0
|
| 93 |
|
|
|
|
| 104 |
y = np.stack([model(torch.from_numpy(x), fs) for x in x.T]).T
|
| 105 |
y = (y * 32767.0).astype(np.int16)
|
| 106 |
fs = int(model.sample_rate)
|
| 107 |
+
write("upsample.wav", fs, y)
|
| 108 |
|
| 109 |
+
return "upsample.wav"
|
| 110 |
|
| 111 |
|
| 112 |
app = gr.Blocks()
|