Spaces:
Runtime error
Runtime error
add log
Browse files- gradio_utils.py +3 -0
gradio_utils.py
CHANGED
@@ -6,6 +6,8 @@ import numpy as np
|
|
6 |
import librosa
|
7 |
|
8 |
import gradio as gr
|
|
|
|
|
9 |
|
10 |
def predict_gradio(data,
|
11 |
uniform_lambda,
|
@@ -26,6 +28,7 @@ def predict_gradio(data,
|
|
26 |
prediction = sklearn_model.predict_proba(y_uniform.reshape(1, -1))
|
27 |
result = {str(label): float(confidence) for (
|
28 |
label, confidence) in zip(classes, prediction.flatten())}
|
|
|
29 |
return result
|
30 |
|
31 |
def load_as_librosa(y: np.ndarray, sr: int, target_sr: int = 22050) -> np.ndarray:
|
|
|
6 |
import librosa
|
7 |
|
8 |
import gradio as gr
|
9 |
+
from datetime import datetime
|
10 |
+
|
11 |
|
12 |
def predict_gradio(data,
|
13 |
uniform_lambda,
|
|
|
28 |
prediction = sklearn_model.predict_proba(y_uniform.reshape(1, -1))
|
29 |
result = {str(label): float(confidence) for (
|
30 |
label, confidence) in zip(classes, prediction.flatten())}
|
31 |
+
print(f"{datetime.now()} predict {prediction}")
|
32 |
return result
|
33 |
|
34 |
def load_as_librosa(y: np.ndarray, sr: int, target_sr: int = 22050) -> np.ndarray:
|