Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
configs_input = dl.FunctionIO(type='Json', name='configs')
time_input = dl.FunctionIO(type='Json', name='time')
test_dataset_input = dl.FunctionIO(type='Json', name='test_dataset_id')
query_input = dl.FunctionIO(type='Json', name='query')
item_input = dl.FunctionIO(type='Item', name='item')
model_input = dl.FunctionIO(type='Json', name='model_id')
checkpoint_input = dl.FunctionIO(type='Json', name='checkpoint_id')
predict_inputs = [dataset_input, val_query_input, checkpoint_path_input, model_specs_input]
model_inputs = [dataset_input, train_query_input, val_query_input, hp_value_input, model_specs_input]
zazu_inputs = [configs_input]
predict_function = dl.PackageFunction(name='run', inputs=predict_inputs, outputs=[], description='')
model_function = dl.PackageFunction(name='run', inputs=model_inputs, outputs=[], description='')
zazu_search_function = dl.PackageFunction(name='search', inputs=zazu_inputs, outputs=[], description='')
zazu_predict_function = dl.PackageFunction(name='predict', inputs=zazu_inputs, outputs=[], description='')
timer_update_function = dl.PackageFunction(name='update_time', inputs=time_input, outputs=[], description='')
predict_item_function = dl.PackageFunction(name='predict_single_item', inputs=[item_input], outputs=[],
description='')
load_checkpoint_function = dl.PackageFunction(name='load_new_inference_checkpoint',
inputs=[model_input, checkpoint_input], outputs=[],
description='')
predict_module = dl.PackageModule(entry_point='dataloop_services/predict_module.py',
name='predict_module',
functions=[predict_function],
init_inputs=[package_name_input])
models_module = dl.PackageModule(entry_point='dataloop_services/trial_module.py',
name='models_module',
functions=[model_function],
item_input = dl.FunctionIO(type='Item', name='item')
model_input = dl.FunctionIO(type='Json', name='model_id')
checkpoint_input = dl.FunctionIO(type='Json', name='checkpoint_id')
predict_inputs = [dataset_input, val_query_input, checkpoint_path_input, model_specs_input]
model_inputs = [dataset_input, train_query_input, val_query_input, hp_value_input, model_specs_input]
zazu_inputs = [configs_input]
predict_function = dl.PackageFunction(name='run', inputs=predict_inputs, outputs=[], description='')
model_function = dl.PackageFunction(name='run', inputs=model_inputs, outputs=[], description='')
zazu_search_function = dl.PackageFunction(name='search', inputs=zazu_inputs, outputs=[], description='')
zazu_predict_function = dl.PackageFunction(name='predict', inputs=zazu_inputs, outputs=[], description='')
timer_update_function = dl.PackageFunction(name='update_time', inputs=time_input, outputs=[], description='')
predict_item_function = dl.PackageFunction(name='predict_single_item', inputs=[item_input], outputs=[],
description='')
load_checkpoint_function = dl.PackageFunction(name='load_new_inference_checkpoint',
inputs=[model_input, checkpoint_input], outputs=[],
description='')
predict_module = dl.PackageModule(entry_point='dataloop_services/predict_module.py',
name='predict_module',
functions=[predict_function],
init_inputs=[package_name_input])
models_module = dl.PackageModule(entry_point='dataloop_services/trial_module.py',
name='models_module',
functions=[model_function],
init_inputs=[package_name_input])
zazu_module = dl.PackageModule(entry_point='dataloop_services/zazu_module.py',
name='zazu_module',
functions=[zazu_search_function, zazu_predict_function],
def push_and_deploy_package(self, project, package_name):
logger.info('dtlpy version:', dl.__version__)
dataset_input = dl.FunctionIO(type='Dataset', name='dataset')
hp_value_input = dl.FunctionIO(type='Json', name='hp_values')
model_specs_input = dl.FunctionIO(type='Json', name='model_specs')
init_specs_input = dl.FunctionIO(type='Json', name='package_name')
input_to_init = {
'package_name': package_name
}
inputs = [dataset_input, hp_value_input, model_specs_input]
function = dl.PackageFunction(name='run', inputs=inputs, outputs=[], description='')
module = dl.PackageModule(entry_point='dataloop_services/service_executor.py', name='service_executor',
functions=[function],
init_inputs=init_specs_input)
package = project.packages.push(
package_name=package_name,
src_path=os.getcwd(),
modules=[module])
logger.info('deploying package . . .')
self.service = package.services.deploy(service_name=package.name,
module_name='service_executor',
agent_versions={
'dtlpy': '1.9.7',
'runner': '1.9.7.latest',
'proxy': '1.9.7.latest',
package_name_input = dl.FunctionIO(type='Json', name='package_name')
configs_input = dl.FunctionIO(type='Json', name='configs')
time_input = dl.FunctionIO(type='Json', name='time')
test_dataset_input = dl.FunctionIO(type='Json', name='test_dataset_id')
query_input = dl.FunctionIO(type='Json', name='query')
item_input = dl.FunctionIO(type='Item', name='item')
model_input = dl.FunctionIO(type='Json', name='model_id')
checkpoint_input = dl.FunctionIO(type='Json', name='checkpoint_id')
predict_inputs = [dataset_input, val_query_input, checkpoint_path_input, model_specs_input]
model_inputs = [dataset_input, train_query_input, val_query_input, hp_value_input, model_specs_input]
zazu_inputs = [configs_input]
predict_function = dl.PackageFunction(name='run', inputs=predict_inputs, outputs=[], description='')
model_function = dl.PackageFunction(name='run', inputs=model_inputs, outputs=[], description='')
zazu_search_function = dl.PackageFunction(name='search', inputs=zazu_inputs, outputs=[], description='')
zazu_predict_function = dl.PackageFunction(name='predict', inputs=zazu_inputs, outputs=[], description='')
timer_update_function = dl.PackageFunction(name='update_time', inputs=time_input, outputs=[], description='')
predict_item_function = dl.PackageFunction(name='predict_single_item', inputs=[item_input], outputs=[],
description='')
load_checkpoint_function = dl.PackageFunction(name='load_new_inference_checkpoint',
inputs=[model_input, checkpoint_input], outputs=[],
description='')
predict_module = dl.PackageModule(entry_point='dataloop_services/predict_module.py',
name='predict_module',
functions=[predict_function],
init_inputs=[package_name_input])
models_module = dl.PackageModule(entry_point='dataloop_services/trial_module.py',
time_input = dl.FunctionIO(type='Json', name='time')
test_dataset_input = dl.FunctionIO(type='Json', name='test_dataset_id')
query_input = dl.FunctionIO(type='Json', name='query')
item_input = dl.FunctionIO(type='Item', name='item')
model_input = dl.FunctionIO(type='Json', name='model_id')
checkpoint_input = dl.FunctionIO(type='Json', name='checkpoint_id')
predict_inputs = [dataset_input, val_query_input, checkpoint_path_input, model_specs_input]
model_inputs = [dataset_input, train_query_input, val_query_input, hp_value_input, model_specs_input]
zazu_inputs = [configs_input]
predict_function = dl.PackageFunction(name='run', inputs=predict_inputs, outputs=[], description='')
model_function = dl.PackageFunction(name='run', inputs=model_inputs, outputs=[], description='')
zazu_search_function = dl.PackageFunction(name='search', inputs=zazu_inputs, outputs=[], description='')
zazu_predict_function = dl.PackageFunction(name='predict', inputs=zazu_inputs, outputs=[], description='')
timer_update_function = dl.PackageFunction(name='update_time', inputs=time_input, outputs=[], description='')
predict_item_function = dl.PackageFunction(name='predict_single_item', inputs=[item_input], outputs=[],
description='')
load_checkpoint_function = dl.PackageFunction(name='load_new_inference_checkpoint',
inputs=[model_input, checkpoint_input], outputs=[],
description='')
predict_module = dl.PackageModule(entry_point='dataloop_services/predict_module.py',
name='predict_module',
functions=[predict_function],
init_inputs=[package_name_input])
models_module = dl.PackageModule(entry_point='dataloop_services/trial_module.py',
name='models_module',
functions=[model_function],
init_inputs=[package_name_input])
query_input = dl.FunctionIO(type='Json', name='query')
item_input = dl.FunctionIO(type='Item', name='item')
model_input = dl.FunctionIO(type='Json', name='model_id')
checkpoint_input = dl.FunctionIO(type='Json', name='checkpoint_id')
predict_inputs = [dataset_input, val_query_input, checkpoint_path_input, model_specs_input]
model_inputs = [dataset_input, train_query_input, val_query_input, hp_value_input, model_specs_input]
zazu_inputs = [configs_input]
predict_function = dl.PackageFunction(name='run', inputs=predict_inputs, outputs=[], description='')
model_function = dl.PackageFunction(name='run', inputs=model_inputs, outputs=[], description='')
zazu_search_function = dl.PackageFunction(name='search', inputs=zazu_inputs, outputs=[], description='')
zazu_predict_function = dl.PackageFunction(name='predict', inputs=zazu_inputs, outputs=[], description='')
timer_update_function = dl.PackageFunction(name='update_time', inputs=time_input, outputs=[], description='')
predict_item_function = dl.PackageFunction(name='predict_single_item', inputs=[item_input], outputs=[],
description='')
load_checkpoint_function = dl.PackageFunction(name='load_new_inference_checkpoint',
inputs=[model_input, checkpoint_input], outputs=[],
description='')
predict_module = dl.PackageModule(entry_point='dataloop_services/predict_module.py',
name='predict_module',
functions=[predict_function],
init_inputs=[package_name_input])
models_module = dl.PackageModule(entry_point='dataloop_services/trial_module.py',
name='models_module',
functions=[model_function],
init_inputs=[package_name_input])
zazu_module = dl.PackageModule(entry_point='dataloop_services/zazu_module.py',
configs_input = dl.FunctionIO(type='Json', name='configs')
time_input = dl.FunctionIO(type='Json', name='time')
test_dataset_input = dl.FunctionIO(type='Json', name='test_dataset_id')
query_input = dl.FunctionIO(type='Json', name='query')
item_input = dl.FunctionIO(type='Item', name='item')
model_input = dl.FunctionIO(type='Json', name='model_id')
checkpoint_input = dl.FunctionIO(type='Json', name='checkpoint_id')
predict_inputs = [dataset_input, val_query_input, checkpoint_path_input, model_specs_input]
model_inputs = [dataset_input, train_query_input, val_query_input, hp_value_input, model_specs_input]
zazu_inputs = [configs_input]
predict_function = dl.PackageFunction(name='run', inputs=predict_inputs, outputs=[], description='')
model_function = dl.PackageFunction(name='run', inputs=model_inputs, outputs=[], description='')
zazu_search_function = dl.PackageFunction(name='search', inputs=zazu_inputs, outputs=[], description='')
zazu_predict_function = dl.PackageFunction(name='predict', inputs=zazu_inputs, outputs=[], description='')
timer_update_function = dl.PackageFunction(name='update_time', inputs=time_input, outputs=[], description='')
predict_item_function = dl.PackageFunction(name='predict_single_item', inputs=[item_input], outputs=[],
description='')
load_checkpoint_function = dl.PackageFunction(name='load_new_inference_checkpoint',
inputs=[model_input, checkpoint_input], outputs=[],
description='')
predict_module = dl.PackageModule(entry_point='dataloop_services/predict_module.py',
name='predict_module',
functions=[predict_function],
init_inputs=[package_name_input])
models_module = dl.PackageModule(entry_point='dataloop_services/trial_module.py',
name='models_module',
test_dataset_input = dl.FunctionIO(type='Json', name='test_dataset_id')
query_input = dl.FunctionIO(type='Json', name='query')
item_input = dl.FunctionIO(type='Item', name='item')
model_input = dl.FunctionIO(type='Json', name='model_id')
checkpoint_input = dl.FunctionIO(type='Json', name='checkpoint_id')
predict_inputs = [dataset_input, val_query_input, checkpoint_path_input, model_specs_input]
model_inputs = [dataset_input, train_query_input, val_query_input, hp_value_input, model_specs_input]
zazu_inputs = [configs_input]
predict_function = dl.PackageFunction(name='run', inputs=predict_inputs, outputs=[], description='')
model_function = dl.PackageFunction(name='run', inputs=model_inputs, outputs=[], description='')
zazu_search_function = dl.PackageFunction(name='search', inputs=zazu_inputs, outputs=[], description='')
zazu_predict_function = dl.PackageFunction(name='predict', inputs=zazu_inputs, outputs=[], description='')
timer_update_function = dl.PackageFunction(name='update_time', inputs=time_input, outputs=[], description='')
predict_item_function = dl.PackageFunction(name='predict_single_item', inputs=[item_input], outputs=[],
description='')
load_checkpoint_function = dl.PackageFunction(name='load_new_inference_checkpoint',
inputs=[model_input, checkpoint_input], outputs=[],
description='')
predict_module = dl.PackageModule(entry_point='dataloop_services/predict_module.py',
name='predict_module',
functions=[predict_function],
init_inputs=[package_name_input])
models_module = dl.PackageModule(entry_point='dataloop_services/trial_module.py',
name='models_module',
functions=[model_function],
init_inputs=[package_name_input])