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

Support for Token Lengths Exceeding 75 Tokens in Text Encoder #450

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

celll1
Copy link

@celll1 celll1 commented Sep 3, 2024

Description:
This pull request introduces modifications to the Text Encoder to support input token lengths exceeding 75 tokens, specifically up to 3 chunks. The implementation has been confirmed to work with SDXL LoRA.

Key Changes:

  • BOS/EOS tokens are now inserted every 75 tokens.
  • An attention mask is applied to the intermediate special tokens.

Notes:

  • Please note that the handling of BOS/EOS tokens differs from the current implementation in sd-scripts.
  • I am uncertain whether applying the attention mask in this manner is the correct approach, and I welcome any feedback or suggestions for improvement.

Additional Private Modifications:
This PR also includes the following personal changes:

  • Support for Adam-mini optimizer.
  • Modifications to tqdm for use in Jupyter notebooks.
  • Support for Hugging Face accelerator (distributed training has not yet been tested).
    Please note that due to these changes, the diffusers package needs to be updated to version 0.30.0 or later to enable resumption from a backup, as the model is sharded during backup.

I hope you find the necessary parts of this PR useful.

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

Successfully merging this pull request may close these issues.

1 participant