Spaces:
Runtime error
Runtime error
Download app.py from HenRick69/Fast_Speech_Commands: direct link, hf CLI and curl.
- Browser
- Download file 411 Bytes
-
https://huggingface.co/spaces/HenRick69/Fast_Speech_Commands/resolve/main/app.py
- Command line
-
hf download hf://spaces/HenRick69/Fast_Speech_Commands/app.py
-
curl -L -o app.py https://huggingface.co/spaces/HenRick69/Fast_Speech_Commands/resolve/main/app.py
411 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| pipe = pipeline("audio-classification", | |
| model="0xb1/wav2vec2-base-finetuned-speech_commands-v0.02") | |
| def predict(audio_path): | |
| return pipe(audio_path)[0]["label"] | |
| demo = gr.Interface( | |
| title='Fast audio commands recognition', | |
| fn=predict, | |
| inputs=gr.Audio(source="upload", type='filepath'), | |
| outputs='text', | |
| ) | |
| demo.launch() |