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
4 changes: 2 additions & 2 deletions monai/bundle/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ def _get_git_release_url(repo_owner: str, repo_name: str, tag_name: str, filenam


def _get_ngc_bundle_url(model_name: str, version: str) -> str:
return f"https://api.ngc.nvidia.com/v2/models/nvidia/monaitoolkit/{model_name}/versions/{version}/zip"
return f"https://api.ngc.nvidia.com/v2/models/nvidia/monaitoolkit/{model_name.lower()}/versions/{version}/zip"


def _get_monaihosting_bundle_url(model_name: str, version: str) -> str:
monaihosting_root_path = "https://api.ngc.nvidia.com/v2/models/nvidia/monaihosting"
return f"{monaihosting_root_path}/{model_name}/versions/{version}/files/{model_name}_v{version}.zip"
return f"{monaihosting_root_path}/{model_name}/versions/{version}/files/{model_name.lower()}_v{version}.zip"


def _download_from_github(repo: str, download_path: Path, filename: str, progress: bool = True) -> None:
Expand Down
10 changes: 8 additions & 2 deletions tests/test_bundle_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@
]

TEST_CASE_8 = [
"Spleen_CT_Segmentation",
"cuda" if torch.cuda.is_available() else "cpu",
{"spatial_dims": 3, "out_channels": 5},
]

TEST_CASE_9 = [
["network.json", "test_output.pt", "test_input.pt", "large_files.yaml"],
"test_bundle",
"https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/test_bundle_v0.1.2.zip",
Expand Down Expand Up @@ -204,7 +210,7 @@ def test_load_weights(self, bundle_files, bundle_name, repo, device, model_file)
output_3 = model_3.forward(input_tensor)
assert_allclose(output_3, expected_output, atol=1e-4, rtol=1e-4, type_test=False)

@parameterized.expand([TEST_CASE_7])
@parameterized.expand([TEST_CASE_7, TEST_CASE_8])
@skip_if_quick
def test_load_weights_with_net_override(self, bundle_name, device, net_override):
with skip_if_downloading_fails():
Expand Down Expand Up @@ -282,7 +288,7 @@ def test_load_ts_module(self, bundle_files, bundle_name, version, repo, device,


class TestDownloadLargefiles(unittest.TestCase):
@parameterized.expand([TEST_CASE_8])
@parameterized.expand([TEST_CASE_9])
@skip_if_quick
def test_url_download_large_files(self, bundle_files, bundle_name, url, hash_val):
with skip_if_downloading_fails():
Expand Down