Repository navigation
Normalize text-file captions before training cache lookups - #3262
Merged
Merged
Conversation
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.
Text-file captions with surrounding whitespace are stripped during precaching but used verbatim during training. The resulting hash mismatch aborts training with a missing text embedding cache file; the filename-only fix in #3244 does not cover this path.
Reuse the existing caption normalization and shape restoration helpers when reading text-file captions. Single captions remain strings and multiline captions remain lists.
Validation:
.venv/bin/python -m unittest -v -f tests.test_prompthandler: 13 passed. The regression verifies precache/training agreement for Unicode, bytes/CRLF, blank multiline entries, disabled newline splitting, and instance-prompt prefixes; all five cases fail on main.TORCHINDUCTOR_CPP_CACHE_PRECOMPILE_HEADERS=0to avoid a stale Inductor header cache.Closes #3251.
Additional validation on a Linux H100 host with CUDA PyTorch 2.11.0+cu128: all 13 focused caption tests passed.