Fix 2-byte UTF8 decoding

This commit is contained in:
turboderp
2023-11-10 21:00:29 +01:00
parent b302e310c8
commit 7785bd4efe

View File

@@ -220,6 +220,7 @@ class ExLlamaV2StreamingGenerator(ExLlamaV2BaseGenerator):
b = id_to_ord[t]
if 0 < b < 256:
if b & 0b1100000 == 0b1000000: self.expect_utf8 = 2
if b & 0b1110000 == 0b1100000: self.expect_utf8 = 3
if b & 0b1111000 == 0b1110000: self.expect_utf8 = 4
if b & 0b1111100 == 0b1111000: self.expect_utf8 = 5