Skip to content

Commit 6b19157

Browse files
author
OpenClaw
committed
docs(pretrained): add usage guide for dp pretrained
- document dp pretrained download command and alias usage\n- include model/pretrained.md in docs index\n- keep CLI path output and add log message for visibility\n- clarify pretrained backend is an internal virtual alias backend\n\nAuthored by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.3-codex)
1 parent e1c0f9a commit 6b19157

File tree

4 files changed

+57
-1
lines changed

4 files changed

+57
-1
lines changed

deepmd/backend/pretrained.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@
2626

2727
@Backend.register("pretrained")
2828
class PretrainedBackend(Backend):
29-
"""Backend for ``*.pretrained`` model aliases."""
29+
"""Internal virtual backend for ``*.pretrained`` alias dispatch.
30+
31+
This backend is not intended to be selected explicitly by users as a real
32+
compute backend (such as TensorFlow/PyTorch/Paddle/JAX). It only bridges
33+
``*.pretrained`` aliases into the regular deep-eval loading path.
34+
"""
3035

3136
name = "Pretrained"
3237
features: ClassVar[Backend.Feature] = Backend.Feature.DEEP_EVAL

deepmd/pretrained/entrypoints.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
annotations,
66
)
77

8+
import logging
89
from pathlib import (
910
Path,
1011
)
@@ -25,6 +26,7 @@ def pretrained_entrypoint(args: argparse.Namespace) -> None:
2526
if args.pretrained_command == "download":
2627
cache_dir = Path(args.cache_dir) if args.cache_dir else None
2728
path = download_model(args.MODEL, cache_dir=cache_dir)
29+
logging.getLogger(__name__).info("Pretrained model path: %s", path)
2830
print(path) # noqa: T201
2931
return
3032

doc/model/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ Model
2929
change-bias
3030
precision
3131
show-model-info
32+
pretrained

doc/model/pretrained.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Use `dp pretrained` to download built-in models
2+
3+
The `dp pretrained` command provides a simple way to download built-in pre-trained models and store them in a local cache.
4+
5+
## Command syntax
6+
7+
```bash
8+
dp pretrained download <MODEL> [--cache-dir <PATH>]
9+
```
10+
11+
- `<MODEL>`: the built-in model name.
12+
- `--cache-dir <PATH>`: optional cache directory. If omitted, DeePMD-kit uses the default cache path.
13+
14+
## Available built-in models
15+
16+
You can run `dp pretrained download -h` to see the currently supported model list in your installed version.
17+
18+
Examples in this release include:
19+
20+
- `DPA-3.2-5M`
21+
- `DPA-3.1-3M`
22+
23+
## Examples
24+
25+
```bash
26+
# Download to default cache directory
27+
dp pretrained download DPA-3.2-5M
28+
29+
# Download to a custom cache directory
30+
dp pretrained download DPA-3.2-5M --cache-dir ./models
31+
```
32+
33+
The command prints the local path of the downloaded model file on success.
34+
35+
## Use downloaded models via alias
36+
37+
After downloading, you can use the `.pretrained` alias directly in DeepEval/DeepPot workflows.
38+
39+
For example:
40+
41+
```python
42+
from deepmd.infer import DeepPot
43+
44+
# DeePMD-kit resolves this alias to the corresponding local model file
45+
pot = DeepPot("DPA-3.2-5M.pretrained")
46+
```
47+
48+
The `.pretrained` alias is designed for user-facing model selection, while backend details are handled internally.

0 commit comments

Comments
 (0)