Skip to content

Commit 935e532

Browse files
authored
Update _internals.py
Fixing to compare to b' ' instead of (str)' '
1 parent 239200a commit 935e532

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llama_cpp/_internals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def detokenize(self, tokens: List[int], special: bool = False) -> bytes:
201201
# NOTE: Llama1 models automatically added a space at the start of the prompt
202202
# this line removes a leading space if the first token is a beginning of sentence token
203203
return (
204-
output[1:] if len(tokens) > 0 and tokens[0] == self.token_bos() and output[0:1] == ' ' else output
204+
output[1:] if len(tokens) > 0 and tokens[0] == self.token_bos() and output[0:1] == b' ' else output
205205
)
206206

207207
# Extra

0 commit comments

Comments
 (0)