Skip to content

Commit d80a997

Browse files
committed
just do a warning if saved model version differs from current version
1 parent 15aaf07 commit d80a997

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

alphafold3_pytorch/alphafold3.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2965,6 +2965,11 @@ def load(self, path: str | Path, strict = False):
29652965
package = torch.load(str(path), map_location = 'cpu')
29662966

29672967
model_package = package['model']
2968+
current_version = version('alphafold3_pytorch')
2969+
2970+
if model_package['version'] != current_version:
2971+
print(f'loading a saved model from version {model_package["version"]} but you are on version {current_version}')
2972+
29682973
self.load_state_dict(model_package['state_dict'], strict = strict)
29692974

29702975
@staticmethod

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "alphafold3-pytorch"
3-
version = "0.0.56"
3+
version = "0.0.57"
44
description = "Alphafold 3 - Pytorch"
55
authors = [
66
{ name = "Phil Wang", email = "[email protected]" }

0 commit comments

Comments
 (0)