Download usage.py from datasetsANDmodels/th2en: direct link, hf CLI and curl.
- Browser
- Download file 240 Bytes
-
https://huggingface.co/datasetsANDmodels/th2en/resolve/main/usage.py
- Command line
-
hf download hf://datasetsANDmodels/th2en/usage.py
-
curl -L -o usage.py https://huggingface.co/datasetsANDmodels/th2en/resolve/main/usage.py
240 Bytes
| from transformers import pipeline | |
| pipe= pipeline("translation", model="th2en") | |
| text ="ผมโทรมาจากสำนักงานสรรพากรครับ" #Thai | |
| result =pipe(text) | |
| print( result[0]["translation_text"]) | |