Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
# Load the Hugging Face model
|
5 |
-
emotion_classifier = pipeline("text-classification", model="SamLowe/roberta-base-go_emotions",
|
6 |
|
7 |
# Define a function to process the transcribed text with the emotion model
|
8 |
def transcribe_and_analyze(audio):
|
@@ -16,7 +16,7 @@ def transcribe_and_analyze(audio):
|
|
16 |
# Create Gradio interface
|
17 |
interface = gr.Interface(
|
18 |
fn=transcribe_and_analyze,
|
19 |
-
inputs=gr.Audio(
|
20 |
outputs=[
|
21 |
gr.Textbox(label="Transcription"), # Show the transcription
|
22 |
gr.JSON(label="Emotion Analysis") # Show the emotion analysis
|
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
# Load the Hugging Face model
|
5 |
+
emotion_classifier = pipeline("text-classification", model="SamLowe/roberta-base-go_emotions", top_k=None)
|
6 |
|
7 |
# Define a function to process the transcribed text with the emotion model
|
8 |
def transcribe_and_analyze(audio):
|
|
|
16 |
# Create Gradio interface
|
17 |
interface = gr.Interface(
|
18 |
fn=transcribe_and_analyze,
|
19 |
+
inputs=gr.Audio(type="filepath"), # Accept audio input (fixed)
|
20 |
outputs=[
|
21 |
gr.Textbox(label="Transcription"), # Show the transcription
|
22 |
gr.JSON(label="Emotion Analysis") # Show the emotion analysis
|