Solved by nielsr in post #4 
              
              
                Update: it works for me when overriding the _update_model_kwargs_for_generation method. The token_type_ids shouldn’t be updated, as a table only needs to get encoded once. 
Notebook: Google Colab