MCPcopy Index your code
hub / github.com/Project-MONAI/MONAI / get_bundle_versions

Function get_bundle_versions

monai/bundle/scripts.py:849–880  ·  view source on GitHub ↗

Get the latest version, as well as all existing versions of a bundle that is stored in the release of specified repository with the provided tag. If tag is "dev", will get model information from https://raw.githubusercontent.com/repo_owner/repo_name/dev/models/model_info.json. In or

(
    bundle_name: str, repo: str = "Project-MONAI/model-zoo", tag: str = "dev", auth_token: str | None = None
)

Source from the content-addressed store, hash-verified

847
848
849def get_bundle_versions(
850 bundle_name: str, repo: str = "Project-MONAI/model-zoo", tag: str = "dev", auth_token: str | None = None
851) -> dict[str, list[str] | str]:
852 """
853 Get the latest version, as well as all existing versions of a bundle that is stored in the release of specified
854 repository with the provided tag. If tag is "dev", will get model information from
855 https://raw.githubusercontent.com/repo_owner/repo_name/dev/models/model_info.json.
856 In order to increase the rate limits of calling Github APIs, you can input your personal access token.
857 Please check the following link for more details about rate limiting:
858 https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting
859
860 The following link shows how to create your personal access token:
861 https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
862
863 Args:
864 bundle_name: bundle name.
865 repo: it should be in the form of "repo_owner/repo_name/".
866 tag: the tag name of the release.
867 auth_token: github personal access token.
868
869 Returns:
870 a dictionary that contains the latest version and all versions of a bundle.
871
872 """
873
874 bundles_info = _get_all_bundles_info(repo=repo, tag=tag, auth_token=auth_token)
875 if bundle_name not in bundles_info:
876 raise ValueError(f"bundle: {bundle_name} is not existing in repo: {repo}.")
877 bundle_info = bundles_info[bundle_name]
878 all_versions = sorted(bundle_info.keys())
879
880 return {"latest_version": all_versions[-1], "all_versions": all_versions}
881
882
883def get_bundle_info(

Callers 2

Calls 1

_get_all_bundles_infoFunction · 0.85

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…