Skip to content

Commit

Permalink
Add sample batch size for Lumina
Browse files Browse the repository at this point in the history
  • Loading branch information
rockerBOO committed Feb 24, 2025
1 parent ba725a8 commit 48e7da2
Show file tree
Hide file tree
Showing 3 changed files with 199 additions and 104 deletions.
6 changes: 3 additions & 3 deletions library/lumina_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,8 +880,8 @@ def __init__(
self.n_heads = n_heads

self.gradient_checkpointing = False
self.cpu_offload_checkpointing = False
self.blocks_to_swap = None
self.cpu_offload_checkpointing = False # TODO: not yet supported
self.blocks_to_swap = None # TODO: not yet supported

@property
def device(self):
Expand Down Expand Up @@ -982,8 +982,8 @@ def patchify_and_embed(

l_effective_cap_len = cap_mask.sum(dim=1).tolist()
encoder_seq_len = cap_mask.shape[1]

image_seq_len = (height // self.patch_size) * (width // self.patch_size)

seq_lengths = [cap_seq_len + image_seq_len for cap_seq_len in l_effective_cap_len]
max_seq_len = max(seq_lengths)

Expand Down
Loading

0 comments on commit 48e7da2

Please sign in to comment.