Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add --keep_tokens for lora training #70

Closed
alchemzy opened this issue Jan 25, 2023 · 4 comments
Closed

Please add --keep_tokens for lora training #70

alchemzy opened this issue Jan 25, 2023 · 4 comments

Comments

@alchemzy
Copy link

To allow keeping N tokens when shuffling caption tokens

@bmaltais
Copy link
Owner

bmaltais commented Jan 27, 2023

I will add it to the next release. It is now in the dev branch.

To test it you can:

git checkout dev
git pull

To go back to the master branch:

git checkout master

@onusai
Copy link

onusai commented Jan 28, 2023

im trying to understand how this works, does tokens refer to the comma separated tags in the caption file? so keep 1 token = keep 1 tag? or does token refer to the actual token when text goes through tokenization?

for example if the first comma separated tag in my caption file is "eris greyrat" would i set this to keep_tokens 1 or 4? (according to the tokenization webui exention, "eris greyrat" is 4 tokens)
image

also what exactly does "shuffling caption tokens" mean? is it shuffling the comma separated tags in the caption file, or it is actually shuffling all the "real" tokens?

@bmaltais
Copy link
Owner

As far as I understand kohya's code the token mean everything before the coma... But I might be wrong. Better to ask kohya directly on his GitHub repo.

When shuffling captions it will shuffle words between commas... Like if you have:

Woman, high heels, background

A shuffle might be

Background, woman, high heels

@onusai
Copy link

onusai commented Jan 29, 2023

someone on discord also said a similar thing so its probably as you've described, thanks for answering :)

Cauldrath pushed a commit to Cauldrath/kohya_ss that referenced this issue Apr 5, 2023
Fix loading VAE failed in some model and with .safetensors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants