How to use the dtlpy.packages.get function in dtlpy

To help you get started, we’ve selected a few dtlpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dataloop-ai / ZazuML / dataloop_services / zazu_timer_module.py View on Github external
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')