提交 429cca8e 编写于 作者: M Megvii Engine Team 提交者: Xinran Xu

docs(mge/hub): refine docstring in hub module

GitOrigin-RevId: 2f73c1242b0c377c14cb05f2d24fe3ddbef9da27
上级 955095c1
......@@ -102,17 +102,17 @@ class GitSSHFetcher(RepoFetcherBase):
silent: bool = True,
) -> str:
"""
Fetch git repo by SSH protocol
Fetches git repo by SSH protocol
:param git_host:
host address of git repo
dxample: github.com
host address of git repo.
example: github.com
:param 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.
dxample: ``"brain_sdk/MegBrain[:hub]"``
example: ``"brain_sdk/MegBrain[:hub]"``
:param use_cache:
whether to use locally cached code or completely re-fetch
whether to use locally fetched code or completely re-fetch
:param commit:
commit id on github or gitlab
:param silent:
......@@ -215,7 +215,7 @@ class GitHTTPSFetcher(RepoFetcherBase):
silent: bool = True,
) -> str:
"""
Fetch git repo by HTTPS protocol
Fetches git repo by HTTPS protocol
:param git_host:
host address of git repo
......
......@@ -94,7 +94,7 @@ def _init_hub(
commit: str = None,
protocol: str = DEFAULT_PROTOCOL,
):
"""Import hubmodule like python import
"""Imports hubmodule like python import
:param repo_info:
a string with format ``"repo_owner/repo_name[:tag_name/:branch_name]"`` with an optional
......@@ -137,7 +137,7 @@ def list(
commit: str = None,
protocol: str = DEFAULT_PROTOCOL,
) -> List[str]:
"""List all entrypoints available in repo hubconf
"""Lists all entrypoints available in repo hubconf
:param repo_info:
a string with format ``"repo_owner/repo_name[:tag_name/:branch_name]"`` with an optional
......@@ -175,7 +175,7 @@ def load(
protocol: str = DEFAULT_PROTOCOL,
**kwargs
) -> Any:
"""Load model from github or gitlab repo, with pretrained weights.
"""Loads model from github or gitlab repo, with pretrained weights.
:param repo_info:
a string with format ``"repo_owner/repo_name[:tag_name/:branch_name]"`` with an optional
......@@ -250,7 +250,7 @@ def help(
def load_serialized_obj_from_url(url: str, model_dir=None) -> Any:
"""Loads MegEngine serialized object at the given URL.
"""Loads MegEngine serialized object from the given URL.
If the object is already present in ``model_dir``, it's deserialized and
returned. If no ``model_dir`` is specified, it will be ``MGE_HOME/serialized``.
......@@ -291,7 +291,8 @@ def load_serialized_obj_from_url(url: str, model_dir=None) -> Any:
class pretrained:
r"""Decorator helps quick link model function to existing pretrained weights.
r"""
Decorator which helps to download pretrained weights from the given url.
For example, we can decorate a resnet18 function as follows
......
......@@ -15,7 +15,7 @@ from typing import Iterator
def load_module(name: str, path: str) -> types.ModuleType:
"""
Load module specified by name and path
Loads module specified by name and path
:param name: module name
:param path: module path
......@@ -27,7 +27,7 @@ def load_module(name: str, path: str) -> types.ModuleType:
def check_module_exists(module: str) -> bool:
"""Check python module exist or not
"""Checks whether python module exists or not
:param module: name of module
"""
......@@ -36,7 +36,7 @@ def check_module_exists(module: str) -> bool:
@contextmanager
def cd(target: str) -> Iterator[None]:
"""Change current directory to target
"""Changes current directory to target
:param target: target directory
"""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册