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
3a65a7c9
Commit
3a65a7c9
authored
Nov 02, 2021
by
Marta
Browse files
fix bool args parsing bug
parent
cd5a1e13
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
train_openfold.py
train_openfold.py
+14
-4
No files found.
train_openfold.py
View file @
3a65a7c9
...
@@ -185,6 +185,16 @@ def main(args):
...
@@ -185,6 +185,16 @@ def main(args):
)
)
def
bool_type
(
bool_str
:
str
):
bool_str_lower
=
bool_str
.
lower
()
if
bool_str_lower
in
(
'false'
,
'f'
,
'no'
,
'n'
,
'0'
):
return
False
elif
bool_str_lower
in
(
'true'
,
't'
,
'yes'
,
'y'
,
'1'
):
return
True
else
:
raise
ValueError
(
f
'Cannot interpret
{
bool_str
}
as bool'
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
parser
=
argparse
.
ArgumentParser
()
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
parser
.
add_argument
(
...
@@ -245,7 +255,7 @@ if __name__ == "__main__":
...
@@ -245,7 +255,7 @@ if __name__ == "__main__":
files."""
files."""
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--use_small_bfd"
,
type
=
bool
,
default
=
False
,
"--use_small_bfd"
,
type
=
bool
_type
,
default
=
False
,
help
=
"Whether to use a reduced version of the BFD database"
help
=
"Whether to use a reduced version of the BFD database"
)
)
parser
.
add_argument
(
parser
.
add_argument
(
...
@@ -257,12 +267,12 @@ if __name__ == "__main__":
...
@@ -257,12 +267,12 @@ if __name__ == "__main__":
help
=
"Path to DeepSpeed config. If not provided, DeepSpeed is disabled"
help
=
"Path to DeepSpeed config. If not provided, DeepSpeed is disabled"
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--checkpoint_best_val"
,
type
=
bool
,
default
=
True
,
"--checkpoint_best_val"
,
type
=
bool
_type
,
default
=
True
,
help
=
"""Whether to save the model parameters that perform best during
help
=
"""Whether to save the model parameters that perform best during
validation"""
validation"""
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--early_stopping"
,
type
=
bool
,
default
=
False
,
"--early_stopping"
,
type
=
bool
_type
,
default
=
False
,
help
=
"Whether to stop training when validation loss fails to decrease"
help
=
"Whether to stop training when validation loss fails to decrease"
)
)
parser
.
add_argument
(
parser
.
add_argument
(
...
@@ -279,7 +289,7 @@ if __name__ == "__main__":
...
@@ -279,7 +289,7 @@ if __name__ == "__main__":
help
=
"Path to a model checkpoint from which to restore training state"
help
=
"Path to a model checkpoint from which to restore training state"
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--resume_model_weights_only"
,
type
=
bool
,
default
=
False
,
"--resume_model_weights_only"
,
type
=
bool
_type
,
default
=
False
,
help
=
"Whether to load just model weights as opposed to training state"
help
=
"Whether to load just model weights as opposed to training state"
)
)
parser
.
add_argument
(
parser
.
add_argument
(
...
...
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