Repository navigation
Commit ab7524e
fix: don't treat SageMaker model-package ARN as a HuggingFace model ID (#6513)
ModelBuilder's smart-detection path for choosing a default instance type
treated any non-JumpStart string `model` value as a HuggingFace repo id.
A SageMaker model-package ARN (a supported `model=` input) was pasted
verbatim into https://huggingface.co/api/models/<ARN>, which 404s. The
404 handler only recognized HTTP 401, so it fell through and the failure
surfaced as a misleading "provide a HUGGING_FACE_HUB_TOKEN" message.
Changes:
- Guard the smart-detection branch in `_get_default_instance_type` so a
model-package ARN skips HuggingFace metadata lookup and falls back to
the CPU default instead of hitting huggingface.co.
- Exclude model-package ARNs in `_is_huggingface_model` (an ARN contains
"/", which the org/model-name heuristic wrongly matched).
- Distinguish HTTP 404 from 401 in `get_huggingface_model_metadata` so a
missing repo reports "not found on huggingface.co" instead of
suggesting a HUGGING_FACE_HUB_TOKEN.
Reuses the existing MODEL_PACKAGE_ARN_REGEX helper. Adds regression tests.
Co-authored-by: Mufaddal Rohawala <mufi@amazon.com>1 parent c9ec795 commit ab7524e
2 files changed
Lines changed: 68 additions & 0 deletions
File tree
- sagemaker-serve
- src/sagemaker/serve
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
359 | 368 | | |
360 | 369 | | |
361 | 370 | | |
| |||
532 | 541 | | |
533 | 542 | | |
534 | 543 | | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
535 | 549 | | |
536 | 550 | | |
537 | 551 | | |
| |||
3456 | 3470 | | |
3457 | 3471 | | |
3458 | 3472 | | |
| 3473 | + | |
| 3474 | + | |
| 3475 | + | |
| 3476 | + | |
| 3477 | + | |
| 3478 | + | |
| 3479 | + | |
3459 | 3480 | | |
3460 | 3481 | | |
3461 | 3482 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
529 | 576 | | |
530 | 577 | | |
0 commit comments