rohitp1's picture
Update app.py
2b0ad9d
raw
history blame
744 Bytes
# import gradio as gr
# gr.Interface.load("models/rohitp1/kkkh_whisper_small_distillation_att_loss_libri360_epochs_100_batch_4_concat_dataset").launch()
import gradio as gr
import os
import transformers
from transformers import pipeline
import time
p = pipeline('automatic-speech-recognition', model='rohitp1/kkkh_whisper_small_distillation_att_loss_libri360_epochs_100_batch_4_concat_dataset')
def transcribe(audio, state=""):
time.sleep(3)
text = p(audio)["text"]
state += text + " "
return state, state
gr.Interface(
fn=transcribe,
inputs=[
gr.inputs.Audio(source="microphone", type="filepath"),
'state'
],
outputs=[
"textbox",
"state"
],
live=False).launch()