r"""Lists all entrypoints available in repo hubconf. Args: repo_info: a string with format ``"repo_owner/repo_name[:tag_name/:branch_name]"`` with an optional tag/branch. The default branch is ``master`` if not specified. Eg: ``"brain_sdk/MegBrain[:hub]"`` git_host:
(
repo_info: str,
git_host: str = DEFAULT_GIT_HOST,
use_cache: bool = True,
commit: str = None,
protocol: str = DEFAULT_PROTOCOL,
)
| 117 | |
| 118 | |
| 119 | def list( |
| 120 | repo_info: str, |
| 121 | git_host: str = DEFAULT_GIT_HOST, |
| 122 | use_cache: bool = True, |
| 123 | commit: str = None, |
| 124 | protocol: str = DEFAULT_PROTOCOL, |
| 125 | ) -> List[str]: |
| 126 | r"""Lists all entrypoints available in repo hubconf. |
| 127 | |
| 128 | Args: |
| 129 | repo_info: a string with format ``"repo_owner/repo_name[:tag_name/:branch_name]"`` with an optional |
| 130 | tag/branch. The default branch is ``master`` if not specified. Eg: ``"brain_sdk/MegBrain[:hub]"`` |
| 131 | git_host: host address of git repo. Eg: github.com |
| 132 | use_cache: whether to use locally cached code or completely re-fetch. |
| 133 | commit: commit id on github or gitlab. |
| 134 | protocol: which protocol to use to get the repo, and HTTPS protocol only supports public repo on github. |
| 135 | The value should be one of HTTPS, SSH. |
| 136 | |
| 137 | Returns: |
| 138 | all entrypoint names of the model. |
| 139 | """ |
| 140 | hubmodule = _init_hub(repo_info, git_host, use_cache, commit, protocol) |
| 141 | |
| 142 | return [ |
| 143 | _ |
| 144 | for _ in dir(hubmodule) |
| 145 | if not _.startswith("__") and callable(getattr(hubmodule, _)) |
| 146 | ] |
| 147 | |
| 148 | |
| 149 | def load( |