Skip to content

Commit 78a998e

Browse files
committed
Updated the function name
1 parent 810a13f commit 78a998e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

workflows/train_and_deploy_workflow/train-deploy-workflow.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def train_model(
124124

125125

126126
@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]:
128128
from truefoundry.ml import get_client
129129

130130
client = get_client()
@@ -161,7 +161,7 @@ def deploy_model(run_fqn: str, workspace_fqn: str) -> str:
161161

162162

163163
@task(task_config=task_config)
164-
def model_not_found(threshold: float) -> str:
164+
def do_not_deploy_model(threshold: float) -> str:
165165
return f"Model with threshold greater than {threshold} not found"
166166

167167

@@ -178,15 +178,15 @@ def model_training_workflow(
178178
fqns = map_task(train_model_function, concurrency=2)(
179179
epochs=epochs, learning_rate=learning_rate
180180
)
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(
182182
fqns=fqns, threshold=accuracy_threshold
183183
)
184184
message = (
185185
conditional("Deploy model")
186186
.if_(does_model_pass_threshold_accuracy == True)
187187
.then(deploy_model(run_fqn=model_version_fqn, workspace_fqn=workspace_fqn))
188188
.else_()
189-
.then(model_not_found(threshold=accuracy_threshold))
189+
.then(do_not_deploy_model(threshold=accuracy_threshold))
190190
)
191191

192192
return message

0 commit comments

Comments
 (0)