Skip to content

Commit d997612

Browse files
author
Jonathan Makunga
committed
Refactoring
1 parent a263067 commit d997612

File tree

9 files changed

+5
-56
lines changed

9 files changed

+5
-56
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.224.5.dev0
1+
2.224.5.dev0

src/sagemaker/jumpstart/factory/estimator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
from sagemaker.jumpstart.utils import (
6363
add_hub_content_arn_tags,
6464
add_jumpstart_model_info_tags,
65-
add_jumpstart_model_id_version_tags,
6665
get_eula_message,
6766
get_default_jumpstart_session_with_user_agent_suffix,
6867
update_dict_if_key_not_present,

src/sagemaker/jumpstart/factory/model.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
from sagemaker.jumpstart.utils import (
5050
add_hub_content_arn_tags,
5151
add_jumpstart_model_info_tags,
52-
add_jumpstart_model_id_version_tags,
5352
get_default_jumpstart_session_with_user_agent_suffix,
5453
get_neo_content_bucket,
5554
update_dict_if_key_not_present,

src/sagemaker/jumpstart/hub/interfaces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ def from_json(self, json_obj: Dict[str, Any]) -> None:
585585
)
586586
self.hosting_eula_uri: Optional[str] = json_obj.get("HostingEulaUri")
587587
self.hosting_model_package_arn: Optional[str] = json_obj.get("HostingModelPackageArn")
588-
588+
589589
self.inference_config_rankings = self._get_config_rankings(json_obj)
590590
self.inference_config_components = self._get_config_components(json_obj)
591591
self.inference_configs = self._get_configs(json_obj)

src/sagemaker/jumpstart/types.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1975,14 +1975,15 @@ def extract_region_from_arn(arn: str) -> Optional[str]:
19751975
if match:
19761976
hub_region = match.group(2)
19771977
return hub_region
1978-
1978+
19791979
match = re.match(HUB_ARN_REGEX, arn)
19801980
if match:
19811981
hub_region = match.group(2)
19821982
return hub_region
19831983

19841984
return hub_region
19851985

1986+
19861987
class JumpStartCachedContentValue(JumpStartDataHolderType):
19871988
"""Data class for the s3 cached content values."""
19881989

src/sagemaker/jumpstart/utils.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -446,21 +446,6 @@ def add_hub_content_arn_tags(
446446
return tags
447447

448448

449-
def add_hub_content_arn_tags(
450-
tags: Optional[List[TagsDict]],
451-
hub_arn: str,
452-
) -> Optional[List[TagsDict]]:
453-
"""Adds custom Hub arn tag to JumpStart related resources."""
454-
455-
tags = add_single_jumpstart_tag(
456-
hub_arn,
457-
enums.JumpStartTag.HUB_CONTENT_ARN,
458-
tags,
459-
is_uri=False,
460-
)
461-
return tags
462-
463-
464449
def add_jumpstart_uri_tags(
465450
tags: Optional[List[TagsDict]] = None,
466451
inference_model_uri: Optional[Union[str, dict]] = None,

src/sagemaker/serve/builder/model_builder.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -309,20 +309,6 @@ class ModelBuilder(Triton, DJL, JumpStart, TGI, Transformers, TensorflowServing,
309309
},
310310
)
311311

312-
def _build_validations(self):
313-
"""Validations needed for model server overrides, or auto-detection or fallback"""
314-
if self.mode == Mode.IN_PROCESS:
315-
raise ValueError("IN_PROCESS mode is not supported yet!")
316-
317-
if self.inference_spec and self.model:
318-
raise ValueError("Can only set one of the following: model, inference_spec.")
319-
320-
if self.image_uri and not is_1p_image_uri(self.image_uri) and self.model_server is None:
321-
raise ValueError(
322-
"Model_server must be set when non-first-party image_uri is set. "
323-
+ "Supported model servers: %s" % supported_model_servers
324-
)
325-
326312
def _save_model_inference_spec(self):
327313
"""Placeholder docstring"""
328314
# check if path exists and create if not

tests/unit/sagemaker/jumpstart/constants.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9805,27 +9805,6 @@
98059805
"p5": {"properties": {"image_uri": "$gpu_ecr_uri_1"}},
98069806
},
98079807
},
9808-
"ContextualHelp": {
9809-
"HubFormatTrainData": [
9810-
"A train and an optional validation directories. Each directory contains a CSV/JSON/TXT. ",
9811-
"- For CSV/JSON files, the text data is used from the column called 'text' or the first column if no column called 'text' is found", # noqa: E501
9812-
"- The number of files under train and validation (if provided) should equal to one, respectively.",
9813-
" [Learn how to setup an AWS S3 bucket.](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html)", # noqa: E501
9814-
],
9815-
"HubDefaultTrainData": [
9816-
"Dataset: [SEC](https://www.sec.gov/edgar/searchedgar/companysearch)",
9817-
"SEC filing contains regulatory documents that companies and issuers of securities must submit to the Securities and Exchange Commission (SEC) on a regular basis.", # noqa: E501
9818-
"License: [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/legalcode)",
9819-
],
9820-
},
9821-
"ModelDataDownloadTimeout": 1200,
9822-
"ContainerStartupHealthCheckTimeout": 1200,
9823-
"EncryptInterContainerTraffic": True,
9824-
"DisableOutputCompression": True,
9825-
"MaxRuntimeInSeconds": 360000,
9826-
"DynamicContainerDeploymentSupported": True,
9827-
"TrainingModelPackageArtifactUri": None,
9828-
"Dependencies": [],
98299808
"InferenceConfigRankings": {
98309809
"overall": {"Description": "default", "Rankings": ["variant1"]}
98319810
},

tests/unit/sagemaker/jumpstart/model/test_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@ def test_attach(
14921492
model_version="some-version",
14931493
inference_component_name="some-ic-name",
14941494
)
1495-
1495+
14961496
mock_get_model_info_from_endpoint.assert_not_called()
14971497

14981498
@mock.patch(

0 commit comments

Comments
 (0)