Skip to content

Commit

Permalink
FIX: Distributed Dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
User3574 committed Aug 9, 2023
1 parent 332b58d commit a9a22dd
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions ai/src/itwinai/backend/executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a9a22dd

Please sign in to comment.