MCPcopy Create free account
hub / github.com/RightNow-AI/TIDE / save

Method save

python/TIDE/router.py:28–38  ·  view source on GitHub ↗
(self, path: str | Path)

Source from the content-addressed store, hash-verified

26 bottleneck_dim: int
27
28 def save(self, path: str | Path) -> None:
29 path = Path(path)
30 path.parent.mkdir(parents=True, exist_ok=True)
31 state = {
32 "hidden_dim": self.hidden_dim,
33 "bottleneck_dim": self.bottleneck_dim,
34 "router_layers": {},
35 }
36 for layer_idx, router in self.routers.items():
37 state["router_layers"][layer_idx] = router.state_dict()
38 torch.save(state, path)
39
40 @classmethod
41 def load(cls, path: str | Path, device: str = "cpu") -> RouterCheckpoint:

Callers 5

calibrateFunction · 0.95
tiny_runtimeFunction · 0.95

Calls

no outgoing calls

Tested by 4

tiny_runtimeFunction · 0.76