In huggingface_models.py, if return_latent, I believe that the collection of the embeddings for the SLT is incorrect. The current code is collecting the embeddings from [-3], instead of the expected [-2], this is due to this code:
sec_last_input = hidden[n_generated - 2]
Since n_generated has already taken into account of the eos token, it should be n-generated -1
In huggingface_models.py, if return_latent, I believe that the collection of the embeddings for the SLT is incorrect. The current code is collecting the embeddings from [-3], instead of the expected [-2], this is due to this code:
sec_last_input = hidden[n_generated - 2]Since
n_generatedhas already taken into account of the eos token, it should ben-generated -1