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
3c1f5a92
Unverified
Commit
3c1f5a92
authored
Aug 17, 2024
by
Lianmin Zheng
Committed by
GitHub
Aug 17, 2024
Browse files
Fix duplicated imports in hf_transformers_utils.py (#1141)
parent
57d0bd91
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
14 deletions
+9
-14
python/sglang/bench_serving.py
python/sglang/bench_serving.py
+4
-4
python/sglang/srt/hf_transformers_utils.py
python/sglang/srt/hf_transformers_utils.py
+0
-5
python/sglang/test/test_utils.py
python/sglang/test/test_utils.py
+5
-5
No files found.
python/sglang/bench_serving.py
View file @
3c1f5a92
...
...
@@ -222,7 +222,7 @@ async def async_request_openai_completions(
return
output
async
def
async_request_g
inf
er
(
async
def
async_request_g
serv
er
(
request_func_input
:
RequestFuncInput
,
pbar
:
Optional
[
tqdm
]
=
None
,
)
->
RequestFuncOutput
:
...
...
@@ -268,7 +268,7 @@ ASYNC_REQUEST_FUNCS = {
"vllm"
:
async_request_openai_completions
,
"lmdeploy"
:
async_request_openai_completions
,
"trt"
:
async_request_trt_llm
,
"g
inf
er"
:
async_request_g
inf
er
,
"g
serv
er"
:
async_request_g
serv
er
,
}
...
...
@@ -790,7 +790,7 @@ def run_benchmark(args_: argparse.Namespace):
"lmdeploy"
:
23333
,
"vllm"
:
8000
,
"trt"
:
8000
,
"g
inf
er"
:
9988
,
"g
serv
er"
:
9988
,
}.
get
(
args
.
backend
,
30000
)
api_url
=
(
...
...
@@ -813,7 +813,7 @@ def run_benchmark(args_: argparse.Namespace):
if
args
.
model
is
None
:
print
(
"Please provide a model using `--model` when using `trt` backend."
)
sys
.
exit
(
1
)
elif
args
.
backend
==
"g
inf
er"
:
elif
args
.
backend
==
"g
serv
er"
:
api_url
=
args
.
base_url
if
args
.
base_url
else
f
"
{
args
.
host
}
:
{
args
.
port
}
"
args
.
model
=
args
.
model
or
"default"
...
...
python/sglang/srt/hf_transformers_utils.py
View file @
3c1f5a92
...
...
@@ -44,11 +44,6 @@ except ImportError:
from
sglang.srt.utils
import
is_multimodal_model
_CONFIG_REGISTRY
:
Dict
[
str
,
Type
[
PretrainedConfig
]]
=
{
ChatGLMConfig
.
model_type
:
ChatGLMConfig
,
DbrxConfig
.
model_type
:
DbrxConfig
,
}
def
download_from_hf
(
model_path
:
str
):
if
os
.
path
.
exists
(
model_path
):
...
...
python/sglang/test/test_utils.py
View file @
3c1f5a92
...
...
@@ -112,7 +112,7 @@ def call_generate_srt_raw(prompt, temperature, max_tokens, stop=None, url=None):
return
pred
def
call_generate_g
inf
er
(
prompt
,
temperature
,
max_tokens
,
stop
=
None
,
url
=
None
):
def
call_generate_g
serv
er
(
prompt
,
temperature
,
max_tokens
,
stop
=
None
,
url
=
None
):
raise
NotImplementedError
()
...
...
@@ -256,7 +256,7 @@ def add_common_other_args_and_parse(parser: argparse.ArgumentParser):
"vllm"
,
"outlines"
,
"lightllm"
,
"g
inf
er"
,
"g
serv
er"
,
"guidance"
,
"lmql"
,
"srt-raw"
,
...
...
@@ -277,7 +277,7 @@ def add_common_other_args_and_parse(parser: argparse.ArgumentParser):
"lightllm"
:
22000
,
"lmql"
:
23000
,
"srt-raw"
:
30000
,
"g
inf
er"
:
9988
,
"g
serv
er"
:
9988
,
}
args
.
port
=
default_port
.
get
(
args
.
backend
,
None
)
return
args
...
...
@@ -313,8 +313,8 @@ def _get_call_generate(args: argparse.Namespace):
return
partial
(
call_generate_vllm
,
url
=
f
"
{
args
.
host
}
:
{
args
.
port
}
/generate"
)
elif
args
.
backend
==
"srt-raw"
:
return
partial
(
call_generate_srt_raw
,
url
=
f
"
{
args
.
host
}
:
{
args
.
port
}
/generate"
)
elif
args
.
backend
==
"g
inf
er"
:
return
partial
(
call_generate_g
inf
er
,
url
=
f
"
{
args
.
host
}
:
{
args
.
port
}
"
)
elif
args
.
backend
==
"g
serv
er"
:
return
partial
(
call_generate_g
serv
er
,
url
=
f
"
{
args
.
host
}
:
{
args
.
port
}
"
)
elif
args
.
backend
==
"outlines"
:
return
partial
(
call_generate_outlines
,
url
=
f
"
{
args
.
host
}
:
{
args
.
port
}
/generate"
)
elif
args
.
backend
==
"guidance"
:
...
...
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