Skip to content

Commit a8d3ab3

Browse files
authored
Merge pull request #215 from sassoftware/tasks_updates
allow for user to access timeout variable in score_model_with_cas
2 parents 57e3214 + e8129e2 commit a8d3ab3

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/sasctl/_services/score_definitions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ def create_score_definition(
8383
else:
8484
object_descriptor_type = "sas.models.model.ds2"
8585

86-
if cls._model_repository.is_uuid(model):
87-
model_id = model
88-
elif isinstance(model, dict) and "id" in model:
86+
if isinstance(model, dict) and "id" in model:
8987
model_id = model["id"]
9088
else:
9189
model = cls._model_repository.get_model(model)

src/sasctl/tasks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,7 @@ def score_model_with_cas(
981981
library_name: str = "Public",
982982
model_version: str = "latest",
983983
use_cas_gateway: bool = False,
984+
timeout: int = 300,
984985
):
985986
score_definition = sd.create_score_definition(
986987
score_def_name,
@@ -994,7 +995,7 @@ def score_model_with_cas(
994995
use_cas_gateway=use_cas_gateway,
995996
)
996997
score_execution = se.create_score_execution(score_definition.id)
997-
score_execution_poll = se.poll_score_execution_state(score_execution)
998+
score_execution_poll = se.poll_score_execution_state(score_execution, timeout)
998999
print(score_execution_poll)
9991000
score_results = se.get_score_execution_results(score_execution, use_cas_gateway)
10001001
return score_results

0 commit comments

Comments
 (0)