transfer-learning-conv-ai icon indicating copy to clipboard operation
transfer-learning-conv-ai copied to clipboard

Questions about interact.py

Open GlitchBox opened this issue 3 years ago • 0 comments

Hi, Can anyone explain why the code snippet (interact.py) (underlined in red) was necessary?

Screenshot from 2022-09-15 11-58-25

As far as I know the logits returned by OpenAIGPTLMHeadModel is of the following form : (batch_size, sequence_length, vocabulary size).

Why was only the last token in the output sequence considered as the predicted next token? Moreover, why do we have to iteratively generate an output text when the model itself returns a full sequence and not just a single token?

GlitchBox avatar Sep 15 '22 06:09 GlitchBox