Skip to content

Commit

Permalink
Merge pull request #448 from Ashiq5/Ashiq5-patch-1
Browse files Browse the repository at this point in the history
Proposed solution to Issue #447
  • Loading branch information
jxmorris12 committed May 30, 2021
2 parents 937ba0d + 3f224bc commit 4015ad2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions textattack/commands/attack/attack_args_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,10 @@ def parse_dataset_from_args(args):

# Get dataset from args.
if args.dataset_from_file:
textattack.shared.logger.info(
f"Loading model and tokenizer from file: {args.model_from_file}"
)
if args.model_from_file:
textattack.shared.logger.info(
f"Loading model and tokenizer from file: {args.model_from_file}"
)
if ARGS_SPLIT_TOKEN in args.dataset_from_file:
dataset_file, dataset_name = args.dataset_from_file.split(ARGS_SPLIT_TOKEN)
else:
Expand Down
5 changes: 4 additions & 1 deletion textattack/commands/peek_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ class PeekDatasetCommand(TextAttackCommand):
def run(self, args):
UPPERCASE_LETTERS_REGEX = re.compile("[A-Z]")

args.model = None # set model to None for parse_dataset_from_args to work
args.model, args.model_from_file = (
None,
None,
) # set model and model_from_file to None for parse_dataset_from_args to work
dataset = parse_dataset_from_args(args)

num_words = []
Expand Down

0 comments on commit 4015ad2

Please sign in to comment.