MCPcopy Create free account
hub / github.com/clinicalml/TabLLM / load_model

Method load_model

t-few/src/models/EncoderDecoder.py:332–338  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

330 self.load_model()
331
332 def load_model(self):
333 if self.config.load_weight != "":
334 trainable_states = torch.load(self.config.load_weight, map_location=torch.device("cpu"))
335 load_result = self.model.load_state_dict(trainable_states, strict=False)
336 assert (
337 len(load_result.unexpected_keys) == 0
338 ), f"Load model failed, unexpected keys {load_result.unexpected_keys.__str__()}"
339
340 def save_model(self, finish=False):
341 if self.config.save_model and (finish or self._last_global_step_saved != self.global_step):

Callers 2

__init__Method · 0.95
on_test_startMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected