MCPcopy
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / load

Method load

dmidas/base_model.py:5–16  ·  view source on GitHub ↗

Load model from file. Args: path (str): file path

(self, path)

Source from the content-addressed store, hash-verified

3
4class BaseModel(torch.nn.Module):
5 def load(self, path):
6 """Load model from file.
7
8 Args:
9 path (str): file path
10 """
11 parameters = torch.load(path, map_location=torch.device('cpu'))
12
13 if "optimizer" in parameters:
14 parameters = parameters["model"]
15
16 self.load_state_dict(parameters)

Callers 15

get_model_configFunction · 0.80
__getitem__Method · 0.80
__getitem__Method · 0.80
load_wtsFunction · 0.80
buildMethod · 0.80
load_ckptFunction · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
run_3dphotoFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected