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) }
def delete_configuration(call: APICall, company_id, request: DeleteConfigurationRequest): with translate_errors_context(): call.result.data = { "deleted": HyperParams.delete_configuration( company_id, task_id=request.task, configuration=request.configuration) }
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, ) }
def get_configuration_names(call: APICall, company_id, request: GetConfigurationNamesRequest): with translate_errors_context(): tasks_params = HyperParams.get_configuration_names( company_id, task_ids=request.tasks) 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, ) }
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()] }