Skip to content

Commit 62e07e6

Browse files
authored
[HOTFIX] Raw byte string to fix invalid escape sequence (#1254)
`r'\['` is valid, `'\['` is not
1 parent 5b54226 commit 62e07e6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

guidance/models/_engine/_interpreter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def partial_decode(data: bytes) -> tuple[str, bytes]:
182182
delayed_part = data[e.start :]
183183
return (valid_part, delayed_part)
184184

185-
LLG_SPECIAL_TOKEN_PAT = re.compile(b"\xff\[([0-9]+)\]")
185+
LLG_SPECIAL_TOKEN_PAT = re.compile(br"\xff\[([0-9]+)\]")
186186
def recode_special_tokens(tokenizer: Tokenizer, data: bytes) -> bytes:
187187
"""Recode a byte string with special tokens in llguidance format to their actual byte representation."""
188188
return LLG_SPECIAL_TOKEN_PAT.sub(

0 commit comments

Comments
 (0)