Skip to content

Commit 6108c54

Browse files
authored
directly passed save_jinja_files=False in the save_pretrained parameter
Added save_jinja_files parameter to save_pretrained method.
1 parent 6d767f8 commit 6108c54

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/transformers/processing_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ def __repr__(self):
748748
attributes_repr = "\n".join(attributes_repr)
749749
return f"{self.__class__.__name__}:\n{attributes_repr}\n\n{self.to_json_string()}"
750750

751-
def save_pretrained(self, save_directory, push_to_hub: bool = False, **kwargs):
751+
def save_pretrained(self, save_directory, push_to_hub: bool = False, save_jinja_files=False, **kwargs):
752752
"""
753753
Saves the attributes of this processor (feature extractor, tokenizer...) in the specified directory so that it
754754
can be reloaded using the [`~ProcessorMixin.from_pretrained`] method.
@@ -786,7 +786,9 @@ def save_pretrained(self, save_directory, push_to_hub: bool = False, **kwargs):
786786
configs = [(a.init_kwargs if isinstance(a, PreTrainedTokenizerBase) else a) for a in attrs]
787787
configs.append(self)
788788
custom_object_save(self, save_directory, config=configs)
789-
789+
790+
# also fetch it from kwargs
791+
# save_jinja_files = kwargs.pop("save_jinja_files", False)
790792
for attribute_name in self.attributes:
791793
attribute = getattr(self, attribute_name)
792794

0 commit comments

Comments
 (0)