Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ from transformers import pipeline
|
|
4 |
# Load Whisper for speech-to-text
|
5 |
whisper = pipeline("automatic-speech-recognition", model="openai/whisper-medium")
|
6 |
|
7 |
-
# Load a
|
8 |
sentiment_analyzer = pipeline("sentiment-analysis", model="cardiffnlp/twitter-roberta-base-sentiment")
|
9 |
|
10 |
# Function to process audio and analyze tone
|
@@ -42,7 +42,7 @@ def gradio_interface(audio):
|
|
42 |
# Create Gradio app
|
43 |
interface = gr.Interface(
|
44 |
fn=gradio_interface,
|
45 |
-
inputs=gr.Audio(
|
46 |
outputs=gr.Textbox(label="Analysis Result", lines=5),
|
47 |
title="Real-Time Call Analysis",
|
48 |
description="Record or upload audio to analyze tone and sentiment in real time.",
|
|
|
4 |
# Load Whisper for speech-to-text
|
5 |
whisper = pipeline("automatic-speech-recognition", model="openai/whisper-medium")
|
6 |
|
7 |
+
# Load a sentiment analysis model
|
8 |
sentiment_analyzer = pipeline("sentiment-analysis", model="cardiffnlp/twitter-roberta-base-sentiment")
|
9 |
|
10 |
# Function to process audio and analyze tone
|
|
|
42 |
# Create Gradio app
|
43 |
interface = gr.Interface(
|
44 |
fn=gradio_interface,
|
45 |
+
inputs=gr.Audio(type="filepath", label="Record or Upload Audio"),
|
46 |
outputs=gr.Textbox(label="Analysis Result", lines=5),
|
47 |
title="Real-Time Call Analysis",
|
48 |
description="Record or upload audio to analyze tone and sentiment in real time.",
|