File tree Expand file tree Collapse file tree 4 files changed +57
-1
lines changed
Expand file tree Collapse file tree 4 files changed +57
-1
lines changed Original file line number Diff line number Diff line change 2626
2727@Backend .register ("pretrained" )
2828class 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
Original file line number Diff line number Diff line change 55 annotations ,
66)
77
8+ import logging
89from 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
Original file line number Diff line number Diff line change 2929 change-bias
3030 precision
3131 show-model-info
32+ pretrained
Original file line number Diff line number Diff line change 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.
You can’t perform that action at this time.
0 commit comments