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
1df591b0
Commit
1df591b0
authored
Feb 08, 2024
by
Jennifer
Browse files
updates zero_to_fp32.py for new deepspeed version and import_weight bugfix
parent
bb3f51e5
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
258 additions
and
124 deletions
+258
-124
openfold/utils/import_weights.py
openfold/utils/import_weights.py
+3
-2
scripts/zero_to_fp32.py
scripts/zero_to_fp32.py
+255
-122
No files found.
openfold/utils/import_weights.py
View file @
1df591b0
...
@@ -688,8 +688,9 @@ def convert_deprecated_v1_keys(state_dict):
...
@@ -688,8 +688,9 @@ def convert_deprecated_v1_keys(state_dict):
new_key
=
convert_key_re
.
sub
(
lambda
m
:
replacements
[
m
.
group
()],
key
)
new_key
=
convert_key_re
.
sub
(
lambda
m
:
replacements
[
m
.
group
()],
key
)
# Add prefix for template modules
# Add prefix for template modules
if
new_key
.
startswith
(
'template'
):
subheader
=
re
.
search
(
'(?<=model.).*$'
,
new_key
).
group
()
new_key
=
f
'template_embedder.
{
new_key
}
'
if
subheader
.
startswith
(
'template'
):
new_key
=
f
'model.template_embedder.
{
subheader
}
'
converted_state_dict
[
new_key
]
=
value
converted_state_dict
[
new_key
]
=
value
...
...
scripts/zero_to_fp32.py
View file @
1df591b0
This diff is collapsed.
Click to expand it.
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