Using .generate with TAPAS as encoder in EncoderDecoder
Hi,I’m trying to to train the model to perform text generation conditioned on tables.Since TAPAS can encode the semi-structured meaning in tables, I guessed it was a good choice to use it as an encoder and say GPT2 (or any other CLM) as a decoder.I however encountered a problem when trying to generate from that EncoderDecoder model, this:image597×651 195 KBI guess this is since model.generate() for EncoderDecoder does not expect to have the extra dimension of token_type_ids that TAPAS has.Can anyone think of a way I can make this work?Thanks!
2022-01-17T14:04:11Z
Hi, does anyone know?@NielsRogge?
2022-01-17T15:03:24Z
Hi,I’ll investigate and get back to you.
2022-01-17T16:02:07Z
Update: it works for me when overriding the_update_model_kwargs_for_generationmethod. Thetoken_type_idsshouldn’t be updated, as a table only needs to get encoded once.Notebook:Google Colab
2022-01-18T17:22:50Z
It works for me!I’ll now go ahead and try to train it for conditional generation.Thanks!