Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tests/integ/sagemaker/serve/test_schema_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ def test_model_builder_happy_path_with_task_provided_local_schema_mode(
model_metadata={"HF_TASK": task_provided},
instance_type=instance_type_provided,
sagemaker_session=sagemaker_session,
env_vars={
# Force plain HTTPS model download in the container. HF Hub repos are now
# backed by Xet storage, and the DLC's hf_transfer path returns 403 against
# the Xet CDN, so the container fails the ping health check on startup.
"HF_HUB_ENABLE_HF_TRANSFER": "0",
"HF_HUB_DISABLE_XET": "1",
},
)

model = model_builder.build(sagemaker_session=sagemaker_session)
Expand Down Expand Up @@ -169,6 +176,13 @@ def test_model_builder_happy_path_with_task_provided_remote_schema_mode(
model_metadata={"HF_TASK": task_provided},
instance_type=instance_type_provided,
sagemaker_session=sagemaker_session,
env_vars={
# Force plain HTTPS model download in the container. HF Hub repos are now
# backed by Xet storage, and the DLC's hf_transfer path returns 403 against
# the Xet CDN, so the container fails the ping health check on startup.
"HF_HUB_ENABLE_HF_TRANSFER": "0",
"HF_HUB_DISABLE_XET": "1",
},
)
model = model_builder.build(sagemaker_session=sagemaker_session)

Expand Down
7 changes: 6 additions & 1 deletion tests/integ/sagemaker/serve/test_serve_tei.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ def model_builder_model_schema_builder(sagemaker_session):
schema_builder=SchemaBuilder(sample_input, loaded_response),
env_vars={
# Add this to bypass JumpStart model mapping
"HF_MODEL_ID": "BAAI/bge-m3"
"HF_MODEL_ID": "BAAI/bge-m3",
# Force plain HTTPS model download in the container. HF Hub repos are now
# backed by Xet storage, and the DLC's hf_transfer path returns 403 against
# the Xet CDN, so the container fails the ping health check on startup.
"HF_HUB_ENABLE_HF_TRANSFER": "0",
"HF_HUB_DISABLE_XET": "1",
},
)

Expand Down
6 changes: 6 additions & 0 deletions tests/unit/sagemaker/serve/builder/test_js_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,12 +1272,14 @@ def test_jumpstart_model_provider_calls_jumpstart_speculative_decoding(

mock_js_speculative_decoding.assert_called_once()

@patch("sagemaker.serve.builder.jumpstart_builder.JumpStartModel")
@patch("sagemaker.serve.builder.jumpstart_builder._capture_telemetry", side_effect=None)
@patch.object(ModelBuilder, "_get_serve_setting", autospec=True)
def test_optimize_quantize_and_compile_for_jumpstart(
self,
mock_serve_settings,
mock_telemetry,
mock_js_model,
):
mock_sagemaker_session = Mock()
mock_metadata_config = Mock()
Expand Down Expand Up @@ -1319,6 +1321,10 @@ def test_optimize_quantize_and_compile_for_jumpstart(

model_builder.pysdk_model = mock_pysdk_model

# Avoid a real JumpStartModel construction (which would hit S3 for the
# JumpStart manifest); return a deterministic env for neuron lookup.
mock_js_model.return_value.env = {"SAGEMAKER_ENV": "1"}

out_put = model_builder._optimize_for_jumpstart(
accept_eula=True,
quantization_config={
Expand Down
Loading