Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _maybe_launch_predict(self, new_checkpoint_obj):
if 'predict' not in [s.name for s in dl.services.list()]:
logger.info('predict service doesnt exist, about to deploy prediction service')
package_obj = dl.packages.get('zazuml')
deploy_predict_item(package=package_obj,
model_id=self.model_obj.id,
checkpoint_id=new_checkpoint_obj.id)
logger.info('service deployed')
logger.info('deployed prediction service')
create_trigger()
logger.info('created prediction trigger')
else:
logger.info('predict service exists, no reason to relaunch')