NetEase-GameAI / SARG

A official implementation of SARG: A Novel Semi Autoregressive Generator for Multi-turn Incomplete Utterance Restoration
Other
49 stars 8 forks source link

AttributeError: 'ModelArguments' object has no attribute 'add_entity' #4

Closed YiLing28 closed 2 years ago

YiLing28 commented 2 years ago

Steps to reproduce:

  1. run python covert_weight_from_bert_to_sarg.py,save the model to ./resources/model/Roberta-WWM-Init
  2. export CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --nproc_per_node 2 --master_port 29500 run_train.py \ --output_dir sarg-ailab-no-cov \ --do_train \ --do_eval \ --output_best_dir sarg-ailab-no-cov-best \ --learning_rate 5e-5 \ --max_steps 2000 \ --save_total_limit 3 \ --save_steps 200 \ --per_gpu_train_batch_size 64 \ --per_gpu_eval_batch_size 64 \ --seed 42 \ --tokenizer_name BertTokenizer \ --logging_steps 200 \ --mode ailab \ --evaluate_during_training True \ --model_name_or_path ./resources/model/Roberta-WWM-Init \ --train_data_file Restoration_200k_data/train.txt \ --eval_data_file Restoration_200k_data/valid.txt \ --alpha 3 \ --change_weight 1.5 report an error:the code: logger.info(f"Set the add_entity to {bool(model_args.add_entity) or bool(bool(model_args.add_cut))}") AttributeError: 'ModelArguments' object has no attribute 'add_entity'
hmzo commented 2 years ago

Hello ,YiLing

These two arguments, "add_entity" and "add_cut", are both experimental used in our ablation study. So you can easily delete them or extend the class "ModelArguments" as below:

` add_entity: int = field(default=0, metadata={"help": "add entity information or not"})

add_cut: int = field(default=0, metadata={"help": "add cut information or not"}) `