in src/sagemaker_inference/transformer.py [0:0]
def validate_and_initialize(self, model_dir=environment.model_dir): # type: () -> None
"""Validates the user module against the SageMaker inference contract.
Load the model as defined by the ``model_fn`` to prepare handling predictions.
"""
if not self._initialized:
self._environment = environment.Environment()
self._validate_user_module_and_set_functions()
self._model = self._model_fn(model_dir)
self._initialized = True