Update app.py
Browse filesSupport multi channels
app.py
CHANGED
@@ -44,7 +44,7 @@ class ChangeSampleRate(nn.Module):
|
|
44 |
model = lightning_module.BaselineLightningModule.load_from_checkpoint("epoch=3-step=7459.ckpt").eval()
|
45 |
|
46 |
def calc_mos(audio_path, ref):
|
47 |
-
wav, sr = torchaudio.load(audio_path)
|
48 |
osr = 16_000
|
49 |
batch = wav.unsqueeze(0).repeat(10, 1, 1)
|
50 |
csr = ChangeSampleRate(sr, osr)
|
|
|
44 |
model = lightning_module.BaselineLightningModule.load_from_checkpoint("epoch=3-step=7459.ckpt").eval()
|
45 |
|
46 |
def calc_mos(audio_path, ref):
|
47 |
+
wav, sr = torchaudio.load(audio_path, channels_first=True) # Mono channel
|
48 |
osr = 16_000
|
49 |
batch = wav.unsqueeze(0).repeat(10, 1, 1)
|
50 |
csr = ChangeSampleRate(sr, osr)
|