Skip to content

AttributeError: 'CenturioProcessor' object has no attribute 'chat_template' #1

@kabinh07

Description

@kabinh07
text = processor.apply_chat_template(
    messages,
    chat_template=None,
    tokenize=False,
    add_generation_prompt=True
)

ERROR:

AttributeError Traceback (most recent call last)
Cell In[19], line 1
----> 1 text = processor.apply_chat_template(
2 messages,
3 chat_template=None,
4 tokenize=False,
5 add_generation_prompt=True
6 )

File ~/work/.virtualenvs/transformers_env/lib/python3.11/site-packages/transformers/utils/deprecation.py:172, in deprecate_kwarg..wrapper..wrapped_func(*args, **kwargs)
168 elif minimum_action in (Action.NOTIFY, Action.NOTIFY_ALWAYS) and not is_torchdynamo_compiling():
169 # DeprecationWarning is ignored by default, so we use FutureWarning instead
170 warnings.warn(message, FutureWarning, stacklevel=2)
--> 172 return func(*args, **kwargs)

File ~/work/.virtualenvs/transformers_env/lib/python3.11/site-packages/transformers/processing_utils.py:1504, in ProcessorMixin.apply_chat_template(self, conversation, chat_template, **kwargs)
1478 """
1479 Similar to the apply_chat_template method on tokenizers, this method applies a Jinja template to input
1480 conversations to turn them into a single tokenizable string.
(...) 1501 chat template is used.
1502 """
1503 if chat_template is None:
-> 1504 if isinstance(self.chat_template, dict) and "default" in self.chat_template:
1505 chat_template = self.chat_template["default"]
1506 elif isinstance(self.chat_template, dict):

AttributeError: 'CenturioProcessor' object has no attribute 'chat_template'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions