Hi,
I just launched the transformers/examples/run_ner.py script with my custom model:
python3 transformers/examples/run_ner.py --data_dir $INPUT_DATA_DIR \
--tokenizer_name $TOKENIZER_FILE_PATH --output_dir $OUTPUT_DIR --model_type camembert --labels $LABELS_DIR --model_name_or_path $BERT_MODEL --max_seq_length $MAX_LENGTH --num_train_epochs $NUM_EPOCHS --gradient_accumulation_steps $ACCUMULATION_STEPS --per_gpu_train_batch_size $BATCH_SIZE --save_steps $SAVE_STEPS --do_lower_case --do_train --do_eval --do_predict
Once the data for the train has been loaded, an error appear:
Traceback (most recent call last):
File "transformers/examples/run_ner.py", line 567, in <module>
main()
File "transformers/examples/run_ner.py", line 496, in main
global_step, tr_loss = train(args, train_dataset, model, tokenizer, labels, pad_token_label_id)
File "transformers/examples/run_ner.py", line 132, in train
global_step = int(args.model_name_or_path.split('-')[-1].split('/')[0])
ValueError: invalid literal for int() with base 10: 'pytorch_dump_folder'
Launching the same script a few hours ago the error did not appear, is it something related to the last updates #2134 ?
Thanks in advance.
Can confirm this issue -> a temporary workaround would be to change the line to:
if os.path.exists(args.model_name_or_path) and "checkpoint" in args.model_name_or_path:
See also related (recent) fix on master: https://github.com/huggingface/transformers/commit/4d36472b96d144887cbe95b083f0d2091fd5ff03
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
Can confirm this issue -> a temporary workaround would be to change the line to: