MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / _choose_module_key

Method _choose_module_key

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

Source from the content-addressed store, hash-verified

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

Callers 1

_load_checkpointMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected