|
39 | 39 | "Note that models may have different input/output signatures after a major version upgrade." |
40 | 40 | ) |
41 | 41 |
|
| 42 | +_VULNERABLE_DEPRECATED_ERROR_RECOMMENDATION = ( |
| 43 | + "We recommend that you specify a more recent " |
| 44 | + "model version or choose a different model. To access the latest models " |
| 45 | + "and model versions, be sure to upgrade to the latest version of the SageMaker Python SDK." |
| 46 | +) |
| 47 | + |
42 | 48 |
|
43 | 49 | def get_wildcard_model_version_msg( |
44 | 50 | model_id: str, wildcard_model_version: str, full_model_version: str |
@@ -115,16 +121,16 @@ def __init__( |
115 | 121 | self.message = ( |
116 | 122 | f"Version '{version}' of JumpStart model '{model_id}' " # type: ignore |
117 | 123 | "has at least 1 vulnerable dependency in the inference script. " |
118 | | - "Please try targeting a higher version of the model or using a " |
119 | | - "different model. List of vulnerabilities: " |
| 124 | + f"{_VULNERABLE_DEPRECATED_ERROR_RECOMMENDATION} " |
| 125 | + "List of vulnerabilities: " |
120 | 126 | f"{', '.join(vulnerabilities)}" # type: ignore |
121 | 127 | ) |
122 | 128 | elif scope == JumpStartScriptScope.TRAINING: |
123 | 129 | self.message = ( |
124 | 130 | f"Version '{version}' of JumpStart model '{model_id}' " # type: ignore |
125 | 131 | "has at least 1 vulnerable dependency in the training script. " |
126 | | - "Please try targeting a higher version of the model or using a " |
127 | | - "different model. List of vulnerabilities: " |
| 132 | + f"{_VULNERABLE_DEPRECATED_ERROR_RECOMMENDATION} " |
| 133 | + "List of vulnerabilities: " |
128 | 134 | f"{', '.join(vulnerabilities)}" # type: ignore |
129 | 135 | ) |
130 | 136 | else: |
@@ -159,8 +165,7 @@ def __init__( |
159 | 165 | raise RuntimeError("Must specify `model_id` and `version` arguments.") |
160 | 166 | self.message = ( |
161 | 167 | f"Version '{version}' of JumpStart model '{model_id}' is deprecated. " |
162 | | - "Please try targeting a higher version of the model or using a " |
163 | | - "different model." |
| 168 | + f"{_VULNERABLE_DEPRECATED_ERROR_RECOMMENDATION}" |
164 | 169 | ) |
165 | 170 |
|
166 | 171 | super().__init__(self.message) |
0 commit comments