Closed sergiogrz closed 1 year ago
Please check if you have modified the model loading part and the model path. When you first run the fine-tune script, it will handle such error in https://github.com/microsoft/CodeBERT/blob/master/CodeReviewer/code/models.py#L199. While In your log, it seems you are loading checkpoint-last, which should not be expected when you fine-tune the model from the pre-trained model.
Thanks for your response. I'm not sure if I got it right. I've run it again, but modifying the --model_name_or_path
argument back to microsoft/codereviewer
. But I got the same error when running finetune-cls.sh
with the following arguments:
torchrun --nproc_per_node ${PER_NODE_GPU} --node_rank=${RANK} --nnodes=${NODES} --master_addr=${MASTER_HOST} --master_port=${MASTER_PORT} ../run_finetune_cls.py \
--train_epochs 30 \
--model_name_or_path microsoft/codereviewer \
--output_dir ../../save/cls \
--train_filename ../../dataset/Diff_Quality_Estimation \
--dev_filename ../../dataset/Diff_Quality_Estimation/cls-valid.jsonl \
--max_source_length 512 \
--max_target_length 128 \
--train_batch_size 12 \
--learning_rate 3e-4 \
--gradient_accumulation_steps 3 \
--mask_rate 0.15 \
--save_steps 3600 \
--log_steps 100 \
--train_steps 120000 \
--gpu_per_node=${PER_NODE_GPU} \
--node_index=${RANK} \
--seed 2233
Could you check if the path ../../save/cls/checkpoints-last/
exists? It is not supposed to exist. If yes, please delete (or backup to another place if you need it) it and run fine-tuning again.
Ahhh, that's it! I had wrongly downloaded the model checkpoint from Huggingface and placed it in ../../save/cls/checkpoints-last/
. Thank you so much @celbree !
Hello,
I have found your CodeReviewer project really interesting, so I would like to learn how to use it and try it. Following the README instructions I have downloaded the dataset from Zenodo and the pre-trained checkpoint from Huggingface, and adjusted some path arguments in the
finetune-cls.sh
script.My problem is, when I try to run the file, I receive the following error message:
Could you please lend me a hand with this issue? Am I missing something?
Thanks in advance.