Skip to content

Commit

Permalink
Extend docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wesselb committed Aug 20, 2024
1 parent d6a24a0 commit 28d0ce6
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
18 changes: 18 additions & 0 deletions docs/beware.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,21 @@ you should do two things:
1. Set `torch.use_deterministic_algorithms(True)` to make PyTorch operations deterministic.

2. Set `model.eval()` to disable drop-out.

## Loading a Checkpoint Onto an Extended Model

If you changed the model and added or removed parameters, you need to set `strict=False` when
loading a checkpoint `Aurora.load_checkpoint(..., strict=False)`.
Importantly, enabling or disabling LoRA for a model that was trained respectively without or
with LoRA changes the parameters!

## Extending the Model with New Surface-Level Variables

Whereas we have attempted to design a robust and flexible model,
inevitably some unfortunate design choices slipped through.

A notable unfortunate design choice is that extending the model with a new surface-level
variable breaks compatibility with existing checkpoints.
It is possible to hack around this in a relatively simple way.
We are working on a more principled fix.
Please open an issue if this is a problem for you.
19 changes: 18 additions & 1 deletion docs/finetuning.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,21 @@ model = Aurora(use_lora=False) # Model is not fine-tuned.
model.load_checkpoint("wbruinsma/aurora", "aurora-0.25-pretrained.ckpt")
```

More specific instructions coming soon.
You are also free to extend the model for your particular use case.
In that case, it might be that you add or remove parameters.
Then `Aurora.load_checkpoint` will error,
because the existing checkpoint now mismatches with the model's parameters.
Simply set `Aurora.load_checkpoint(..., strict=False)`:

```python
from aurora import Aurora


model = Aurora(...)

... # Modify `model`

model.load_checkpoint("wbruinsma/aurora", "aurora-0.25-pretrained.ckpt", strict=False)
```

More instructions coming soon!

0 comments on commit 28d0ce6

Please sign in to comment.