Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
ad5f04d6
Unverified
Commit
ad5f04d6
authored
Jun 16, 2024
by
Liangsheng Yin
Committed by
GitHub
Jun 16, 2024
Browse files
Fix the Jump-Forward with Chinese (#551)
parent
bbec01c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
python/pyproject.toml
python/pyproject.toml
+1
-1
python/sglang/srt/constrained/jump_forward.py
python/sglang/srt/constrained/jump_forward.py
+4
-2
No files found.
python/pyproject.toml
View file @
ad5f04d6
...
@@ -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.4
1
"
]
"zmq"
,
"vllm==0.5.0"
,
"interegular"
,
"pydantic"
,
"pillow"
,
"packaging"
,
"huggingface_hub"
,
"hf_transfer"
,
"outlines>=0.0.4
4
"
]
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"]
...
...
python/sglang/srt/constrained/jump_forward.py
View file @
ad5f04d6
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment