Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -79,7 +79,7 @@ def extract_features(data):
|
|
79 |
result = np.hstack((result, mel)) # stacking horizontally
|
80 |
|
81 |
return result
|
82 |
-
|
83 |
def audio_emotions(audio):
|
84 |
sr,data = audio
|
85 |
features_audio = extract_features(data)
|
@@ -89,11 +89,11 @@ def audio_emotions(audio):
|
|
89 |
prediction=reloaded_model.predict(scaled_features)
|
90 |
y_pred = encoder.inverse_transform(prediction)
|
91 |
return y_pred
|
92 |
-
|
93 |
def main(audio):
|
94 |
r1,r2=inference_text(audio)
|
95 |
-
r3=audio_emotions(audio)
|
96 |
-
return r1,r2
|
97 |
|
98 |
|
99 |
#audio = gr.Audio(
|
@@ -104,4 +104,4 @@ def main(audio):
|
|
104 |
# )
|
105 |
|
106 |
|
107 |
-
app=gr.Interface(title="Sentiment Audio Analysis",fn=main,inputs=gr.Audio(source="microphone"), outputs=["text","text"
|
|
|
79 |
result = np.hstack((result, mel)) # stacking horizontally
|
80 |
|
81 |
return result
|
82 |
+
"""
|
83 |
def audio_emotions(audio):
|
84 |
sr,data = audio
|
85 |
features_audio = extract_features(data)
|
|
|
89 |
prediction=reloaded_model.predict(scaled_features)
|
90 |
y_pred = encoder.inverse_transform(prediction)
|
91 |
return y_pred
|
92 |
+
"""
|
93 |
def main(audio):
|
94 |
r1,r2=inference_text(audio)
|
95 |
+
#r3=audio_emotions(audio)
|
96 |
+
return r1,r2
|
97 |
|
98 |
|
99 |
#audio = gr.Audio(
|
|
|
104 |
# )
|
105 |
|
106 |
|
107 |
+
app=gr.Interface(title="Sentiment Audio Analysis",fn=main,inputs=gr.Audio(source="microphone"), outputs=["text","text"]).launch(debug = True)
|