Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run generate.py with the CodeT5-large trained on the ground-truth programs #18

Closed
doviettung96 opened this issue Nov 14, 2022 · 4 comments

Comments

@doviettung96
Copy link

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.

@henryhungle
Copy link
Collaborator

@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/:

model_path=models/codet5_finetuned_codeRL

@doviettung96
Copy link
Author

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.

@henryhungle
Copy link
Collaborator

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.

@doviettung96
Copy link
Author

Oh yeah. My bad. It is because I set the path for the checkpoint not quite correctly. It works now. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants