SageMaker PyTorchModel passing custom variables
When deploying a model with SageMaker through the PyTorchModel class, is it possible to pass a custom environmental variable or kwargs? 

I'd like to be able to switch the functionality of the serving code via a custom argument rather than needing to write multiple serve.py to handle different training model export methods. 

model = PyTorchModel(name='my_model',
                     model_data=estimator.model_data,
                     role=role,
                     framework_version='1.0.0',
                     entry_point='serve.py',
                     source_dir='src',
                     sagemaker_session=sess,
                     predictor_cls=ImagePredictor,
                     &lt;custom_argument?&gt;
                    )


Have you tried using the env parameter in your PyTorchModel ? (cf. https://sagemaker.readthedocs.io/en/stable/model.html#sagemaker.model.Model) 

model = PyTorchModel(name='my_model',
                     model_data=estimator.model_data,
                     role=role,
                     framework_version='1.0.0',
                     entry_point='serve.py',
                     source_dir='src',
                     sagemaker_session=sess,
                     predictor_cls=ImagePredictor,
                     env={'ENV_VALUE': 'val'}
                    )

