|
45 | 45 | from monai.utils import ( |
46 | 46 | check_parent_dir, |
47 | 47 | deprecated_arg, |
48 | | - deprecated_arg_default, |
49 | 48 | ensure_tuple, |
50 | 49 | get_equivalent_dtype, |
51 | 50 | min_version, |
|
62 | 61 | logger = get_logger(module_name=__name__) |
63 | 62 |
|
64 | 63 | # set BUNDLE_DOWNLOAD_SRC="ngc" to use NGC source in default for bundle download |
65 | | -# set BUNDLE_DOWNLOAD_SRC="monaihosting" to use monaihosting source in default for bundle download |
66 | | -DEFAULT_DOWNLOAD_SOURCE = os.environ.get("BUNDLE_DOWNLOAD_SRC", "github") |
| 64 | +# set BUNDLE_DOWNLOAD_SRC="github" to use github source in default for bundle download |
| 65 | +DEFAULT_DOWNLOAD_SOURCE = os.environ.get("BUNDLE_DOWNLOAD_SRC", "monaihosting") |
67 | 66 | PPRINT_CONFIG_N = 5 |
68 | 67 |
|
69 | 68 |
|
@@ -248,7 +247,6 @@ def _process_bundle_dir(bundle_dir: PathLike | None = None) -> Path: |
248 | 247 | return Path(bundle_dir) |
249 | 248 |
|
250 | 249 |
|
251 | | -@deprecated_arg_default("source", "github", "monaihosting", since="1.2", replaced="1.5") |
252 | 250 | def download( |
253 | 251 | name: str | None = None, |
254 | 252 | version: str | None = None, |
@@ -541,9 +539,8 @@ def load( |
541 | 539 | return model |
542 | 540 |
|
543 | 541 |
|
544 | | -@deprecated_arg_default("tag", "hosting_storage_v1", "dev", since="1.2", replaced="1.5") |
545 | 542 | def _get_all_bundles_info( |
546 | | - repo: str = "Project-MONAI/model-zoo", tag: str = "hosting_storage_v1", auth_token: str | None = None |
| 543 | + repo: str = "Project-MONAI/model-zoo", tag: str = "dev", auth_token: str | None = None |
547 | 544 | ) -> dict[str, dict[str, dict[str, Any]]]: |
548 | 545 | if has_requests: |
549 | 546 | if tag == "hosting_storage_v1": |
@@ -586,9 +583,8 @@ def _get_all_bundles_info( |
586 | 583 | return bundles_info |
587 | 584 |
|
588 | 585 |
|
589 | | -@deprecated_arg_default("tag", "hosting_storage_v1", "dev", since="1.2", replaced="1.5") |
590 | 586 | def get_all_bundles_list( |
591 | | - repo: str = "Project-MONAI/model-zoo", tag: str = "hosting_storage_v1", auth_token: str | None = None |
| 587 | + repo: str = "Project-MONAI/model-zoo", tag: str = "dev", auth_token: str | None = None |
592 | 588 | ) -> list[tuple[str, str]]: |
593 | 589 | """ |
594 | 590 | Get all bundles names (and the latest versions) that are stored in the release of specified repository |
@@ -621,12 +617,8 @@ def get_all_bundles_list( |
621 | 617 | return bundles_list |
622 | 618 |
|
623 | 619 |
|
624 | | -@deprecated_arg_default("tag", "hosting_storage_v1", "dev", since="1.2", replaced="1.5") |
625 | 620 | def get_bundle_versions( |
626 | | - bundle_name: str, |
627 | | - repo: str = "Project-MONAI/model-zoo", |
628 | | - tag: str = "hosting_storage_v1", |
629 | | - auth_token: str | None = None, |
| 621 | + bundle_name: str, repo: str = "Project-MONAI/model-zoo", tag: str = "dev", auth_token: str | None = None |
630 | 622 | ) -> dict[str, list[str] | str]: |
631 | 623 | """ |
632 | 624 | Get the latest version, as well as all existing versions of a bundle that is stored in the release of specified |
@@ -659,20 +651,16 @@ def get_bundle_versions( |
659 | 651 | return {"latest_version": all_versions[-1], "all_versions": all_versions} |
660 | 652 |
|
661 | 653 |
|
662 | | -@deprecated_arg_default("tag", "hosting_storage_v1", "dev", since="1.2", replaced="1.5") |
663 | 654 | def get_bundle_info( |
664 | 655 | bundle_name: str, |
665 | 656 | version: str | None = None, |
666 | 657 | repo: str = "Project-MONAI/model-zoo", |
667 | | - tag: str = "hosting_storage_v1", |
| 658 | + tag: str = "dev", |
668 | 659 | auth_token: str | None = None, |
669 | 660 | ) -> dict[str, Any]: |
670 | 661 | """ |
671 | | - Get all information |
672 | | - (include "id", "name", "size", "download_count", "browser_download_url", "created_at", "updated_at") of a bundle |
| 662 | + Get all information (include "name" and "browser_download_url") of a bundle |
673 | 663 | with the specified bundle name and version which is stored in the release of specified repository with the provided tag. |
674 | | - Since v1.5, "hosting_storage_v1" will be deprecated in favor of 'dev', which contains only "name" and "browser_download_url". |
675 | | - information about a bundle. |
676 | 664 | In order to increase the rate limits of calling Github APIs, you can input your personal access token. |
677 | 665 | Please check the following link for more details about rate limiting: |
678 | 666 | https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting |
|
0 commit comments