Skip to content
Merged
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
1 change: 0 additions & 1 deletion examples/modular-transformers/configuration_new_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class NewModelConfig(PreTrainedConfig):
"layers": (["hidden_states", "attention_mask"], ["hidden_states"]),
"norm": (["hidden_states"], ["hidden_states"]),
}

vocab_size: int = 256030
hidden_size: int = 64
intermediate_size: int = 90
Expand Down
1 change: 0 additions & 1 deletion examples/modular-transformers/modeling_dummy_bert.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,6 @@ def forward(
output_attentions: bool | None = None,
output_hidden_states: bool | None = None,
return_dict: bool | None = None,
cache_position: torch.Tensor | None = None,
**kwargs: Unpack[TransformersKwargs],
) -> tuple[torch.Tensor] | BaseModelOutputWithPoolingAndCrossAttentions:
if (input_ids is None) ^ (inputs_embeds is not None):
Expand Down
2 changes: 0 additions & 2 deletions examples/modular-transformers/modeling_new_task_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ def forward(
position_ids: torch.LongTensor | None = None,
past_key_values: Cache | None = None,
token_type_ids: torch.LongTensor | None = None,
cache_position: torch.LongTensor | None = None,
inputs_embeds: torch.FloatTensor | None = None,
labels: torch.LongTensor | None = None,
use_cache: bool | None = None,
Expand All @@ -439,7 +438,6 @@ def forward(
position_ids=position_ids,
past_key_values=past_key_values,
token_type_ids=token_type_ids,
cache_position=cache_position,
inputs_embeds=inputs_embeds,
labels=labels,
use_cache=use_cache,
Expand Down
2 changes: 0 additions & 2 deletions examples/modular-transformers/modeling_super.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ def forward(
output_attentions: bool | None = None,
output_hidden_states: bool | None = None,
return_dict: bool | None = None,
cache_position: torch.LongTensor | None = None,
) -> tuple | CausalLMOutputWithPast:
out = super().forward(
input_ids,
Expand All @@ -371,7 +370,6 @@ def forward(
output_attentions,
output_hidden_states,
return_dict,
cache_position,
)
out.logits *= 2**4
return out
1 change: 0 additions & 1 deletion examples/modular-transformers/modular_dummy_bert.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def forward(
output_attentions: bool | None = None,
output_hidden_states: bool | None = None,
return_dict: bool | None = None,
cache_position: torch.Tensor | None = None,
**kwargs: Unpack[TransformersKwargs],
) -> tuple[torch.Tensor] | BaseModelOutputWithPoolingAndCrossAttentions:
return super().forward(input_ids, **kwargs)
2 changes: 0 additions & 2 deletions examples/modular-transformers/modular_new_task_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def forward(
position_ids: torch.LongTensor | None = None,
past_key_values: Cache | None = None,
token_type_ids: torch.LongTensor | None = None,
cache_position: torch.LongTensor | None = None,
inputs_embeds: torch.FloatTensor | None = None,
labels: torch.LongTensor | None = None,
use_cache: bool | None = None,
Expand All @@ -47,7 +46,6 @@ def forward(
position_ids=position_ids,
past_key_values=past_key_values,
token_type_ids=token_type_ids,
cache_position=cache_position,
inputs_embeds=inputs_embeds,
labels=labels,
use_cache=use_cache,
Expand Down
2 changes: 0 additions & 2 deletions examples/modular-transformers/modular_super.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def forward(
output_attentions: bool | None = None,
output_hidden_states: bool | None = None,
return_dict: bool | None = None,
cache_position: torch.LongTensor | None = None,
) -> tuple | CausalLMOutputWithPast:
out = super().forward(
input_ids,
Expand All @@ -31,7 +30,6 @@ def forward(
output_attentions,
output_hidden_states,
return_dict,
cache_position,
)
out.logits *= 2**4
return out
Loading