You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/hub.rst
+5-5
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Publishing models
6
6
-----------------
7
7
8
8
Pytorch Hub supports publishing pre-trained models(model definitions and pre-trained weights)
9
-
to a github repository by adding a simple ``hubconf.py`` file;
9
+
to a GitHub repository by adding a simple ``hubconf.py`` file;
10
10
11
11
``hubconf.py`` can have multiple entrypoints. Each entrypoint is defined as a python function
12
12
(example: a pre-trained model you want to publish).
@@ -49,15 +49,15 @@ You can see the full script in
49
49
are the allowed positional/keyword arguments. It's highly recommended to add a few examples here.
50
50
- Entrypoint function can either return a model(nn.module), or auxiliary tools to make the user workflow smoother, e.g. tokenizers.
51
51
- Callables prefixed with underscore are considered as helper functions which won't show up in :func:`torch.hub.list()`.
52
-
- Pretrained weights can either be stored locally in the github repo, or loadable by
52
+
- Pretrained weights can either be stored locally in the GitHub repo, or loadable by
53
53
:func:`torch.hub.load_state_dict_from_url()`. If less than 2GB, it's recommended to attach it to a `project release <https://help.github.com/en/articles/distributing-large-binaries>`_
54
54
and use the url from the release.
55
55
In the example above ``torchvision.models.resnet.resnet18`` handles ``pretrained``, alternatively you can put the following logic in the entrypoint definition.
56
56
57
57
::
58
58
59
59
if pretrained:
60
-
# For checkpoint saved in local github repo, e.g. <RELATIVE_PATH_TO_CHECKPOINT>=weights/save.pth
60
+
# For checkpoint saved in local GitHub repo, e.g. <RELATIVE_PATH_TO_CHECKPOINT>=weights/save.pth
0 commit comments