File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed
tests/unit/sagemaker/jumpstart Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -552,6 +552,12 @@ def _select_version(
552
552
)
553
553
return version_str if version_str in available_versions else None
554
554
555
+ if version_str [- 1 ] == "*" :
556
+ # major or minor version is pinned, e.g 1.* or 1.0.*
557
+ return utils .get_latest_version (
558
+ [version for version in available_versions if version .startswith (version_str [:- 1 ])]
559
+ )
560
+
555
561
try :
556
562
spec = SpecifierSet (f"=={ version_str } " )
557
563
except InvalidSpecifier :
Original file line number Diff line number Diff line change 15990
15990
"spec_key": "community_models_specs/tensorflow-ic-"
15991
15991
"imagenet-inception-v3-classification-4/specs_v3.0.0.json",
15992
15992
},
15993
+ {
15994
+ "model_id": "meta-textgeneration-llama-2-7b",
15995
+ "version": "4.9.0",
15996
+ "min_version": "2.49.0",
15997
+ "spec_key": "community_models/meta-textgeneration-llama-2-7b/specs_v4.9.0.json",
15998
+ },
15999
+ {
16000
+ "model_id": "meta-textgeneration-llama-2-7b",
16001
+ "version": "4.13.0",
16002
+ "min_version": "2.49.0",
16003
+ "spec_key": "community_models/meta-textgeneration-llama-2-7b/specs_v4.13.0.json",
16004
+ },
15993
16005
]
15994
16006
15995
16007
BASE_PROPRIETARY_HEADER = {
Original file line number Diff line number Diff line change @@ -184,6 +184,30 @@ def test_jumpstart_cache_get_header():
184
184
semantic_version_str = "1.0.*" ,
185
185
)
186
186
187
+ assert JumpStartModelHeader (
188
+ {
189
+ "model_id" : "meta-textgeneration-llama-2-7b" ,
190
+ "version" : "4.13.0" ,
191
+ "min_version" : "2.49.0" ,
192
+ "spec_key" : "community_models/meta-textgeneration-llama-2-7b/specs_v4.13.0.json" ,
193
+ }
194
+ ) == cache .get_header (
195
+ model_id = "meta-textgeneration-llama-2-7b" ,
196
+ semantic_version_str = "*" ,
197
+ )
198
+
199
+ assert JumpStartModelHeader (
200
+ {
201
+ "model_id" : "meta-textgeneration-llama-2-7b" ,
202
+ "version" : "4.13.0" ,
203
+ "min_version" : "2.49.0" ,
204
+ "spec_key" : "community_models/meta-textgeneration-llama-2-7b/specs_v4.13.0.json" ,
205
+ }
206
+ ) == cache .get_header (
207
+ model_id = "meta-textgeneration-llama-2-7b" ,
208
+ semantic_version_str = "4.*" ,
209
+ )
210
+
187
211
assert JumpStartModelHeader (
188
212
{
189
213
"model_id" : "ai21-summarization" ,
You can’t perform that action at this time.
0 commit comments