Download load_model.py from Extropic-AI/Z1T-0: direct link, hf CLI and curl.
- Browser
- Download file 506 Bytes
-
https://huggingface.co/Extropic-AI/Z1T-0/resolve/refs%2Fpr%2F1/load_model.py
- Command line
-
hf download hf://Extropic-AI/Z1T-0@refs/pr/1/load_model.py
-
curl -L -o load_model.py https://huggingface.co/Extropic-AI/Z1T-0/resolve/refs%2Fpr%2F1/load_model.py
506 Bytes
| import json | |
| import equinox as eqx | |
| import jax | |
| from huggingface_hub import hf_hub_download | |
| from z1t.components import Config | |
| from z1t.model import create_model | |
| def load_model(repo_id="Extropic-AI/Z1T-0"): | |
| config_path = hf_hub_download(repo_id, "config.json") | |
| weights_path = hf_hub_download(repo_id, "model.eqx") | |
| with open(config_path) as f: | |
| config = Config(**json.load(f)) | |
| model = create_model(config, jax.random.key(0)) | |
| return eqx.tree_deserialise_leaves(weights_path, model) | |