@@ -124,7 +124,7 @@ def train_model(
124
124
125
125
126
126
@task (task_config = task_config )
127
- def get_run_fqn_of_best_model (fqns : List [str ], threshold : float ) -> Tuple [str , bool ]:
127
+ def get_best_model (fqns : List [str ], threshold : float ) -> Tuple [str , bool ]:
128
128
from truefoundry .ml import get_client
129
129
130
130
client = get_client ()
@@ -161,7 +161,7 @@ def deploy_model(run_fqn: str, workspace_fqn: str) -> str:
161
161
162
162
163
163
@task (task_config = task_config )
164
- def model_not_found (threshold : float ) -> str :
164
+ def do_not_deploy_model (threshold : float ) -> str :
165
165
return f"Model with threshold greater than { threshold } not found"
166
166
167
167
@@ -178,15 +178,15 @@ def model_training_workflow(
178
178
fqns = map_task (train_model_function , concurrency = 2 )(
179
179
epochs = epochs , learning_rate = learning_rate
180
180
)
181
- model_version_fqn , does_model_pass_threshold_accuracy = get_run_fqn_of_best_model (
181
+ model_version_fqn , does_model_pass_threshold_accuracy = get_best_model (
182
182
fqns = fqns , threshold = accuracy_threshold
183
183
)
184
184
message = (
185
185
conditional ("Deploy model" )
186
186
.if_ (does_model_pass_threshold_accuracy == True )
187
187
.then (deploy_model (run_fqn = model_version_fqn , workspace_fqn = workspace_fqn ))
188
188
.else_ ()
189
- .then (model_not_found (threshold = accuracy_threshold ))
189
+ .then (do_not_deploy_model (threshold = accuracy_threshold ))
190
190
)
191
191
192
192
return message
0 commit comments