Skip to content

Commit 80b3b6c

Browse files
author
Carlos Gomes
committed
add model loading instructions to docs
Signed-off-by: Carlos Gomes <[email protected]>
1 parent 4247e76 commit 80b3b6c

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

docs/models.md

+7
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ We also provide a model factory that can build a task specific model for a downs
3434

3535
By passing a list of bands being used to the constructor, we automatically filter out unused bands, and randomly initialize weights for new bands that were not pretrained on.
3636

37+
!!! info
38+
39+
To pass your own path from where to load the weights with the PrithviModelFactory, you can make use of timm's `pretrained_cfg_overlay`.
40+
E.g. to pass a local path, you can pass the parameter `backbone_pretrained_cfg_overlay = {"file": "<local_path>"}` to the model factory.
41+
42+
Besides `file`, you can also pass `url`, `hf_hub_id`, amongst others. Check timm's documentation for full details.
43+
3744
:::terratorch.models.backbones.prithvi_select_patch_embed_weights
3845

3946
## Decoders

docs/quick_start.md

+11
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,17 @@ task = PixelwiseRegressionTask(
105105

106106
At this level of abstraction, you can also provide a configuration file (see [LightningCLI](https://lightning.ai/docs/pytorch/stable/cli/lightning_cli.html#lightning-cli)) with all the details of the training. See an example for semantic segmentation below:
107107

108+
!!! info
109+
110+
To pass your own path from where to load the weights with the PrithviModelFactory, you can make use of timm's `pretrained_cfg_overlay`.
111+
E.g. to pass a local path, you can add, under model_args:
112+
113+
```yaml
114+
backbone_pretrained_cfg_overlay:
115+
file: <local_path>
116+
```
117+
Besides `file`, you can also pass `url`, `hf_hub_id`, amongst others. Check timm's documentation for full details.
118+
108119
```yaml title="Configuration file for a Semantic Segmentation Task"
109120
# lightning.pytorch==2.1.1
110121
seed_everything: 0

0 commit comments

Comments
 (0)