Skip to content

Commit

Permalink
Fix typo in argument name, and move inside so it's not forced for HF …
Browse files Browse the repository at this point in the history
…encoders.
  • Loading branch information
tmills committed Aug 22, 2023
1 parent 745fc11 commit c856942
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/cnlpt/cnlp_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class ModelArguments:
)
},
)
ignore_existing_classifers: bool = field(
ignore_existing_classifiers: bool = field(
default=False,
metadata={
"help": (
Expand Down
16 changes: 7 additions & 9 deletions src/cnlpt/train_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,6 @@ def main(
model_name = model_args.model
hierarchical = model_name == 'hier'

if (
hierarchical
and (model_args.keep_existing_classifiers == model_args.ignore_existing_classifers) # XNOR
):
raise ValueError(
"For hierarchical model, one of --keep_existing_classifiers or "
"--ignore_existing_classifers flags should be selected."
)

# Setup logging
logging.basicConfig(
format="%(asctime)s - %(levelname)s - %(name)s - %(message)s",
Expand Down Expand Up @@ -260,6 +251,13 @@ def main(
freeze=training_args.freeze,
)
else:
if (
hierarchical
and (model_args.keep_existing_classifiers == model_args.ignore_existing_classifiers) # XNOR
):
raise ValueError(
"For continued training of a cnlpt hierarchical model, one of --keep_existing_classifiers or --ignore_existing_classifiers flags should be selected."
)
# use a checkpoint from an existing model
AutoModel.register(CnlpConfig, HierarchicalModel)

Expand Down

0 comments on commit c856942

Please sign in to comment.