From 9e89d5d3d77f9cc8476268363094f79bdbe7996e Mon Sep 17 00:00:00 2001 From: Vedant Madane <6527493+VedantMadane@users.noreply.github.com> Date: Fri, 6 Mar 2026 02:50:51 +0530 Subject: [PATCH] fix: use single-quote triple string for GBNF to avoid SyntaxError Made-with: Cursor --- unsloth/grammars.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unsloth/grammars.py b/unsloth/grammars.py index 03184d17ec..1f5ce89d0e 100644 --- a/unsloth/grammars.py +++ b/unsloth/grammars.py @@ -24,7 +24,7 @@ __all__ = [ ] # Simple JSON array grammar -JSON_ARR_GBNF = r""" +JSON_ARR_GBNF = r''' root ::= arr value ::= object | array | string | number | ("true" | "false" | "null") ws arr ::= @@ -52,7 +52,7 @@ string ::= number ::= ("-"? ([0-9] | [1-9] [0-9]*)) ("." [0-9]+)? ([eE] [-+]? [0-9]+)? ws ws ::= ([ ] ws)? -""" +''' def generate_with_grammar( model,