Skip to content

Commit bc92d57

Browse files
Test that the stored Phi-4, SmolLM2 and DeepSeek-V3 chat templates do not support tool calling (#8570)
1 parent 6370224 commit bc92d57

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎tests/test_chat_template_utils.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,13 @@ def test_supports_tool_calling(self, model_id):
12371237
),
12381238
pytest.param("trl-internal-testing/tiny-Phi3ForCausalLM-3", id="phi3"),
12391239
pytest.param("trl-internal-testing/tiny-Phi3ForCausalLM-3.5", id="phi3.5"),
1240+
# The Phi-4 templates never read `tool_calls`
1241+
pytest.param(("trl-internal-testing/tiny-Qwen2ForCausalLM-2.5", phi4_chat_template), id="phi4"),
1242+
pytest.param(("trl-internal-testing/tiny-Phi3ForCausalLM-3", phi4_mini_chat_template), id="phi4-mini"),
1243+
pytest.param(
1244+
("trl-internal-testing/tiny-Phi3ForCausalLM-3", phi4_mini_reasoning_chat_template),
1245+
id="phi4-mini-reasoning",
1246+
),
12401247
# Renders tool message content as plain text but drops assistant tool_calls
12411248
pytest.param("trl-internal-testing/tiny-LlamaForCausalLM-3", id="llama3"),
12421249
pytest.param("trl-internal-testing/tiny-GraniteMoeForCausalLM", id="granitemoe"),
@@ -1253,6 +1260,12 @@ def test_supports_tool_calling(self, model_id):
12531260
("trl-internal-testing/tiny-Qwen2ForCausalLM-R1-Distill", deepseek_r1_distill_v2_chat_template),
12541261
id="r1_distill_v2",
12551262
),
1263+
# Same `tool_calls` rendering as DeepSeek-R1-Distill
1264+
pytest.param(
1265+
("trl-internal-testing/tiny-DeepseekV3ForCausalLM", deepseekv3_v3_chat_template), id="deepseek-v3-v3"
1266+
),
1267+
# SmolLM2 never reads `tool_calls`
1268+
pytest.param(("trl-internal-testing/tiny-Qwen2ForCausalLM-2.5", smollm2_chat_template), id="smollm2"),
12561269
pytest.param("trl-internal-testing/tiny-Qwen2VLForConditionalGeneration", id="qwen2_vl"),
12571270
pytest.param("trl-internal-testing/tiny-Qwen2_5_VLForConditionalGeneration", id="qwen2.5_vl"),
12581271
],

0 commit comments

Comments
 (0)