Size mismatch error in PEFT fine tuned model

A similar issue was raised previously, just in case you want to look into it (HF Forums).

The issue could be the order in which you perform token resizing and adapter loading. The code snippet you’ve shared seems to indicate that you :

  1. Load adapters from checkpoint
  2. Resize the model’s token embeddings

Try :

  1. Resize the model’s token embeddings
  2. Load adapters from checkpoint