Skip to content

Commit 685c8df

Browse files
committed
chore: address PR comments
1 parent 8802bff commit 685c8df

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

src/sagemaker/jumpstart/exceptions.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ def __init__(
8181
self.message = (
8282
f"Version '{version}' of JumpStart model '{model_id}' " # type: ignore
8383
"has at least 1 vulnerable dependency in the inference script. "
84-
"Please try targetting a higher version of the model or using a "
84+
"Please try targeting a higher version of the model or using a "
8585
"different model. List of vulnerabilities: "
8686
f"{', '.join(vulnerabilities)}" # type: ignore
8787
)
8888
elif scope == JumpStartScriptScope.TRAINING:
8989
self.message = (
9090
f"Version '{version}' of JumpStart model '{model_id}' " # type: ignore
9191
"has at least 1 vulnerable dependency in the training script. "
92-
"Please try targetting a higher version of the model or using a "
92+
"Please try targeting a higher version of the model or using a "
9393
"different model. List of vulnerabilities: "
9494
f"{', '.join(vulnerabilities)}" # type: ignore
9595
)
@@ -125,7 +125,7 @@ def __init__(
125125
raise RuntimeError("Must specify `model_id` and `version` arguments.")
126126
self.message = (
127127
f"Version '{version}' of JumpStart model '{model_id}' is deprecated. "
128-
"Please try targetting a higher version of the model or using a "
128+
"Please try targeting a higher version of the model or using a "
129129
"different model."
130130
)
131131

src/sagemaker/jumpstart/utils.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,11 @@ def is_valid_model_id(
542542
model_version: Optional[str] = None,
543543
script: enums.JumpStartScriptScope = enums.JumpStartScriptScope.INFERENCE,
544544
) -> bool:
545-
"""Returns True if the model ID is supported for the given script."""
545+
"""Returns True if the model ID is supported for the given script.
546+
547+
Raises:
548+
ValueError: If the script is not supported by JumpStart.
549+
"""
546550
if model_id in {None, ""}:
547551
return False
548552
if not isinstance(model_id, str):

tests/unit/sagemaker/jumpstart/estimator/test_estimator.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ def test_estimator_use_kwargs(self):
354354
"inputs": {"hello": "world"},
355355
"wait": True,
356356
"logs": "All",
357-
"job_name": "none of your business",
357+
"job_name": "none_of_your_business",
358358
"experiment_config": {"1": "2"},
359359
}
360360
all_deploy_kwargs_used = {
@@ -476,7 +476,7 @@ def evaluate_estimator_workflow_with_kwargs(
476476
}
477477

478478
expected_fit_kwargs = overwrite_dictionary(
479-
{"inputs": channels, "wait": True, "job_name": "none of your business"}, fit_kwargs
479+
{"inputs": channels, "wait": True, "job_name": "none_of_your_business"}, fit_kwargs
480480
)
481481

482482
estimator.fit(**expected_fit_kwargs)

tests/unit/sagemaker/jumpstart/test_utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ def make_vulnerable_inference_spec(*largs, **kwargs):
788788
assert (
789789
"Version '*' of JumpStart model 'pytorch-eqa-bert-base-cased' has at least 1 "
790790
"vulnerable dependency in the inference script. "
791-
"Please try targetting a higher version of the model or using a different model. "
791+
"Please try targeting a higher version of the model or using a different model. "
792792
"List of vulnerabilities: some, vulnerability"
793793
) == str(e.value.message)
794794

@@ -827,7 +827,7 @@ def make_vulnerable_training_spec(*largs, **kwargs):
827827
assert (
828828
"Version '*' of JumpStart model 'pytorch-eqa-bert-base-cased' has at least 1 "
829829
"vulnerable dependency in the training script. "
830-
"Please try targetting a higher version of the model or using a different model. "
830+
"Please try targeting a higher version of the model or using a different model. "
831831
"List of vulnerabilities: some, vulnerability"
832832
) == str(e.value.message)
833833

@@ -866,7 +866,7 @@ def make_deprecated_spec(*largs, **kwargs):
866866
region="us-west-2",
867867
)
868868
assert "Version '*' of JumpStart model 'pytorch-eqa-bert-base-cased' is deprecated. "
869-
"Please try targetting a higher version of the model or using a different model." == str(
869+
"Please try targeting a higher version of the model or using a different model." == str(
870870
e.value.message
871871
)
872872

0 commit comments

Comments
 (0)