Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/ltx-trainer/src/ltx_trainer/timestep_samplers.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ def _get_shift_for_sequence_length(
min_shift: float = 0.95,
max_shift: float = 2.05,
) -> float:
# Without this cap, very large seq_length drives mu up, both percentile bounds
# saturate near 1.0, and zero_terminal_raw divides by ~0 → NaN.
if seq_length > max_tokens:
seq_length = max_tokens
# Calculate the shift value for a given sequence length using linear interpolation
# between min_shift and max_shift based on sequence length.
m = (max_shift - min_shift) / (max_tokens - min_tokens) # Calculate slope
Expand Down