Kleber's picture
Create app.y
580817b verified
raw
history blame
728 Bytes
import nemo.collections.asr as nemo_asr
import gradio as gr
def transcribe(state, file):
if not audio:
return {state_var: state, transcription_var: state}
asr_model = nemo_asr.models.EncDecCTCModelBPE.from_pretrained(
model_name="stt_rw_conformer_ctc_large")
transcription= asr_model.transcribe([audio])
return transcription[0]
with gr.Blocks() as demo:
state_var = gr.State("")
with gr.Row():
with gr.Column():
uploaded_audio = gr.Audio(label="Upload Audio File", type="filepath", source="upload")
with gr.Row():
transcribe_button = gr.Button("Transcribe")
transcribe_button.click(
transcribe,
[uploaded_audio],
)
demo.launch()