changing Encoder's embedding table in MarianEncoder
Hi,
i am trying to change the Encoder's (MarianEncoder) embedding table (self.embed_tokens) during inference.
i tried adding the following lines 

num_tokens, embedding_dim = self.embed_tokens.weight.size()
new_embeddings = nn.Embedding(num_tokens, embedding_dim)
new_embeddings.to(self.embed_tokens.weight.device, dtype=self.embed_tokens.weight.dtype)
self._init_weights(new_embeddings)
new_embeddings.weight.data = Parameter(torch.rand(num_tokens, embedding_dim))
self.set_input_embeddings(new_embeddings)


to MarianEncoder init funcrition
i expect the Bleu of the translations to decrease since i replaced the embedding table with random matrix
but it seems that it doesn't affect the results

can someone explain to me how to change the embedding table?
thanks,
Bar
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.