extropico commited on
Commit
fc95e8f
·
verified ·
1 Parent(s): 5d6fe46

Add loader

Browse files
Files changed (3) hide show
  1. README.md +5 -0
  2. config.json +16 -0
  3. load_model.py +16 -0
README.md ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # Z1T-0
2
+
3
+ Open weight for the first Z1T-0.
4
+
5
+ [GitHub](https://github.com/extropic-ai/sparse-transformers)
config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "vocab": 50257,
3
+ "sequence": 256,
4
+ "n_layers": 4,
5
+ "n_embed": 12288,
6
+ "aft_kind": "conv",
7
+ "aft_heads": 4,
8
+ "aft_ksize": 4,
9
+ "dyt_alpha": 0.5,
10
+ "linear_fan_in": 4,
11
+ "attn_fan_in": null,
12
+ "mlp_fan_in": null,
13
+ "tanh_linear": true,
14
+ "tanh_mlp": true,
15
+ "remat": true
16
+ }
load_model.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+
3
+ import equinox as eqx
4
+ import jax
5
+ from huggingface_hub import hf_hub_download
6
+ from z1t.components import Config
7
+ from z1t.model import create_model
8
+
9
+
10
+ def load_model(repo_id="Extropic-AI/Z1T-0"):
11
+ config_path = hf_hub_download(repo_id, "config.json")
12
+ weights_path = hf_hub_download(repo_id, "model.eqx")
13
+ with open(config_path) as f:
14
+ config = Config(**json.load(f))
15
+ model = create_model(config, jax.random.PRNGKey(0))
16
+ return eqx.tree_deserialise_leaves(weights_path, model)