Commit d1fd74f
committed
fix(serve): repair HuggingFace -> JumpStart redirect in ModelBuilder
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 9101cef commit d1fd74f
2 files changed
Lines changed: 11 additions & 5 deletions
| 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 | | |
| |||
0 commit comments