60
60
},
61
61
}
62
62
63
+ BASE_MANIFEST = [
64
+ {
65
+ "model_id" : "tensorflow-ic-imagenet-inception-v3-classification-4" ,
66
+ "version" : "1.0.0" ,
67
+ "min_version" : "2.49.0" ,
68
+ "spec_key" : "community_models_specs/tensorflow-ic-imagenet"
69
+ "-inception-v3-classification-4/specs_v1.0.0.json" ,
70
+ },
71
+ {
72
+ "model_id" : "tensorflow-ic-imagenet-inception-v3-classification-4" ,
73
+ "version" : "2.0.0" ,
74
+ "min_version" : "2.49.0" ,
75
+ "spec_key" : "community_models_specs/tensorflow-ic-imagenet"
76
+ "-inception-v3-classification-4/specs_v2.0.0.json" ,
77
+ },
78
+ {
79
+ "model_id" : "pytorch-ic-imagenet-inception-v3-classification-4" ,
80
+ "version" : "1.0.0" ,
81
+ "min_version" : "2.49.0" ,
82
+ "spec_key" : "community_models_specs/pytorch-ic-"
83
+ "imagenet-inception-v3-classification-4/specs_v1.0.0.json" ,
84
+ },
85
+ {
86
+ "model_id" : "pytorch-ic-imagenet-inception-v3-classification-4" ,
87
+ "version" : "2.0.0" ,
88
+ "min_version" : "2.49.0" ,
89
+ "spec_key" : "community_models_specs/pytorch-ic-imagenet-"
90
+ "inception-v3-classification-4/specs_v2.0.0.json" ,
91
+ },
92
+ {
93
+ "model_id" : "tensorflow-ic-imagenet-inception-v3-classification-4" ,
94
+ "version" : "3.0.0" ,
95
+ "min_version" : "4.49.0" ,
96
+ "spec_key" : "community_models_specs/tensorflow-ic-"
97
+ "imagenet-inception-v3-classification-4/specs_v3.0.0.json" ,
98
+ },
99
+ ]
100
+
63
101
64
102
def get_spec_from_base_spec (model_id : str , version : str ) -> JumpStartModelSpecs :
65
103
spec = copy .deepcopy (BASE_SPEC )
@@ -77,45 +115,9 @@ def patched_get_file_from_s3(
77
115
78
116
filetype , s3_key = key .file_type , key .s3_key
79
117
if filetype == JumpStartS3FileType .MANIFEST :
80
- manifest = [
81
- {
82
- "model_id" : "tensorflow-ic-imagenet-inception-v3-classification-4" ,
83
- "version" : "1.0.0" ,
84
- "min_version" : "2.49.0" ,
85
- "spec_key" : "community_models_specs/tensorflow-ic-imagenet"
86
- "-inception-v3-classification-4/specs_v1.0.0.json" ,
87
- },
88
- {
89
- "model_id" : "tensorflow-ic-imagenet-inception-v3-classification-4" ,
90
- "version" : "2.0.0" ,
91
- "min_version" : "2.49.0" ,
92
- "spec_key" : "community_models_specs/tensorflow-ic-imagenet"
93
- "-inception-v3-classification-4/specs_v2.0.0.json" ,
94
- },
95
- {
96
- "model_id" : "pytorch-ic-imagenet-inception-v3-classification-4" ,
97
- "version" : "1.0.0" ,
98
- "min_version" : "2.49.0" ,
99
- "spec_key" : "community_models_specs/pytorch-ic-"
100
- "imagenet-inception-v3-classification-4/specs_v1.0.0.json" ,
101
- },
102
- {
103
- "model_id" : "pytorch-ic-imagenet-inception-v3-classification-4" ,
104
- "version" : "2.0.0" ,
105
- "min_version" : "2.49.0" ,
106
- "spec_key" : "community_models_specs/pytorch-ic-imagenet-"
107
- "inception-v3-classification-4/specs_v2.0.0.json" ,
108
- },
109
- {
110
- "model_id" : "tensorflow-ic-imagenet-inception-v3-classification-4" ,
111
- "version" : "3.0.0" ,
112
- "min_version" : "4.49.0" ,
113
- "spec_key" : "community_models_specs/tensorflow-ic-"
114
- "imagenet-inception-v3-classification-4/specs_v3.0.0.json" ,
115
- },
116
- ]
118
+
117
119
return JumpStartCachedS3ContentValue (
118
- formatted_file_content = get_formatted_manifest (manifest )
120
+ formatted_file_content = get_formatted_manifest (BASE_MANIFEST )
119
121
)
120
122
121
123
if filetype == JumpStartS3FileType .SPECS :
@@ -579,6 +581,15 @@ def test_jumpstart_cache_handles_bad_semantic_version_manifest_key_cache():
579
581
cache .clear .assert_called_once ()
580
582
581
583
584
+ @patch .object (JumpStartModelsCache , "_get_file_from_s3" , patched_get_file_from_s3 )
585
+ @patch ("sagemaker.jumpstart.utils.get_sagemaker_version" , lambda : "2.68.3" )
586
+ def test_jumpstart_get_full_manifest ():
587
+ cache = JumpStartModelsCache (s3_bucket_name = "some_bucket" )
588
+ raw_manifest = [header .to_json () for header in cache .get_manifest ()]
589
+
590
+ raw_manifest == BASE_MANIFEST
591
+
592
+
582
593
@patch .object (JumpStartModelsCache , "_get_file_from_s3" , patched_get_file_from_s3 )
583
594
@patch ("sagemaker.jumpstart.utils.get_sagemaker_version" , lambda : "2.68.3" )
584
595
def test_jumpstart_cache_get_specs ():
0 commit comments