Spaces:
Runtime error
Runtime error
| from huggingface_hub import from_pretrained_fastai | |
| import gradio as gr | |
| from fastai.text.all import * | |
| learner = torch.jit.load("soundWave.pth") | |
| # Definimos una función que se encarga de llevar a cabo las predicciones | |
| def predict(waveform): | |
| pred = learner.predict(waveform) | |
| return {labels[i]} | |
| # Creamos la interfaz y la lanzamos. | |
| gr.Interface(fn=predict, inputs=gr.inputs.Audio(), outputs=gr.outputs.Label(num_top_classes=35)).launch(share=False) | |