Commit b84338b
authored
fix(serve): repair HuggingFace -> JumpStart redirect in ModelBuilder (#5958)
Two bugs prevented `ModelBuilder(model="<HF_id_with_JS_mirror>").build()`
from working with any bare HuggingFace id (gpt2, Qwen/Qwen3-0.6B,
microsoft/phi-2, etc.), reproducible end-to-end:
ModelBuilder.build()
-> _build_single_modelbuilder (model_builder.py:2579)
-> _use_jumpstart_equivalent (model_builder_utils.py)
-> _hf_schema_builder_init raises TaskNotFoundException
-> redirect aborts before HF -> JS id swap
1. `sagemaker/serve/schema/task.json` was missing from the published
wheel. setuptools needs an explicit `[tool.setuptools.package-data]`
declaration; `include-package-data = true` alone is a no-op without a
MANIFEST.in or version-controlled file list. Without the JSON in the
wheel, `retrieve_local_schemas("text-generation")` raised
FileNotFoundError, the caller wrapped it in TaskNotFoundException, and
the redirect aborted before swapping to the JumpStart id.
2. `_use_jumpstart_equivalent` called `_build_for_jumpstart()` itself,
then `_build_single_modelbuilder` called it again on return. The
second call hit `_prepare_for_mode` with consumed state and raised
FileNotFoundError. Removed the inner call; the caller already handles
it.
Also wraps the HF schema bootstrap in a try/except so a missing local
task or flaky remote schema fetch can't abort the redirect — the
JumpStart build path supplies its own schema downstream.
Verified end-to-end: ModelBuilder(model="gpt2").build() and
ModelBuilder(model="Qwen/Qwen3-0.6B").build() both succeed (model
created with TGI / DJL_SERVING respectively). Pure-boto3 control with
the same JumpStart djl-inference image + S3 artifacts was already
accepted by CreateModel/CreateEndpointConfig/CreateEndpoint, so the
AWS contract and JumpStart artifacts were never the issue.1 parent 089bf3c commit b84338b
3 files changed
Lines changed: 61 additions & 8 deletions
File tree
- sagemaker-serve
- src/sagemaker/serve
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| |||
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
942 | 942 | | |
943 | 943 | | |
944 | 944 | | |
945 | | - | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
946 | 953 | | |
947 | 954 | | |
948 | 955 | | |
949 | 956 | | |
950 | 957 | | |
951 | 958 | | |
952 | | - | |
953 | | - | |
954 | | - | |
955 | | - | |
956 | 959 | | |
957 | 960 | | |
958 | 961 | | |
| |||
Lines changed: 50 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
192 | 226 | | |
193 | | - | |
194 | | - | |
195 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
196 | 243 | | |
197 | 244 | | |
198 | 245 | | |
| |||
0 commit comments