Spaces:
Runtime error
Runtime error
import gradio as gr | |
#gr.Interface.load("models/nvidia/stt_en_citrinet_1024_gamma_0_25").launch() | |
from nemo.collections.asr.models import ASRModel | |
import torch | |
if torch.cuda.is_available(): | |
device = torch.device(f'cuda:0') | |
asr_model = ASRModel.from_pretrained(model_name='stt_en_citrinet_1024') | |
def transcribe(audio): | |
"""Speech to text using Nvidia Nemo""" | |
text = asr_model.transcribe(paths2audio_files=[audio])[0] | |
correct = list(gf.correct(text, max_candidates = 1))[0] | |
return text, correct | |
gr.Interface(fn=transcribe).launch() |