Skip to content

Commit a9c7d74

Browse files
committed
Set output type to SAVED_MODEL when running training recipe
1 parent d66f54d commit a9c7d74

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

dataikuapi/dss/recipe.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ def run(self, job_type="NON_RECURSIVE_FORCED_BUILD", partitions=None, wait=True,
8484
raise Exception("recipe has no outputs, can't run it")
8585

8686
jd = self.client.get_project(self.project_key).new_job(job_type)
87-
jd.with_output(output_refs[0], partition=partitions)
87+
if isinstance(settings, TrainingRecipeSettings):
88+
jd.with_output(output_refs[0], object_type="SAVED_MODEL", partition=partitions)
89+
else:
90+
jd.with_output(output_refs[0], partition=partitions)
8891

8992
if wait:
9093
return jd.start_and_wait()
@@ -133,6 +136,10 @@ def get_settings(self):
133136
return SplitRecipeSettings(self, data)
134137
elif type == "prepare" or type == "shaker":
135138
return PrepareRecipeSettings(self, data)
139+
elif type == "prediction_training":
140+
return TrainingRecipeSettings(self, data)
141+
elif type == "clustering_training":
142+
return TrainingRecipeSettings(self, data)
136143
#elif type == "prediction_scoring":
137144
#elif type == "clustering_scoring":
138145
elif type == "download":
@@ -1073,6 +1080,13 @@ def __init__(self, name, project):
10731080
SingleOutputRecipeCreator.__init__(self, 'download', name, project)
10741081

10751082

1083+
class TrainingRecipeSettings(DSSRecipeSettings):
1084+
"""
1085+
Settings of a prediction or clustering training recipe. Do not create this directly, use :meth:`DSSRecipe.get_settings`
1086+
"""
1087+
pass # TODO: Write helpers for training
1088+
1089+
10761090
#####################################################
10771091
# Per-recipe-type classes: Code recipes
10781092
#####################################################

0 commit comments

Comments
 (0)