Difference between loading embeddings via src_embeddings and pre_word_vecs_enc

my question is just the title! I was a bit unsure (in the case of translation uniquely) if there is any difference between the two.

Good question. That’s indeed not very straightforward.

  1. {src,tgt}_embeddings is a ‘raw’ embeddings lookup table (e.g. glove as in this example
  2. pre_word_vecs_{enc,dec} is a ‘prepared’ embeddings based on vocab (e.g. prepared with embeddings_to_torch.py.

(1.) is the “new” way introduced with OpenNMT-py 2.0
(2.) is the “legacy” way (FAQ (Legacy version) — OpenNMT-py documentation) that we kept for backcompatibility

Hope this helps!

got it! thank you for clarifying :slight_smile: