From a9a22ddeb357450c363418243ea37ea8725a7211 Mon Sep 17 00:00:00 2001 From: User3574 Date: Wed, 9 Aug 2023 15:21:04 -0400 Subject: [PATCH] FIX: Distributed Dataset --- ai/src/itwinai/backend/executors.py | 35 ++++++++++++++++------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/ai/src/itwinai/backend/executors.py b/ai/src/itwinai/backend/executors.py index 4a18e9a0..1a067306 100644 --- a/ai/src/itwinai/backend/executors.py +++ b/ai/src/itwinai/backend/executors.py @@ -45,25 +45,28 @@ def __init__(self, pipeline, class_dict, param_space): ray.init() def worker_fn(self, config, pipeline, class_dict): + print('Worker fn') # Should have same structure pipe and params - def replace(pipe, params): - for param in params: - if type(pipe[param]) != dict: - pipe[param] = params[param] - else: - replace(pipe[param], params[param]) - return pipe - - template = pipeline - with open(template, 'r') as f: - doc = yaml.safe_load(f) - doc = replace(doc, config) - - executor = LocalExecutor(doc, class_dict) - executor.setup(None) - executor.execute(None) + # def replace(pipe, params): + # for param in params: + # if type(pipe[param]) != dict: + # pipe[param] = params[param] + # else: + # replace(pipe[param], params[param]) + # return pipe + # + # template = pipeline + # with open(template, 'r') as f: + # doc = yaml.safe_load(f) + # doc = replace(doc, config) + # + # executor = LocalExecutor(doc, class_dict) + # executor.setup(None) + # executor.execute(None) + return {"test": 1} def execute(self, args): + print('Execute') tuner = tune.Tuner( trainable=tune.with_parameters(self.worker_fn, pipeline=self.pipeline, class_dict=self.class_dict), param_space=self.param_space,