Skip to content

Commit

Permalink
fix training issues (#36158)
Browse files Browse the repository at this point in the history
* fix training issues

* Update

Co-authored-by: Marc Sun <57196510+SunMarc@users.noreply.github.com>

---------

Co-authored-by: Marc Sun <57196510+SunMarc@users.noreply.github.com>
  • Loading branch information
ArthurZucker and SunMarc authored Feb 13, 2025
1 parent 845b0a2 commit 0ca7259
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class PaliGemmaConfig(PretrainedConfig):

model_type = "paligemma"
sub_configs = {"text_config": AutoConfig, "vision_config": AutoConfig}
keys_to_ignore_at_inference = ["past_key_values"]

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4477,7 +4477,7 @@ def prediction_step(
inputs = self._prepare_inputs(inputs)
if ignore_keys is None:
if hasattr(self.model, "config"):
ignore_keys = getattr(self.model.config, "keys_to_ignore_at_inference", [])
ignore_keys = getattr(self.model.config, "keys_to_ignore_at_inference", ["past_key_values"])
else:
ignore_keys = []

Expand Down

0 comments on commit 0ca7259

Please sign in to comment.