jmparejaz commited on
Commit
71216c6
1 Parent(s): 0ee4cc5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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,r3
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","text"]).launch(debug = True)
 
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)