Skip to content

Commit 00fb953

Browse files
authored
update docs (#243)
1 parent 64d1e15 commit 00fb953

File tree

4 files changed

+39
-8
lines changed

4 files changed

+39
-8
lines changed

docs/source/features.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# New Features
22

3-
## Coming Soon...
3+
## 2024-06-25
4+
5+
Unimol_tools has been publish to pypi! Huggingface has been used to manage the pretrain models.

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Uni-Mol tools is a easy-use wrappers for property prediction,representation and
2424
models
2525
task
2626
utils
27+
weight
2728
features
2829

2930
Indices and tables

docs/source/weight.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.. _weights:
2+
3+
Weights
4+
=======
5+
6+
We recommend installing ``huggingface_hub`` so that the required UniMol models can be automatically downloaded at runtime! It can be installed by:
7+
8+
.. code-block:: bash
9+
10+
pip install huggingface_hub
11+
12+
``huggingface_hub`` allows you to easily download and manage models from the Hugging Face Hub, which is key for using UniMol models.
13+
14+
Models in Huggingface
15+
---------------------
16+
17+
The UniMol pretrained models can be found at `dptech/Uni-Mol-Models <https://huggingface.co/dptech/Uni-Mol-Models/tree/main>`_.
18+
19+
If the download is slow, you can use other mirrors, such as:
20+
21+
.. code-block:: bash
22+
23+
export HF_ENDPOINT=https://hf-mirror.com
24+
25+
Setting the ``HF_ENDPOINT`` environment variable specifies the mirror address for the Hugging Face Hub to use when downloading models.
26+
27+
`unimol_tools.weights.weight_hub.py <https://github.com/dptech-corp/Uni-Mol/blob/docs/unimol_tools/unimol_tools/weights/weighthub.py>`_ control the logger.
28+
29+
.. automodule:: unimol_tools.weights.weighthub
30+
:members:

unimol_tools/unimol_tools/weights/weighthub.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ def snapshot_download(*args, **kwargs):
1616
def weight_download(pretrain, save_path, local_dir_use_symlinks=True):
1717
"""
1818
Downloads the specified pretrained model weights.
19-
20-
Args:
21-
pretrain (str): The name of the pretrained model to download.
22-
save_path (str): The directory where the weights should be saved.
23-
local_dir_use_symlinks (bool, optional): Whether to use symlinks for the local directory. Defaults to True.
19+
20+
:param pretrain: (str), The name of the pretrained model to download.
21+
:param save_path: (str), The directory where the weights should be saved.
22+
:param local_dir_use_symlinks: (bool, optional), Whether to use symlinks for the local directory. Defaults to True.
2423
"""
2524
if os.path.exists(os.path.join(save_path, pretrain)):
2625
logger.info(f'{pretrain} exists in {save_path}')
@@ -40,8 +39,7 @@ def download_all_weights(local_dir_use_symlinks=False):
4039
"""
4140
Downloads all available pretrained model weights to the WEIGHT_DIR.
4241
43-
Args:
44-
local_dir_use_symlinks (bool, optional): Whether to use symlinks for the local directory. Defaults to False.
42+
:param local_dir_use_symlinks: (bool, optional), Whether to use symlinks for the local directory. Defaults to False.
4543
"""
4644
logger.info(f'Downloading all weights to {WEIGHT_DIR}')
4745
snapshot_download(

0 commit comments

Comments
 (0)