Commit 7e3d5270 authored by Hongkun Yu's avatar Hongkun Yu Committed by A. Unique TensorFlower
Browse files

Make gin flags optional through try/except

PiperOrigin-RevId: 361951657
parent d5d087ba
...@@ -61,13 +61,21 @@ def define_flags(): ...@@ -61,13 +61,21 @@ def define_flags():
'--> params in params_override. See also the help message of ' '--> params in params_override. See also the help message of '
'`--config_file`.') '`--config_file`.')
flags.DEFINE_multi_string( # The libraries rely on gin often make mistakes that include flags inside
'gin_file', default=None, help='List of paths to the config files.') # the library files which causes conflicts.
try:
flags.DEFINE_multi_string(
'gin_file', default=None, help='List of paths to the config files.')
except flags.DuplicateFlagError:
pass
flags.DEFINE_multi_string( try:
'gin_params', flags.DEFINE_multi_string(
default=None, 'gin_params',
help='Newline separated list of Gin parameter bindings.') default=None,
help='Newline separated list of Gin parameter bindings.')
except flags.DuplicateFlagError:
pass
flags.DEFINE_string( flags.DEFINE_string(
'tpu', default=None, 'tpu', default=None,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment