microsoft / CodeXGLUE

CodeXGLUE
MIT License
1.56k stars 366 forks source link

CodeCompletion-line evaluate ERROR! #100

Closed cdj0311 closed 2 years ago

cdj0311 commented 2 years ago

hi, I get an error while running inference, the script as follow: `export CUDA_VISIBLE_DEVICES=0 LANG=python # set python for py150 DATADIR=../dataset/py150/line_completion LITFILE=../dataset/py150/literals.json OUTPUTDIR=./ LOGFILE=completion_javaCorpus_eval.log

python -u run_lm.py \ --data_dir=$DATADIR \ --lit_file=$LITFILE \ --langs=$LANG \ --output_dir=$OUTPUTDIR \ --log_file=$LOGFILE \ --model_type=gpt2 \ --block_size=1024 \ --eval_line \ --logging_steps=100 \ --seed=42`

the model is CodeGPT-small-py.

And the error :

traceback (most recent call last): File "run_lm.py", line 652, in <module> main() File "run_lm.py", line 648, in main eval_line_completion(args, model, tokenizer, file_type="test") File "run_lm.py", line 376, in eval_line_completion past_hidden = [x[:, i:i+1].expand(-1, beam_size, -1, -1, -1) for x in outputs] File "run_lm.py", line 376, in <listcomp> past_hidden = [x[:, i:i+1].expand(-1, beam_size, -1, -1, -1) for x in outputs] TypeError: tuple indices must be integers or slices, not tuple

celbree commented 2 years ago

Please refer to https://github.com/microsoft/CodeXGLUE/issues/74#issuecomment-990986297