Skip to content

chore: update lock file #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions docling_ibm_models/code_formula_model/models/sam_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ def forward(
inputs_embeds = self.embed_tokens(input_ids)

vision_tower = getattr(self, "vision_tower", None)
im_start_token = getattr(self.config, "im_start_token", -1)
im_start_token = getattr(self.config, "im_start_token", -1) # type: ignore

if input_ids.shape[1] != 1 or self.training:
with torch.set_grad_enabled(self.training):
if input_ids.shape[1] != 1 or self.training: # type: ignore
with torch.set_grad_enabled(self.training): # type: ignore
assert vision_tower is not None
image_features = vision_tower(images)
image_features = image_features.flatten(2).permute(0, 2, 1)
Expand Down Expand Up @@ -118,7 +118,7 @@ def forward(

inputs_embeds = torch.stack(new_input_embeds, dim=0) # type: ignore

return super(SamOPTModel, self).forward(
return super(SamOPTModel, self).forward( # type: ignore
input_ids=None,
attention_mask=attention_mask,
past_key_values=past_key_values,
Expand Down Expand Up @@ -165,12 +165,12 @@ def forward(
output_attentions = (
output_attentions
if output_attentions is not None
else self.config.output_attentions
else self.config.output_attentions # type: ignore
)
output_hidden_states = (
output_hidden_states
if output_hidden_states is not None
else self.config.output_hidden_states
else self.config.output_hidden_states # type: ignore
)

outputs = self.model(
Expand Down
Loading