Run generate.py with the CodeT5-large trained on the ground-truth programs
doviettung96 opened this issue · 4 comments
Hi @henryhungle ,
While waiting for the release of the final RL-finetuned code generator, I would like to run the generator trained on ground-truth programs like here.
However, the training script scripts/train_actor.sh
only returns checkpoints. When I check each of the checkpoints, each folder does not have the same files as in the pre-trained model folders.
So the question is: How can I generate programs from those checkpoints?
Thank you.
@doviettung96 Just to clarify, So you can finetune CodeT5-large on ground-truth programs using the scripts/train_actor.sh
but you are not sure how to generate from the finetuned checkpoints?
One way is to simply replace the model path from the below line to the path of a checkpoint you have from finetuning e.g. exps/codet5-large_none_bs1x4_lr2e-05/final_checkpoint/
:
Line 7 in b97a8e7
Yeah. I did replace that path in the generate.sh
script. However, while I'm loading that checkpoint as a generator model Loading model from /exps/checkpoints/checkpoint-293000...
, I got this error:
OSError: We couldn't connect to 'https://huggingface.co/' to load this model and it looks like /exps/checkpoints/checkpoint-293000 is not the path to a directory conaining a config.json file.
As I described before, the checkpoint only has pytorch_model.bin
but not the config.json.
Can I find it anywhere? Or I think I can copy the config.json from CodeT5-large
, right?
Thanks.
I am not sure why the config.json
is not in the checkpoint folder. Is the above connection issue causing this problem? Have you tried to resolve it first?
I ran using the current code and the training worked fine and config.json
were saved in checkpoint folders.
Oh yeah. My bad. It is because I set the path for the checkpoint not quite correctly. It works now. Thank you.