Download usage.py from datasetsANDmodels/stt-thai: direct link, hf CLI and curl.
- Browser
- Download file 227 Bytes
-
https://huggingface.co/datasetsANDmodels/stt-thai/resolve/main/usage.py
- Command line
-
hf download hf://datasetsANDmodels/stt-thai/usage.py
-
curl -L -o usage.py https://huggingface.co/datasetsANDmodels/stt-thai/resolve/main/usage.py
227 Bytes
| from transformers import pipeline | |
| pipe = pipeline("automatic-speech-recognition", model="stt-thai",return_timestamps=True) | |
| result=pipe("thai.wav", generate_kwargs={"task": "transcribe","language":"th"})["text"] | |
| print (result) | |