|
40 | 40 | from sagemaker.compute_resource_requirements.resource_requirements import ResourceRequirements
|
41 | 41 | from sagemaker.enums import EndpointType
|
42 | 42 | from sagemaker.jumpstart.hub.parser_utils import (
|
43 |
| - pascal_to_snake, |
| 43 | + camel_to_snake, |
44 | 44 | walk_and_apply_json,
|
45 | 45 | )
|
46 | 46 | from sagemaker.model_life_cycle import ModelLifeCycle
|
@@ -241,7 +241,7 @@ def from_json(self, json_obj: Dict[str, Any]) -> None:
|
241 | 241 | return
|
242 | 242 |
|
243 | 243 | if self._is_hub_content:
|
244 |
| - json_obj = walk_and_apply_json(json_obj, pascal_to_snake) |
| 244 | + json_obj = walk_and_apply_json(json_obj, camel_to_snake) |
245 | 245 |
|
246 | 246 | self.framework = json_obj.get("framework")
|
247 | 247 | self.framework_version = json_obj.get("framework_version")
|
@@ -295,7 +295,7 @@ def from_json(self, json_obj: Dict[str, Any]) -> None:
|
295 | 295 | """
|
296 | 296 |
|
297 | 297 | if self._is_hub_content:
|
298 |
| - json_obj = walk_and_apply_json(json_obj, pascal_to_snake) |
| 298 | + json_obj = walk_and_apply_json(json_obj, camel_to_snake) |
299 | 299 | self.name = json_obj["name"]
|
300 | 300 | self.type = json_obj["type"]
|
301 | 301 | self.default = json_obj["default"]
|
@@ -363,7 +363,7 @@ def from_json(self, json_obj: Dict[str, Any]) -> None:
|
363 | 363 | Args:
|
364 | 364 | json_obj (Dict[str, Any]): Dictionary representation of environment variable.
|
365 | 365 | """
|
366 |
| - json_obj = walk_and_apply_json(json_obj, pascal_to_snake) |
| 366 | + json_obj = walk_and_apply_json(json_obj, camel_to_snake) |
367 | 367 | self.name = json_obj["name"]
|
368 | 368 | self.type = json_obj["type"]
|
369 | 369 | self.default = json_obj["default"]
|
@@ -413,7 +413,7 @@ def from_json(self, json_obj: Optional[Dict[str, Any]]) -> None:
|
413 | 413 | return
|
414 | 414 |
|
415 | 415 | if self._is_hub_content:
|
416 |
| - json_obj = walk_and_apply_json(json_obj, pascal_to_snake) |
| 416 | + json_obj = walk_and_apply_json(json_obj, camel_to_snake) |
417 | 417 | self.default_content_type = json_obj["default_content_type"]
|
418 | 418 | self.supported_content_types = json_obj["supported_content_types"]
|
419 | 419 | self.default_accept_type = json_obj["default_accept_type"]
|
@@ -467,7 +467,7 @@ def from_json(self, json_obj: Optional[Dict[str, Any]]) -> None:
|
467 | 467 | return
|
468 | 468 |
|
469 | 469 | if self._is_hub_content:
|
470 |
| - json_obj = walk_and_apply_json(json_obj, pascal_to_snake) |
| 470 | + json_obj = walk_and_apply_json(json_obj, camel_to_snake) |
471 | 471 | self.raw_payload = json_obj
|
472 | 472 | self.content_type = json_obj["content_type"]
|
473 | 473 | self.body = json_obj.get("body")
|
@@ -540,7 +540,7 @@ def from_describe_hub_content_response(self, response: Optional[Dict[str, Any]])
|
540 | 540 | if response is None:
|
541 | 541 | return
|
542 | 542 |
|
543 |
| - response = walk_and_apply_json(response, pascal_to_snake) |
| 543 | + response = walk_and_apply_json(response, camel_to_snake) |
544 | 544 | self.aliases: Optional[dict] = response.get("aliases")
|
545 | 545 | self.regional_aliases = None
|
546 | 546 | self.variants: Optional[dict] = response.get("variants")
|
@@ -1180,7 +1180,7 @@ def __init__(self, spec: Optional[Dict[str, Any]], is_hub_content=False):
|
1180 | 1180 | spec (Dict[str, Any]): Dictionary representation of training config ranking.
|
1181 | 1181 | """
|
1182 | 1182 | if is_hub_content:
|
1183 |
| - spec = walk_and_apply_json(spec, pascal_to_snake) |
| 1183 | + spec = walk_and_apply_json(spec, camel_to_snake) |
1184 | 1184 | self.from_json(spec)
|
1185 | 1185 |
|
1186 | 1186 | def from_json(self, json_obj: Dict[str, Any]) -> None:
|
@@ -1286,7 +1286,7 @@ def from_json(self, json_obj: Dict[str, Any]) -> None:
|
1286 | 1286 | json_obj (Dict[str, Any]): Dictionary representation of spec.
|
1287 | 1287 | """
|
1288 | 1288 | if self._is_hub_content:
|
1289 |
| - json_obj = walk_and_apply_json(json_obj, pascal_to_snake) |
| 1289 | + json_obj = walk_and_apply_json(json_obj, camel_to_snake) |
1290 | 1290 | self.model_id: str = json_obj.get("model_id")
|
1291 | 1291 | self.url: str = json_obj.get("url")
|
1292 | 1292 | self.version: str = json_obj.get("version")
|
@@ -1515,7 +1515,7 @@ def __init__(
|
1515 | 1515 | ValueError: If the component field is invalid.
|
1516 | 1516 | """
|
1517 | 1517 | if is_hub_content:
|
1518 |
| - component = walk_and_apply_json(component, pascal_to_snake) |
| 1518 | + component = walk_and_apply_json(component, camel_to_snake) |
1519 | 1519 | self.component_name = component_name
|
1520 | 1520 | super().__init__(component, is_hub_content)
|
1521 | 1521 | self.from_json(component)
|
@@ -1568,8 +1568,8 @@ def __init__(
|
1568 | 1568 | The list of components that are used to construct the resolved config.
|
1569 | 1569 | """
|
1570 | 1570 | if is_hub_content:
|
1571 |
| - config = walk_and_apply_json(config, pascal_to_snake) |
1572 |
| - base_fields = walk_and_apply_json(base_fields, pascal_to_snake) |
| 1571 | + config = walk_and_apply_json(config, camel_to_snake) |
| 1572 | + base_fields = walk_and_apply_json(base_fields, camel_to_snake) |
1573 | 1573 | self.base_fields = base_fields
|
1574 | 1574 | self.config_components: Dict[str, JumpStartConfigComponent] = config_components
|
1575 | 1575 | self.benchmark_metrics: Dict[str, List[JumpStartBenchmarkStat]] = (
|
@@ -1735,7 +1735,7 @@ def from_json(self, json_obj: Dict[str, Any]) -> None:
|
1735 | 1735 | """
|
1736 | 1736 | super().from_json(json_obj)
|
1737 | 1737 | if self._is_hub_content:
|
1738 |
| - json_obj = walk_and_apply_json(json_obj, pascal_to_snake) |
| 1738 | + json_obj = walk_and_apply_json(json_obj, camel_to_snake) |
1739 | 1739 | self.inference_config_components: Optional[Dict[str, JumpStartConfigComponent]] = (
|
1740 | 1740 | {
|
1741 | 1741 | component_name: JumpStartConfigComponent(component_name, component)
|
|
0 commit comments