modify condition

This commit is contained in:
luukunn
2025-08-15 21:00:24 +08:00
parent af57373cc6
commit 26430bdeb1
3 changed files with 15 additions and 30 deletions

View File

@@ -222,12 +222,9 @@ class DataProcessor(BaseDataProcessor):
task = request.to_dict()
chat_template_kwargs = kwargs.get("chat_template_kwargs")
if chat_template_kwargs:
if isinstance(chat_template_kwargs, dict):
for k, v in chat_template_kwargs.items():
if k not in task:
task[k] = v
else:
raise ValueError("Invalid input: chat_template_kwargs must be a dict")
for k, v in chat_template_kwargs.items():
if k not in task:
task[k] = v
task.setdefault("enable_thinking", True)
request.prompt_token_ids = self.messages2ids(task)
else:
@@ -280,12 +277,9 @@ class DataProcessor(BaseDataProcessor):
raise ValueError("This model does not support chat_template.")
chat_template_kwargs = request.get("chat_template_kwargs")
if chat_template_kwargs:
if isinstance(chat_template_kwargs, dict):
for k, v in chat_template_kwargs.items():
if k not in request:
request[k] = v
else:
raise ValueError("Invalid input: chat_template_kwargs must be a dict")
for k, v in chat_template_kwargs.items():
if k not in request:
request[k] = v
request.setdefault("enable_thinking", True)
request["prompt_token_ids"] = self.messages2ids(request)
else: