Update app.py
Browse files
app.py
CHANGED
@@ -97,14 +97,20 @@ def generate_image(api_key, text):
|
|
97 |
####
|
98 |
|
99 |
# Create the Gradio interface
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
)
|
107 |
-
|
108 |
-
|
109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
|
|
|
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()
|
113 |
+
|
114 |
+
|
115 |
+
|
116 |
|