Download load_model.py from KtiyaKK/SpTn-Model-only-1P: direct link, hf CLI and curl.
- Browser
- Download file 301 Bytes
-
https://huggingface.co/KtiyaKK/SpTn-Model-only-1P/resolve/main/load_model.py
- Command line
-
hf download hf://KtiyaKK/SpTn-Model-only-1P/load_model.py
-
curl -L -o load_model.py https://huggingface.co/KtiyaKK/SpTn-Model-only-1P/resolve/main/load_model.py
301 Bytes
| import numpy as np | |
| MODEL_FILE = "sp_tn_1p.npz" | |
| model = np.load(MODEL_FILE, allow_pickle=True) | |
| w = model["w"] | |
| vocab = model["vocab"] | |
| print("SpTn-Model-only-1P") | |
| print("Trainable parameters: 1") | |
| print("Parameter:", float(w)) | |
| print("Vocabulary size:", len(vocab)) | |
| print("Model loaded successfully.") | |