diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

ValueError: The tokenizer already contains the token ... Please pass a different `placeholder_token` that is not already in the tokenizer.

Open OzzyD opened this issue 3 years ago • 3 comments

Just a quick question regarding tokens:

I have a model trained on a new token and wish to add more detail and add extra run cycles to it. I get the above advice/error

How do I go about fixing this issue, or am I best to retrain from scratch?

OzzyD avatar Oct 30 '22 12:10 OzzyD

Hey @OzzyD,

Could you post a reproducible code snippet as well as your environment information? :-)

patrickvonplaten avatar Nov 02 '22 13:11 patrickvonplaten

@OzzyD I assume you are running https://github.com/huggingface/diffusers/blob/main/examples/textual_inversion/textual_inversion.py (or the Colab notebook with mostly the same code.) You can just comment out that check, although in that case you should also comment out token_embeds[placeholder_token_id] = token_embeds[initializer_token_id] as this would essentially restart the training from scratch anyway.

Kenoubi avatar Nov 02 '22 20:11 Kenoubi

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 are likely to be ignored.

github-actions[bot] avatar Nov 29 '22 15:11 github-actions[bot]