Spaces:
Build error
Build error
| import gradio as gr | |
| import time | |
| def transcribe (audio, state=" "): | |
| time.sleep(3) | |
| """ speech to text function using the pipeline that we defined""" | |
| 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=True).launch() |