mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2026-07-28 11:46:09 +08:00
[v1] replace custom template system with apply_chat_template (#10598)
Co-authored-by: frozenleaves <frozenleaves@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -21,7 +21,7 @@ from llamafactory.v1.samplers.cli_sampler import SyncSampler
|
||||
|
||||
@pytest.mark.runs_on(["cuda", "npu"])
|
||||
def test_sync_sampler():
|
||||
model_args = ModelArguments(model="Qwen/Qwen3-4B-Instruct-2507", template="qwen3_nothink")
|
||||
model_args = ModelArguments(model="Qwen/Qwen3-4B-Instruct-2507")
|
||||
sample_args = SampleArguments()
|
||||
model_engine = ModelEngine(model_args)
|
||||
sampler = SyncSampler(sample_args, model_args, model_engine.model, model_engine.renderer)
|
||||
@@ -31,7 +31,4 @@ def test_sync_sampler():
|
||||
response += new_text
|
||||
|
||||
print(response)
|
||||
assert model_engine.renderer.parse_message(response) == {
|
||||
"role": "assistant",
|
||||
"content": [{"type": "text", "value": "This is a test."}],
|
||||
}
|
||||
assert "This is a test." in response
|
||||
|
||||
Reference in New Issue
Block a user