Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,7 +37,8 @@ def predict_genre(audio):
|
|
| 37 |
sr, audio = audio
|
| 38 |
# print(audio)
|
| 39 |
# audio = np.ndarray(audio)
|
| 40 |
-
melspec = get_melspec_feature(y=audio, sr=target_sr, n_fft =frame_size, hop_length=frame_shift_len)
|
|
|
|
| 41 |
return {genre_classes[i]: float(prediction[i]) for i in range(5)}
|
| 42 |
|
| 43 |
|
|
|
|
| 37 |
sr, audio = audio
|
| 38 |
# print(audio)
|
| 39 |
# audio = np.ndarray(audio)
|
| 40 |
+
melspec = get_melspec_feature(y=audio, sr=target_sr, n_fft =frame_size, hop_length=frame_shift_len)
|
| 41 |
+
prediction = model.predict(melspec)[0]
|
| 42 |
return {genre_classes[i]: float(prediction[i]) for i in range(5)}
|
| 43 |
|
| 44 |
|