Upload folder using huggingface_hub
Browse files- __pycache__/model.cpython-313.pyc +0 -0
- inference.py +2 -1
__pycache__/model.cpython-313.pyc
CHANGED
|
Binary files a/__pycache__/model.cpython-313.pyc and b/__pycache__/model.cpython-313.pyc differ
|
|
|
inference.py
CHANGED
|
@@ -44,10 +44,11 @@ def _overlap_add(model, x: np.ndarray, sr: int, chunk_s: float=5., hop_s: float=
|
|
| 44 |
for i in range(n_chunks):
|
| 45 |
s = i*hop
|
| 46 |
seg = x_pad[:, s:s+chunk]
|
|
|
|
| 47 |
with torch.no_grad():
|
| 48 |
y = model(torch.from_numpy(seg[None]).to(device)).squeeze(0).cpu().numpy()
|
| 49 |
out[:, s:s+chunk] += y * win
|
| 50 |
-
norm[
|
| 51 |
|
| 52 |
return (out / norm)[:, :T]
|
| 53 |
|
|
|
|
| 44 |
for i in range(n_chunks):
|
| 45 |
s = i*hop
|
| 46 |
seg = x_pad[:, s:s+chunk]
|
| 47 |
+
seg = seg.astype(np.float32) # Ensure float32 for model input
|
| 48 |
with torch.no_grad():
|
| 49 |
y = model(torch.from_numpy(seg[None]).to(device)).squeeze(0).cpu().numpy()
|
| 50 |
out[:, s:s+chunk] += y * win
|
| 51 |
+
norm[:, s:s+chunk] += win
|
| 52 |
|
| 53 |
return (out / norm)[:, :T]
|
| 54 |
|