Skip to content

Commit

Permalink
Remove the default value, since the flag has required=True this means…
Browse files Browse the repository at this point in the history
… the default is never used. In addition remove checks for an unset value which will also not happen, along with the else clause which erounously set the labels
  • Loading branch information
dagardner-nv committed Jun 13, 2023
1 parent 0f8f3cc commit 132950f
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions morpheus/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,15 +427,14 @@ def pipeline_fil(ctx: click.Context, **kwargs):
pipeline_mode=PipelineModes.AE)
@click.option('--columns_file',
required=True,
default="data/columns_ae.txt",
default=None,
type=MorpheusRelativePath(dir_okay=False, exists=True, file_okay=True, resolve_path=True),
help=("Specifies a file to read column features."))
@click.option('--labels_file',
default=None,
type=MorpheusRelativePath(dir_okay=False, exists=True, file_okay=True, resolve_path=True),
help=("Specifies a file to read labels from in order to convert class IDs into labels. "
"A label file is a simple text file where each line corresponds to a label. "
"If unspecified, only a single output label is created for FIL"))
"A label file is a simple text file where each line corresponds to a label. "))
@click.option('--userid_column_name',
type=str,
default="userIdentityaccountId",
Expand Down Expand Up @@ -492,19 +491,14 @@ def pipeline_ae(ctx: click.Context, **kwargs):
config.ae.userid_column_name = kwargs["userid_column_name"]
config.ae.feature_scaler = kwargs["feature_scaler"]
config.ae.use_generic_model = kwargs["use_generic_model"]

if ("columns_file" in kwargs and kwargs["columns_file"] is not None):
config.ae.feature_columns = load_labels_file(kwargs["columns_file"])
logger.debug("Loaded columns. Current columns: [%s]", str(config.ae.feature_columns))
else:
# Use a default single label
config.class_labels = ["reconstruct_loss", "zscore"]
config.ae.feature_columns = load_labels_file(kwargs["columns_file"])
logger.debug("Loaded columns. Current columns: [%s]", str(config.ae.feature_columns))

if ("labels_file" in kwargs and kwargs["labels_file"] is not None):
config.class_labels = load_labels_file(kwargs["labels_file"])
logger.debug("Loaded labels file. Current labels: [%s]", str(config.class_labels))
else:
# Use a default single label
# Use default labels
config.class_labels = ["reconstruct_loss", "zscore"]

if ("userid_filter" in kwargs):
Expand Down

0 comments on commit 132950f

Please sign in to comment.