def exec(self, task_input, task_output):
        self._prep_dir(task_input["model_loc"])

        model_path = os.path_join(task_input["model_loc"],
                                  f'model-{task_input["inputs"]}')

        if not task_input["model_override"] and os.is_dir(model_path):
            #TODO implement a dynamic "path increment" model-name save functionality
            pass

        task_output["model"].save(model_path)
Exemple #2
0
    def exec(self, task_input, task_output):
        ressources, training_data, backup = self._setup(task_output)

        with open(training_data, 'w') as training:
            if backup is not None and os.is_path_file(backup):
                self._merge_training(training, backup)
            else:
                headders = self._get_headders(task_output["readings"])
                training.write(headders)

            for split_folder in ressources:
                split_dir = os.path_join(task_output["res_loc"], split_folder)

                if os.is_path_file(split_dir) and not os.is_dir(split_dir):
                    continue

                self.append_training_set(training, split_dir,
                                         os.dir_res_list(split_dir))

                os.remove_dir(split_dir)