Continue training Textual-Inversion embedding receives KeyError when filename doesn't equal embedding name.
Description Hi, experts.
Thanks a lot for your amazing works
I'm training Textual-Inversion embdding in "Train" tag. The embedding is named pseudo_token_1.
When I pause the training by pressing ^C in terminal, move the pseudo_token_1-2000.pt for 2000 step history embedding save file to root-directory/embeddings, and restart traning, it raises KeyError in textual_inversion.py:240.
Noticing that the .pt file has trailing -step, I'm suspecting its using filename for dict get, but using real embedding name for dict set. Maybe the inconsitency of token name and filename causes this issue. Would you check this out?
Yes, there is a simple work-around, just rename the .pt file.
Thanks.
To Reproduce (I think reproduction instruction is clear enough in Description section)
- Train an Textual-Inversion embedding, and stop halfway.
- Move
<token_name>-<step>.pttoroot/embeddingsdir - Restart training.
Expected behavior There should not be KeyError when expected.
Screenshots

Environments
- OS: Windows
- Browser: Chrome