Skip to content

Commit

Permalink
fix skip condition (#1956)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-vi authored Mar 10, 2025
1 parent 9c59263 commit 567e256
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion litgpt/generate/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def generate_fn(
input_pos = torch.arange(0, prompt_size, device=device, dtype=torch.int64)
# input_pos_maxp1 introduces data-dependent shapes and control flow.
# We want to skip if ThunderModules are involved, either directly or wrapped in LightningModule etc.
if any(m.__class__.__name__ != 'ThunderModule' for m in model.modules()):
if not any(m.__class__.__name__ == 'ThunderModule' for m in model.modules()):
input_pos_maxp1 = torch.tensor(prompt_size, device=device)
else:
input_pos_maxp1 = None
Expand Down

0 comments on commit 567e256

Please sign in to comment.