Skip to content

Fix instruction text placeholder replacement#142

Open
LuXcDD wants to merge 1 commit into
opendilab:mainfrom
LuXcDD:fix/instruction-text-replace
Open

Fix instruction text placeholder replacement#142
LuXcDD wants to merge 1 commit into
opendilab:mainfrom
LuXcDD:fix/instruction-text-replace

Conversation

@LuXcDD
Copy link
Copy Markdown

@LuXcDD LuXcDD commented May 3, 2026

Summary

This PR fixes a bug in CarlaVoiceDataset where instruction placeholders were not actually replaced in instruction_text.

The previous code called str.replace(...) without assigning the returned string back to instruction_text. Since Python strings are immutable, placeholders such as [x], left/right, and [y] remained unchanged.

Changes

  • Assign the result of instruction_text.replace(...) back to instruction_text
  • Preserve the existing placeholder handling logic and exception flow

Why this matters

This ensures generated instruction text correctly reflects values from info['instruction_args'] instead of leaving template placeholders in the final string.

Testing

  • Verified the replacement logic now updates instruction_text as intended
  • No additional tests were run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant