trl icon indicating copy to clipboard operation
trl copied to clipboard

Key Error in Notebook '04-gpt2-sentiment-ppo-training.ipynb'

Open philn21 opened this issue 3 years ago • 0 comments

Hi Leandro,

I was running the notebook '04-gpt2-sentiment-ppo-training.ipynb' for the first time, and received a Key Error when running the training loop section. It was in this line:

rewards = torch.tensor([output[1]["score"] for output in pipe_outputs]).to(device)

I presume it is safe to omit the '[1]'? rewards = torch.tensor([output["score"] for output in pipe_outputs]).to(device)

Thanks in advance and best, Philip

philn21 avatar Jun 20 '22 19:06 philn21