Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tests/test_align/test_template/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,18 @@ def test_qwen2_5_math_reward():
'are left to be sold:\n\\[ 16 - 7 = 9 \\text{ eggs} \\]\n\nFinally, we calculate the revenue from '
'selling the remaining eggs at $2 per egg:\n\\[ 9 \\times 2 = 18 \\text{ dollars} \\]\n\nTherefore, '
"Janet makes \\(\\boxed{18}\\) dollars every day at the farmers' market."
}, {
'role': 'user',
'content': 'Explain your answer step by step.'
}]
})
res = template.encode(inputs)
template.print_inputs(res)
template.template_backend = 'jinja'
res2 = template.encode(inputs)
template.print_inputs(res)
template.print_inputs(res2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This change corrects a bug where the result of the first encoding (res) was being printed instead of the result from the jinja-backend encoding (res2). This ensures the debug output is accurate when comparing the two encoding methods.

assert res['input_ids'] == res2['input_ids']
assert len(res['input_ids']) == 364
assert len(res['input_ids']) == 380


def test_minimax():
Expand Down
Loading