Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -40,14 +40,13 @@ def predict_emotion(audio_file):
|
|
40 |
|
41 |
|
42 |
# --- Gradio Interface ---
|
|
|
43 |
iface = gr.Interface(
|
44 |
fn=predict_emotion,
|
45 |
inputs=gr.Audio(sources=["microphone", "upload"], type="filepath", label="Upload Audio or Record with Microphone"),
|
46 |
outputs=gr.Label(num_top_classes=5, label="Emotion Probabilities"),
|
47 |
title="AI Audio Emotion Detector",
|
48 |
description="Upload an audio file or record your voice to detect emotions.",
|
49 |
-
# THIS IS THE CRITICAL CHANGE TO CREATE A NAMED ENDPOINT
|
50 |
-
api_name="predict"
|
51 |
)
|
52 |
|
53 |
# Launch the Gradio app with the API queue enabled
|
|
|
40 |
|
41 |
|
42 |
# --- Gradio Interface ---
|
43 |
+
# We have REMOVED the api_name parameter to revert to the default endpoint.
|
44 |
iface = gr.Interface(
|
45 |
fn=predict_emotion,
|
46 |
inputs=gr.Audio(sources=["microphone", "upload"], type="filepath", label="Upload Audio or Record with Microphone"),
|
47 |
outputs=gr.Label(num_top_classes=5, label="Emotion Probabilities"),
|
48 |
title="AI Audio Emotion Detector",
|
49 |
description="Upload an audio file or record your voice to detect emotions.",
|
|
|
|
|
50 |
)
|
51 |
|
52 |
# Launch the Gradio app with the API queue enabled
|