Skip to content

Commit 9383f28

Browse files
turicasrwightman
authored andcommitted
Add cache_dir example
1 parent d1e9a86 commit 9383f28

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

timm/models/_factory.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ def create_model(
8989
>>> model = create_model('mobilenetv3_large_100', pretrained=True, num_classes=10)
9090
>>> model.num_classes
9191
10
92+
93+
>>> # Create a Dinov2 small model with pretrained weights and save weights in a custom directory.
94+
>>> model = create_model('vit_small_patch14_dinov2.lvd142m', pretrained=True, cache_dir="/data/my-models")
95+
>>> # Data will be stored at `/data/my-models/models--timm--vit_small_patch14_dinov2.lvd142m/`
9296
```
9397
"""
9498
# Parameters that aren't supported by all models or are intended to only override model defaults if set

0 commit comments

Comments
 (0)