Draft
Conversation
Keswiik
commented
Apr 10, 2025
|
|
||
| def get_item(self, variation: int, index: int, requested_name: str = None) -> dict: | ||
| if not self.add_layer_norm and self.expand_token_limit and self.expanded_chunk_size != 0: | ||
| return self.encode_text_long(variation, index, requested_name) |
Author
There was a problem hiding this comment.
Made this with SDXL in mind and I didn't see it using layer norms, so I added this as its own method to avoid possibly breaking other models.
Keswiik
commented
Apr 10, 2025
| if self.pooled_out_name: | ||
| if (hasattr(text_encoder_output, "text_embeds")): | ||
| pooled_state = text_encoder_output.text_embeds | ||
| pooled_state = pooled_state.mean(dim=0).reshape((1,pooled_state.shape[-1])) |
Author
There was a problem hiding this comment.
I have no idea if this is the right way to handle text embeddings, but results seem ok after training?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not sure how correct this implementation is, but I dropped it into my local venv and am able to run SDXL training with no issues in OneTrainer.
I've also updated the OT training tab, train config / config migration, and SDXL model loader locally and, if this is approved, will have a follow up PR to get those added too.