File size: 506 Bytes
fc95e8f 653557b fc95e8f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 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)
|