Processor chat template: pass custom kwargs (#37852)

This commit is contained in:
Pedro Cuenca 2025-04-29 21:22:10 +02:00 committed by GitHub
parent 66ad8b2db0
commit c34afa5957
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1440,6 +1440,9 @@ class ProcessorMixin(PushToHubMixin):
if value is not None and not isinstance(value, dict):
processed_kwargs[kwarg_type][key] = value
# Pass unprocessed custom kwargs
processed_kwargs["template_kwargs"].update(kwargs)
if isinstance(conversation, (list, tuple)) and (
isinstance(conversation[0], (list, tuple)) or hasattr(conversation[0], "content")
):