def get_hyper_params(call: APICall, company_id, request: GetHyperParamsRequest): with translate_errors_context(): tasks_params = HyperParams.get_params(company_id, task_ids=request.tasks) call.result.data = { "params": [{"task": task, **data} for task, data in tasks_params.items()] }
def delete_hyper_params(call: APICall, company_id, request: DeleteHyperParamsRequest): with translate_errors_context(): call.result.data = { "deleted": HyperParams.delete_params( company_id, task_id=request.task, hyperparams=request.hyperparams, force=request.force, ) }
def edit_configuration(call: APICall, company_id, request: EditConfigurationRequest): with translate_errors_context(): call.result.data = { "updated": HyperParams.edit_configuration( company_id, task_id=request.task, configuration=request.configuration, replace_configuration=request.replace_configuration, force=request.force, ) }
def get_configurations(call: APICall, company_id, request: GetConfigurationsRequest): with translate_errors_context(): tasks_params = HyperParams.get_configurations( company_id, task_ids=request.tasks, names=request.names ) call.result.data = { "configurations": [ {"task": task, **data} for task, data in tasks_params.items() ] }
def edit_hyper_params(call: APICall, company_id, request: EditHyperParamsRequest): with translate_errors_context(): call.result.data = { "updated": HyperParams.edit_params( company_id, task_id=request.task, hyperparams=request.hyperparams, replace_hyperparams=request.replace_hyperparams, force=request.force, ) }
def delete_configuration(call: APICall, company_id, request: DeleteConfigurationRequest): call.result.data = { "deleted": HyperParams.delete_configuration( company_id, task_id=request.task, configuration=request.configuration, force=request.force, ) }
def get_configuration_names(call: APICall, company_id, request: GetConfigurationNamesRequest): tasks_params = HyperParams.get_configuration_names( company_id, task_ids=request.tasks, skip_empty=request.skip_empty) call.result.data = { "configurations": [{ "task": task, **data } for task, data in tasks_params.items()] }