Spaces:
Running
on
Zero
Running
on
Zero
fix
Browse files
app.py
CHANGED
@@ -36,8 +36,9 @@ def predict_mos(audio_path: str):
|
|
36 |
ratings = []
|
37 |
for listner in range(1, 11):
|
38 |
wav, sr = torchaudio.load(audio_path)
|
39 |
-
if
|
40 |
-
|
|
|
41 |
waves = [wav.view(-1).to(model.device)]
|
42 |
srs = torch.tensor(sr).view(1, -1).to(model.device)
|
43 |
if model.condition_sr:
|
|
|
36 |
ratings = []
|
37 |
for listner in range(1, 11):
|
38 |
wav, sr = torchaudio.load(audio_path)
|
39 |
+
if model.condition_sr:
|
40 |
+
if sr not in model.sr2id.keys():
|
41 |
+
return f"Error: Sample rate {sr} not supported by the model. Supported rates: {list(model.sr2id.keys())}"
|
42 |
waves = [wav.view(-1).to(model.device)]
|
43 |
srs = torch.tensor(sr).view(1, -1).to(model.device)
|
44 |
if model.condition_sr:
|