Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
OpenFold
Commits
a7216c73
Commit
a7216c73
authored
Feb 14, 2024
by
Jennifer
Browse files
changes reloading weights to account for possible state_dict headers.
parent
711ba0ab
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
train_openfold.py
train_openfold.py
+7
-2
No files found.
train_openfold.py
View file @
a7216c73
...
...
@@ -295,7 +295,12 @@ def main(args):
sd
=
get_fp32_state_dict_from_zero_checkpoint
(
args
.
resume_from_ckpt
)
else
:
sd
=
torch
.
load
(
args
.
resume_from_ckpt
)
sd
=
{
k
[
len
(
"module."
):]:
v
for
k
,
v
in
sd
.
items
()}
if
'module'
in
sd
:
module_sd
=
{
k
[
len
(
"module."
):]:
v
for
k
,
v
in
sd
[
'module'
].
items
()}
import_openfold_weights_
(
model
=
model_module
,
state_dict
=
module_sd
)
elif
'state_dict'
in
sd
:
import_openfold_weights_
(
model
=
model_module
,
state_dict
=
sd
[
'state_dict'
])
else
:
import_openfold_weights_
(
model
=
model_module
,
state_dict
=
sd
)
logging
.
info
(
"Successfully loaded model weights..."
)
if
(
args
.
resume_from_jax_params
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment