MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / _download_from_ngc

Function _download_from_ngc

monai/bundle/scripts.py:244–260  ·  view source on GitHub ↗
(
    download_path: Path,
    filename: str,
    version: str,
    prefix: str = "monai_",
    remove_prefix: str | None = "monai_",
    progress: bool = True,
)

Source from the content-addressed store, hash-verified

242
243
244def _download_from_ngc(
245 download_path: Path,
246 filename: str,
247 version: str,
248 prefix: str = "monai_",
249 remove_prefix: str | None = "monai_",
250 progress: bool = True,
251) -> None:
252 # ensure prefix is contained
253 filename = _add_ngc_prefix(filename, prefix=prefix)
254 url = _get_ngc_bundle_url(model_name=filename, version=version)
255 if remove_prefix:
256 filename = _remove_ngc_prefix(filename, prefix=remove_prefix)
257 filepath = download_path / filename
258 filepath.mkdir(parents=True, exist_ok=True)
259 for file in _get_all_download_files(url):
260 download_url(url=f"{url}/{file}", filepath=f"{filepath}/{file}", hash_val=None, progress=progress)
261
262
263def _download_from_ngc_private(

Callers 1

downloadFunction · 0.85

Calls 5

download_urlFunction · 0.90
_add_ngc_prefixFunction · 0.85
_get_ngc_bundle_urlFunction · 0.85
_remove_ngc_prefixFunction · 0.85
_get_all_download_filesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…