Esempio n. 1
0
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)
        }
Esempio n. 2
0
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)
        }
Esempio n. 3
0
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,
            )
        }
Esempio n. 4
0
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()]
    }
Esempio n. 5
0
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,
            )
        }
Esempio n. 6
0
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()]
    }