failed09's picture
Release update
818b1b2 verified
Raw History Blame Contribute Delete
718 Bytes
"""Download the minimal CPU release and run word-level LID."""
import importlib.util
from pathlib import Path
from huggingface_hub import snapshot_download
directory=Path(snapshot_download("failed09/bashkir-roberta-token-lid", allow_patterns=[
"onnx/model_int8.onnx", "spm_bashkir_bert_16k.model", "config.json", "META.json", "runtime.py"]))
spec=importlib.util.spec_from_file_location("bashkir_token_lid_runtime",directory/"runtime.py")
runtime=importlib.util.module_from_spec(spec)
spec.loader.exec_module(runtime)
lid=runtime.BashkirTokenLID(directory)
for token in lid.predict("Ул миңә see you tomorrow тип әйтте, значит завтра встретимся."):
print(token)