Spaces:
No application file
No application file
Download demos/example.py from mintyeatech/lingobot: direct link, hf CLI and curl.
- Browser
- Download file 492 Bytes
-
https://huggingface.co/spaces/mintyeatech/lingobot/resolve/main/demos/example.py
- Command line
-
hf download hf://spaces/mintyeatech/lingobot/demos/example.py
-
curl -L -o example.py https://huggingface.co/spaces/mintyeatech/lingobot/resolve/main/demos/example.py
492 Bytes
| from transformers import pipeline | |
| import gradio as gr | |
| import time | |
| p = pipeline("automatic-speech-recognition") | |
| def transcribe(audio, state=""): | |
| print(time.time(),audio) | |
| time.sleep(2) | |
| text = p(audio)["text"] | |
| state += text + " " | |
| return state, state | |
| gr.Interface( | |
| fn=transcribe, | |
| inputs=[ | |
| gr.Audio(source="microphone", type="filepath", streaming=True), | |
| "state" | |
| ], | |
| outputs=[ | |
| "textbox", | |
| "state" | |
| ], | |
| live=True).launch() |