Spaces:
Runtime error
Runtime error
import pandas as pd | |
import gradio as gr | |
print(gr.__version__) | |
import torch | |
import torchaudio | |
torch._C._jit_override_can_fuse_on_cpu(False) | |
torch._C._jit_override_can_fuse_on_gpu(False) | |
torch._C._jit_set_texpr_fuser_enabled(False) | |
torch._C._jit_set_nvfuser_enabled(False) | |
loader = torch.jit.load("audio_loader.pt") | |
model = torch.jit.load('QuartzNet15x5Base_En_1.pt').eval() | |
vocab = model.text_transform.vocab.itos | |
vocab[-1] = '' | |
def predict(path): | |
audio = loader(path) | |
return model.predict(audio) | |
gr.Interface(fn=predict, inputs=[gr.inputs.Audio(source='microphone', type='filepath')], outputs= 'text').launch(debug=True) |