Download example.py from failed09/bashkir-roberta-ner: direct link, hf CLI and curl.
- Browser
- Download file 633 Bytes
-
https://huggingface.co/failed09/bashkir-roberta-ner/resolve/main/example.py
- Command line
-
hf download hf://failed09/bashkir-roberta-ner/example.py
-
curl -L -o example.py https://huggingface.co/failed09/bashkir-roberta-ner/resolve/main/example.py
633 Bytes
| """Download and run the default CPU model from Hugging Face.""" | |
| import sys | |
| from huggingface_hub import snapshot_download | |
| if hasattr(sys.stdout, "reconfigure"): | |
| sys.stdout.reconfigure(encoding="utf-8") | |
| model_dir = snapshot_download( | |
| "failed09/bashkir-roberta-ner", | |
| allow_patterns=["onnx/model_int8.onnx", "spm_bashkir_bert_16k.model", | |
| "config.json", "runtime.py"], | |
| ) | |
| sys.path.insert(0, model_dir) | |
| from runtime import BashkirPersonNER # noqa: E402 | |
| ner = BashkirPersonNER(model_dir) | |
| print(ner.predict("Рәми Ғарипов һәм Мостай Кәрим тураһында һөйләштек.")) | |