Skip to content

Commit

Permalink
Add context length attr to CoCa models (#699)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielilharco authored Oct 24, 2023
1 parent e850caa commit 4db1f41
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/open_clip/coca_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ def __init__(
self.logit_scale = nn.Parameter(torch.ones([]) * np.log(1 / 0.07))
self.pad_id = pad_id

self.context_length = multimodal_cfg.context_length

@torch.jit.ignore
def set_grad_checkpointing(self, enable: bool = True):
self.visual.set_grad_checkpointing(enable)
Expand Down

0 comments on commit 4db1f41

Please sign in to comment.