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
)
| 847 | |
| 848 | |
| 849 | def 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 | |
| 883 | def get_bundle_info( |
searching dependent graphs…