MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / _choose_module_key

Method _choose_module_key

deepspeed/inference/engine.py:473–480  ·  view source on GitHub ↗
(self, sd)

Source from the content-addressed store, hash-verified

471 strict=load_module_strict)
472
473 def _choose_module_key(self, sd):
474 assert not ('module' in sd
475 and 'model' in sd), "checkpoint has both 'model' and 'module' keys, not sure how to proceed"
476 assert 'module' in sd or 'model' in sd, "checkpoint contains neither 'model' or 'module' keys, not sure how to proceed"
477 if 'module' in sd:
478 return 'module'
479 elif 'model' in sd:
480 return 'model'
481
482 def _convert_to_dtype(self, config):
483 if not isinstance(self.module, torch.nn.Module):

Callers 1

_load_checkpointMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected