MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / BaseModel

Class BaseModel

ldm/modules/midas/midas/base_model.py:4–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2
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

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected