MCPcopy Index your code
hub / github.com/allenai/open-instruct / from_disk

Method from_disk

open_instruct/model_utils.py:113–115  ·  view source on GitHub ↗

Load a cache from disk.

(cls, path: str | pathlib.Path, device: torch.device)

Source from the content-addressed store, hash-verified

111
112 @classmethod
113 def from_disk(cls, path: str | pathlib.Path, device: torch.device) -> "TensorCache":
114 """Load a cache from disk."""
115 return cls(tensors=torch.load(path, weights_only=True, map_location=device))
116
117
118@dataclass

Calls 1

loadMethod · 0.80