Spaces:
jfforero
/
Runtime error

jfforero commited on
Commit
8f0b9db
·
verified ·
1 Parent(s): f2b7d46

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -14
app.py CHANGED
@@ -95,18 +95,24 @@ def generate_image(api_key, text):
95
  else:
96
  return None
97
  ####
98
-
99
  # Create the Gradio interface
100
- with gr.Blocks() as interface:
101
- gr.Markdown("Emotional Machines test: Load or Record an audio file to speech emotion analysis")
102
- with gr.Tabs():
103
- with gr.Tab("Acoustic and Semantic Predictions"):
104
- with gr.Row():
105
- input_audio = gr.Audio(label="Input Audio", type="filepath")
106
- submit_button = gr.Button("Submit")
107
- output_label = [gr.Label("Prediction"), gr.Image(type='pil')] # Use a single Label instead of a list
108
-
109
- # Set the function to be called when the button is clicked
110
- submit_button.click(get_predictions, inputs=input_audio, outputs=output_label)
111
-
112
- interface.launch()
 
 
 
 
 
 
 
95
  else:
96
  return None
97
  ####
98
+
99
  # Create the Gradio interface
100
+ iface = gr.Interface(
101
+ title = 'Emotional Machines Test',
102
+ fn=get_predictions,
103
+ inputs=[
104
+ gr.inputs.Audio(source="file", label="Input Audio for Emotion Analysis", type="file"),
105
+ gr.inputs.Audio(source="microphone", label="Speak for Speech Recognition", type="file")
106
+ ],
107
+ outputs=[
108
+ gr.outputs.Textbox(label="Emotion Prediction"),
109
+ gr.outputs.Image(label="Generated Image"),
110
+ gr.outputs.Textbox(label="Speech Recognition")
111
+ ],
112
+ description="Load or Record an audio file to perform emotion analysis and speech recognition"
113
+ )
114
+
115
+ # Launch the interface
116
+ iface.launch()
117
+
118
+