Spaces:
Sleeping
Sleeping
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() |