Skip to content

Commit

Permalink
fix comment 3
Browse files Browse the repository at this point in the history
Signed-off-by: Mingxin Zheng <[email protected]>
  • Loading branch information
mingxin-zheng committed Jul 24, 2024
1 parent cbfd184 commit 1ce127d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions monai/bundle/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ def _get_latest_bundle_version_ngc(name: str, repo: str | None = None, headers:
# if the package version is not available or the model is compatible with the package version
is_compatible, _ = _examine_monai_version(metadata["monai_version"])
if is_compatible:
if version != latest_versions[0]:
logger.info(f"Latest version is {latest_versions[0]}, but the compatible version is {version}.")
return version

# if no compatible version is found, return the latest version
Expand Down Expand Up @@ -552,8 +554,8 @@ def download(
version_ = _get_latest_bundle_version(source=source_, name=name_, repo=repo_, headers=headers)
if source_ == "github":
if version_ is not None:
name_ = "_v".join([name_, version_])
_download_from_github(repo=repo_, download_path=bundle_dir_, filename=name_, progress=progress_)
name_ver = "_v".join([name_, version_])
_download_from_github(repo=repo_, download_path=bundle_dir_, filename=name_ver, progress=progress_)
elif source_ == "monaihosting":
_download_from_monaihosting(download_path=bundle_dir_, filename=name_, version=version_, progress=progress_)
elif source_ == "ngc":
Expand Down

0 comments on commit 1ce127d

Please sign in to comment.