-
Notifications
You must be signed in to change notification settings - Fork 10
eval_bleu with pretrained gpt model #3
Comments
Too many information and thus unable to understand the problem. I don't see any |
I would like to evaluate the model, but the error |
I am not sure. The CodeGPT codebase is supposed to work fine. I am not sure why you are getting this error. I will run again in my environment to see if CodeGPT training and evaluation work correctly. |
The problem is that GPT-2 model's output format has changed in the newer versions of Huggingface's transformers library – thus, it needs to apply |
I see, you can modify the code to be compatible with the newer versions of the transformers API. I am closing this issue for now. |
Hi @wasiahmad,
I'm trying to evaluate a gpt-2 model with your code. Thus, I run
run.py
withmicrosoft/CodeGPT-small-py
inpretrain_dir
parameter anddo_infer
. Ineval_blue
scriptoutputs
equal tomodel(inputs)[1]
– these are hidden states of pretrained gpt – and it's a tuple of 12 elements (n_layers) consisting of 2 elements each, and these two have [1, 12, 48, 64]. When it goes to this linepast_hidden = [x[:, i:i + 1].expand(-1, beam_size, -1, -1, -1) for x in outputs]
an error occurs:TypeError: tuple indices must be integers or slices, not tuple
– and it also implies that the shape of each element in outputs should have 5 dimensions.Which corrections should be done in this case?
The text was updated successfully, but these errors were encountered: