Download usage.py from datasetsANDmodels/zh2en: direct link, hf CLI and curl.
- Browser
- Download file 164 Bytes
-
https://huggingface.co/datasetsANDmodels/zh2en/resolve/main/usage.py
- Command line
-
hf download hf://datasetsANDmodels/zh2en/usage.py
-
curl -L -o usage.py https://huggingface.co/datasetsANDmodels/zh2en/resolve/main/usage.py
164 Bytes
| from transformers import pipeline | |
| pipe= pipeline("translation", model="zh2en") | |
| text="我从税务局打来" | |
| result =pipe(text) | |
| print( result[0]["translation_text"]) |