controlled-text-generation icon indicating copy to clipboard operation
controlled-text-generation copied to clipboard

How to handle inputs with variable length

Open JianboGuo opened this issue 7 years ago • 1 comments

Hi @wiseodd, thanks for your open-source code. I find the forward_encoder_embed function in the model.py module cannot support inputs with variable length. In your code, it seems that you assume that each of the input sentences is of length max_sent_len 15, as you alway use the last hidden state to encode the paded sentence.

JianboGuo avatar Sep 24 '18 14:09 JianboGuo

Hi @wiseodd, thanks for your open-source code. I find the forward_encoder_embed function in the model.py module cannot support inputs with variable length. In your code, it seems that you assume that each of the input sentences is of length max_sent_len 15, as you alway use the last hidden state to encode the paded sentence.

Hi! Have you figured out how to handle inputs with variable length? I run into the same problem.

ZiweiG avatar Dec 22 '20 05:12 ZiweiG