Boltz79 commited on
Commit
9460d34
·
verified ·
1 Parent(s): 503e029

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 different 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,7 +42,7 @@ def gradio_interface(audio):
42
  # Create Gradio app
43
  interface = gr.Interface(
44
  fn=gradio_interface,
45
- inputs=gr.Audio(source="microphone", 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.",
 
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.",