Skip to content

Commit 72f9f7b

Browse files
committed
chore: address PR comments
1 parent db7f514 commit 72f9f7b

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

src/sagemaker/jumpstart/cache.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ def _model_id_retrieval_function(
293293
raise KeyError(error_msg)
294294

295295
error_msg = f"Unable to find model manifest for '{model_id}' with version '{version}'. "
296-
error_msg += f"Visit {MODEL_ID_LIST_WEB_URL} for updated list of models, "
297-
error_msg += "or try another AWS region. "
296+
error_msg += "Specify a different model ID or try a different AWS Region. "
297+
error_msg += f"For a list of available models, see {MODEL_ID_LIST_WEB_URL}. "
298298

299299
other_model_id_version = None
300300
if model_type == JumpStartModelType.OPEN_WEIGHTS:

src/sagemaker/jumpstart/exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
)
3333

3434
INVALID_MODEL_ID_ERROR_MSG = (
35-
"Invalid model ID: '{model_id}'. Please visit "
36-
f"{MODEL_ID_LIST_WEB_URL} for a list of valid model IDs, or try another AWS region. "
35+
"Invalid model ID: '{model_id}'. Specify a different model ID or try a different AWS Region. "
36+
f"For a list of available models, see {MODEL_ID_LIST_WEB_URL}. "
3737
"The module `sagemaker.jumpstart.notebook_utils` contains utilities for "
3838
"fetching model IDs. We recommend upgrading to the latest version of sagemaker "
3939
"to get access to the most models."

tests/unit/sagemaker/jumpstart/test_cache.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,10 @@ def test_jumpstart_cache_get_header():
205205
)
206206
assert (
207207
"Unable to find model manifest for 'pytorch-ic-imagenet-inception-v3-classification-4' with "
208-
"version '3.*'. Visit https://sagemaker.readthedocs.io/en/stable/doc_utils/pretrainedmodels.html "
209-
"for updated list of models, or try another AWS region. Consider using model ID "
208+
"version '3.*'. Specify a different model ID or try a different AWS Region. "
209+
"For a list of available models, see "
210+
"https://sagemaker.readthedocs.io/en/stable/doc_utils/pretrainedmodels.html. "
211+
"Consider using model ID "
210212
"'pytorch-ic-imagenet-inception-v3-"
211213
"classification-4' with version '2.0.0'."
212214
) in str(e.value)
@@ -215,17 +217,19 @@ def test_jumpstart_cache_get_header():
215217
cache.get_header(model_id="pytorch-ic-", semantic_version_str="*")
216218
assert (
217219
"Unable to find model manifest for 'pytorch-ic-' with version '*'. "
218-
"Visit https://sagemaker.readthedocs.io/en/stable/doc_utils/pretrainedmodels.html "
219-
"for updated list of models, or try another AWS region. "
220+
"Specify a different model ID or try a different AWS Region. "
221+
"For a list of available models, see "
222+
"https://sagemaker.readthedocs.io/en/stable/doc_utils/pretrainedmodels.html. "
220223
"Did you mean to use model ID 'pytorch-ic-imagenet-inception-v3-classification-4'?"
221224
) in str(e.value)
222225

223226
with pytest.raises(KeyError) as e:
224227
cache.get_header(model_id="tensorflow-ic-", semantic_version_str="*")
225228
assert (
226229
"Unable to find model manifest for 'tensorflow-ic-' with version '*'. "
227-
"Visit https://sagemaker.readthedocs.io/en/stable/doc_utils/pretrainedmodels.html "
228-
"for updated list of models, or try another AWS region. "
230+
"Specify a different model ID or try a different AWS Region. For a list "
231+
"of available models, see "
232+
"https://sagemaker.readthedocs.io/en/stable/doc_utils/pretrainedmodels.html. "
229233
"Did you mean to use model ID 'tensorflow-ic-imagenet-inception-"
230234
"v3-classification-4'?"
231235
) in str(e.value)
@@ -238,8 +242,9 @@ def test_jumpstart_cache_get_header():
238242
)
239243
assert (
240244
"Unable to find model manifest for 'ai21-summarize' with version '1.1.003'. "
241-
"Visit https://sagemaker.readthedocs.io/en/stable/doc_utils/pretrainedmodels.html "
242-
"for updated list of models, or try another AWS region. "
245+
"Specify a different model ID or try a different AWS Region. "
246+
"For a list of available models, see "
247+
"https://sagemaker.readthedocs.io/en/stable/doc_utils/pretrainedmodels.html. "
243248
"Did you mean to use model ID 'ai21-summarization'?"
244249
) in str(e.value)
245250

0 commit comments

Comments
 (0)