Unverified Commit 700ccf6e authored by Jin Young Sohn's avatar Jin Young Sohn Committed by GitHub
Browse files

Fix glue_convert_examples_to_features API breakage (#3742)

parent b7cf9f43
...@@ -329,14 +329,7 @@ def load_and_cache_examples(args, task, tokenizer, evaluate=False): ...@@ -329,14 +329,7 @@ def load_and_cache_examples(args, task, tokenizer, evaluate=False):
processor.get_dev_examples(args.data_dir) if evaluate else processor.get_train_examples(args.data_dir) processor.get_dev_examples(args.data_dir) if evaluate else processor.get_train_examples(args.data_dir)
) )
features = convert_examples_to_features( features = convert_examples_to_features(
examples, examples, tokenizer, max_length=args.max_seq_length, label_list=label_list, output_mode=output_mode,
tokenizer,
label_list=label_list,
max_length=args.max_seq_length,
output_mode=output_mode,
pad_on_left=bool(args.model_type in ["xlnet"]), # pad on the left for xlnet
pad_token=tokenizer.convert_tokens_to_ids([tokenizer.pad_token])[0],
pad_token_segment_id=4 if args.model_type in ["xlnet"] else 0,
) )
logger.info("Saving features into cached file %s", cached_features_file) logger.info("Saving features into cached file %s", cached_features_file)
torch.save(features, cached_features_file) torch.save(features, cached_features_file)
......
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