Skip to content

Commit 3293d47

Browse files
committed
wip
- Fix: Conditional chat_template_stage construction in legacy coercion - The logic unconditionally set `chat_template_stage` to a default dict even when no legacy fields were present. This bypassed the Field default. - Now it only constructs the stage config if legacy fields are actually detected. Signed-off-by: Nikhil Ghosh <nikhil@anyscale.com>
1 parent 4e35742 commit 3293d47

File tree

1 file changed

+6
-6
lines changed
  • python/ray/llm/_internal/batch/processor

1 file changed

+6
-6
lines changed

python/ray/llm/_internal/batch/processor/base.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,12 @@ def _coerce_legacy_to_stage_config(cls, values: Dict[str, Any]) -> Dict[str, Any
210210
"or `chat_template_stage={'enabled': True, 'chat_template': '...'}`. "
211211
"This will raise an error in a future version."
212212
)
213-
enabled_value = values.get("apply_chat_template")
214-
enabled = enabled_value if enabled_value is not None else True
215-
stage: Dict[str, Any] = {"enabled": enabled}
216-
if values.get("chat_template") is not None:
217-
stage["chat_template"] = values["chat_template"]
218-
values["chat_template_stage"] = stage
213+
enabled_value = values.get("apply_chat_template")
214+
enabled = enabled_value if enabled_value is not None else True
215+
stage: Dict[str, Any] = {"enabled": enabled}
216+
if values.get("chat_template") is not None:
217+
stage["chat_template"] = values["chat_template"]
218+
values["chat_template_stage"] = stage
219219

220220
# Other stages: simple boolean-to-stage mapping
221221
stage_mappings = [

0 commit comments

Comments
 (0)