Skip to content

Commit

Permalink
stash commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocketknight1 committed Jun 7, 2024
1 parent 9ae5264 commit e844dd3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/transformers/models/idefics2/processing_idefics2.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Idefics2Processor(ProcessorMixin):
image_processor_class = "Idefics2ImageProcessor"
tokenizer_class = "AutoTokenizer"

def __init__(self, image_processor, tokenizer=None, image_seq_len: int = 64, **kwargs):
def __init__(self, image_processor, tokenizer=None, image_seq_len: int = 64, chat_template: str = None, **kwargs):
if image_processor is None:
raise ValueError("You need to specify an `image_processor`.")
if tokenizer is None:
Expand All @@ -72,6 +72,7 @@ def __init__(self, image_processor, tokenizer=None, image_seq_len: int = 64, **k
self.image_token = AddedToken("<image>", normalized=False, special=True)
self.end_of_utterance_token = AddedToken("<end_of_utterance>", normalized=False, special=True)
self.image_seq_len = image_seq_len
self.chat_template = chat_template

tokens_to_add = {
"additional_special_tokens": [self.fake_image_token, self.image_token, self.end_of_utterance_token]
Expand Down

0 comments on commit e844dd3

Please sign in to comment.