File size: 669 Bytes
449f254
 
c8118bc
449f254
 
c8118bc
449f254
 
 
 
 
 
 
 
 
 
 
 
 
 
c8118bc
449f254
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# import gradio as gr
# from transformers import pipeline

# # Load the model
# pipe = pipeline("audio-classification", model="superb/wav2vec2-base-superb-er")
 
# def classify_emotion(audio):
#     result = pipe(audio, top_k=5)
#     return result

# # Gradio interface for uploading an audio file
# gr.Interface(fn=classify_emotion, inputs=gr.Audio(sources=['upload', 'microphone'], type="filepath"), outputs="text").launch()


import gradio as gr

whisper = gr.load("models/superb/wav2vec2-base-superb-er")

def transcribe(audio):
    return whisper(audio)

gr.Interface(transcribe, gr.Audio(sources=['upload', 'microphone'], type="filepath"), gr.Textbox()).launch()