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

Method _choose_module_key

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

Source from the content-addressed store, hash-verified

502 strict=load_module_strict)
503
504 def _choose_module_key(self, sd):
505 assert not ('module' in sd
506 and 'model' in sd), "checkpoint has both 'model' and 'module' keys, not sure how to proceed"
507 assert 'module' in sd or 'model' in sd, "checkpoint contains neither 'model' or 'module' keys, not sure how to proceed"
508 if 'module' in sd:
509 return 'module'
510 elif 'model' in sd:
511 return 'model'
512
513 def _convert_to_dtype(self, config):
514 if not isinstance(self.module, torch.nn.Module):

Callers 1

_load_checkpointMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected