Unverified Commit ad5f04d6 authored by Liangsheng Yin's avatar Liangsheng Yin Committed by GitHub
Browse files

Fix the Jump-Forward with Chinese (#551)

parent bbec01c9
...@@ -21,7 +21,7 @@ dependencies = [ ...@@ -21,7 +21,7 @@ dependencies = [
[project.optional-dependencies] [project.optional-dependencies]
srt = ["aiohttp", "fastapi", "psutil", "rpyc", "torch", "uvloop", "uvicorn", srt = ["aiohttp", "fastapi", "psutil", "rpyc", "torch", "uvloop", "uvicorn",
"zmq", "vllm==0.5.0", "interegular", "pydantic", "pillow", "packaging", "huggingface_hub", "hf_transfer", "outlines>=0.0.41"] "zmq", "vllm==0.5.0", "interegular", "pydantic", "pillow", "packaging", "huggingface_hub", "hf_transfer", "outlines>=0.0.44"]
openai = ["openai>=1.0", "tiktoken"] openai = ["openai>=1.0", "tiktoken"]
anthropic = ["anthropic>=0.20.0"] anthropic = ["anthropic>=0.20.0"]
litellm = ["litellm>=1.0.0"] litellm = ["litellm>=1.0.0"]
......
...@@ -81,8 +81,10 @@ class JumpForwardMap: ...@@ -81,8 +81,10 @@ class JumpForwardMap:
if len(c) == 1 and ord(c) < 0x80: if len(c) == 1 and ord(c) < 0x80:
# ASCII character # ASCII character
byte_ = ord(c) byte_ = ord(c)
elif len(c) == 2: elif len(c) > 1:
byte_ = int(symbols[0], 16) # FIXME: This logic is due to the leading \x00
# https://github.com/outlines-dev/outlines/pull/930
byte_ = int(symbols[0][1:], 16)
if byte_ is not None: if byte_ is not None:
outgoings_ct[state] += 1 outgoings_ct[state] += 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment