[Bugfix][Frontend] Honor the constructor chat template in offline scoring (#61990)
Signed-off-by: mottopanikeiku <176798723+mottopanikeiku@users.noreply.github.com> Co-authored-by: mottopanikeiku <176798723+mottopanikeiku@users.noreply.github.com>
This commit is contained in:
@@ -325,8 +325,8 @@ class PoolingOfflineMixin(OfflineInferenceMixin):
|
||||
it is used to create the progress bar.
|
||||
If `False`, no progress bar is created.
|
||||
lora_request: LoRA request to use for generation, if any.
|
||||
chat_template: The chat template to use for the scoring. If None, we
|
||||
use the model's default chat template.
|
||||
chat_template: The chat template to use for scoring. If None, use
|
||||
the chat template passed to the LLM constructor.
|
||||
tokenization_kwargs: Overrides for `tokenizer.encode`.
|
||||
|
||||
Returns:
|
||||
|
||||
@@ -548,7 +548,11 @@ class CrossEncoderIOProcessor(ScoringIOProcessor):
|
||||
yield ScoringRenderParams(
|
||||
data_1=data_1[i],
|
||||
data_2=data_2[i],
|
||||
chat_template=ctx.chat_template,
|
||||
chat_template=(
|
||||
self.chat_template
|
||||
if ctx.chat_template is None
|
||||
else ctx.chat_template
|
||||
),
|
||||
max_tokens_per_query=max_tokens_per_query,
|
||||
max_tokens_per_doc=max_tokens_per_doc,
|
||||
tok_params=tok_params,
|
||||
|
||||
Reference in New Issue
Block a user