-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DiT now supports sequence conditions. (#923)
When using seq2seq models with DiT, the condition may have the same sequence length as the input. For example: - Input shape: `[batch, seq_len, dim]` - Condition shape: `[batch, seq_len, cond_dim]` AdaptiveLayerNormModulation now supports conditions in both `[batch, cond_dim]` and `[batch, seq_len, cond_dim]` formats. It outputs conditions in the shape `[batch, 1|seq_len, cond_dim]`, depending on whether `seq_len` is present. Accordingly, DiT has been updated to handle rank-3 conditions. The codebase has also become simpler. Previously, `jnp.expand_dims` was scattered across many places, but now `AdaptiveLayerNormModulation` adjusts the rank of the condition to match the input and returns it accordingly. Speech detokenizer will use this DiT.
- Loading branch information
Showing
2 changed files
with
113 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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
Oops, something went wrong.