From 17899611832786971f5f532db0f0738fe1466be7 Mon Sep 17 00:00:00 2001 From: David Dobolyi <4490587+davedgd@users.noreply.github.com> Date: Fri, 16 May 2025 23:26:03 -0600 Subject: [PATCH 1/2] fix issue with qwen3 template double quote escapes --- unsloth/chat_templates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth/chat_templates.py b/unsloth/chat_templates.py index cfb3ece479..e7849092cb 100644 --- a/unsloth/chat_templates.py +++ b/unsloth/chat_templates.py @@ -1029,7 +1029,7 @@ qwen3_template = \ {{- "\n" }} {{- tool | tojson }} {%- endfor %} - {{- "\n\n\nFor each function call, return a json object with function name and arguments within XML tags:\n\n{\"name\": , \"arguments\": }\n<|im_end|>\n" }} + {{- "\n\n\nFor each function call, return a json object with function name and arguments within XML tags:\n\n{\\"name\\": , \\"arguments\\": }\n<|im_end|>\n" }} {%- else %} {%- if messages[0].role == 'system' %} {{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }} From ec938fb7e7ee26c075d4d916fbbe024e43d8f4d7 Mon Sep 17 00:00:00 2001 From: Emmanuel Ferdman Date: Sat, 17 May 2025 15:09:06 +0300 Subject: [PATCH 2/2] Display the model name in RoPE scaling unsupported error (#2564) Signed-off-by: Emmanuel Ferdman --- unsloth/models/llama.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index 207540abf5..480d22a6c5 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -1731,7 +1731,7 @@ class FastLlamaModel: except: pass has_rope_scaling = True - # If max_seq_length is not specified, use maximum fron config + # If max_seq_length is not specified, use maximum from config if max_seq_length is None: max_seq_length = model_max_seq_length pass @@ -1753,7 +1753,7 @@ class FastLlamaModel: # Warn RoPE scaling isn't allowed if not has_rope_scaling: raise RuntimeError( - "However, {model_name} doesn't support RoPE Scaling!\n"\ + f"However, {model_name} doesn't support RoPE Scaling!\n"\ "Please file a feature request at https://github.com/unslothai/unsloth." ) pass