Hi, I am trying something similar to do “further training” as mentioned above by running the run_mlm.py script in google colab from a checkpoint.
cmd = ‘’‘python run_mlm.py 
–output_dir {0}  
–model_name_or_path roberta-base 
–mlm_probability 0.15 \
–train_file {1} 
–validation_file {2} 
–config_name /content/models/smallBERTa 
–tokenizer_name /content/models/smallBERTa 
–do_train 
–line_by_line 
–overwrite_output_dir 
–do_eval 
–learning_rate 1e-4 \
–num_train_epochs 5 
–save_total_limit 2 
–save_steps 2000 
–logging_steps 500 
–per_device_eval_batch_size 32 
–per_device_train_batch_size 32 
–seed 42 
‘’’.format(weights_dir,train_path,eval_path)
Run:
!{cmd}
Problem is, I have the error:
Traceback (most recent call last):
File “run_mlm.py”, line 386, in 
main()
File “run_mlm.py”, line 154, in main
model_args, data_args, training_args = parser.parse_args_into_dataclasses()
File “/usr/local/lib/python3.6/dist-packages/transformers/hf_argparser.py”, line 135, in parse_args_into_dataclasses
obj = dtype(**inputs)
File “”, line 12, in init
File “run_mlm.py”, line 133, in post_init
raise ValueError(“Need either a dataset name or a training/validation file.”)
ValueError: Need either a dataset name or a training/validation file.
/bin/bash: line 1: --train_file: command not found
/bin/bash: line 2: --num_train_epochs: command not found
I have no idea if the error is because of some bash configuration i did not set on google colab, or if the python script was written wrongly. Appreciate if anyone encountered the same issue and know what is going on!