MCPcopy Create free account
hub / github.com/MotrixLab/ViMoGen / load_safetensors_from_path

Function load_safetensors_from_path

models/transformer/utils.py:111–116  ·  view source on GitHub ↗
(in_path: str)

Source from the content-addressed store, hash-verified

109
110
111def load_safetensors_from_path(in_path: str):
112 tensors = {}
113 with safetensors.safe_open(in_path, framework='pt', device='cpu') as f:
114 for key in f.keys():
115 tensors[key] = f.get_tensor(key)
116 return tensors
117
118
119def load_safetensors_from_dir(in_dir: str):

Callers 2

load_safetensorsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected