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
c70b3cfa
Unverified
Commit
c70b3cfa
authored
Jan 24, 2024
by
Lianmin Zheng
Committed by
GitHub
Jan 24, 2024
Browse files
Bump the version to v0.1.8 (#93)
parent
489796c7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
8 deletions
+19
-8
python/pyproject.toml
python/pyproject.toml
+1
-1
python/sglang/__init__.py
python/sglang/__init__.py
+1
-1
python/sglang/srt/managers/tokenizer_manager.py
python/sglang/srt/managers/tokenizer_manager.py
+14
-4
python/sglang/srt/server.py
python/sglang/srt/server.py
+3
-2
No files found.
python/pyproject.toml
View file @
c70b3cfa
...
...
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name
=
"sglang"
version
=
"0.1.
7
"
version
=
"0.1.
8
"
description
=
"A structured generation langauge for LLMs."
readme
=
"README.md"
requires-python
=
">=3.8"
...
...
python/sglang/__init__.py
View file @
c70b3cfa
__version__
=
"0.1.
7
"
__version__
=
"0.1.
8
"
from
sglang.api
import
*
from
sglang.global_config
import
global_config
python/sglang/srt/managers/tokenizer_manager.py
View file @
c70b3cfa
...
...
@@ -50,7 +50,9 @@ def init_global_processor(server_args: ServerArgs):
)
def
get_pixel_values
(
image_data
,
image_aspect_ratio
=
None
,
image_grid_pinpoints
=
None
,
processor
=
None
):
def
get_pixel_values
(
image_data
,
image_aspect_ratio
=
None
,
image_grid_pinpoints
=
None
,
processor
=
None
):
try
:
processor
=
processor
or
global_processor
image
=
load_image
(
image_data
)
...
...
@@ -117,14 +119,22 @@ class TokenizerManager:
async
def
get_pixel_values
(
self
,
image_data
):
aspect_ratio
=
getattr
(
self
.
hf_config
,
"image_aspect_ratio"
,
None
)
grid_pinpoints
=
self
.
hf_config
.
image_grid_pinpoints
if
aspect_ratio
==
"anyres"
else
None
grid_pinpoints
=
(
self
.
hf_config
.
image_grid_pinpoints
if
aspect_ratio
==
"anyres"
else
None
)
if
self
.
executor
is
not
None
:
loop
=
asyncio
.
get_event_loop
()
return
await
loop
.
run_in_executor
(
self
.
executor
,
get_pixel_values
,
image_data
,
aspect_ratio
,
grid_pinpoints
self
.
executor
,
get_pixel_values
,
image_data
,
aspect_ratio
,
grid_pinpoints
,
)
else
:
return
get_pixel_values
(
image_data
,
aspect_ratio
,
grid_pinpoints
,
self
.
processor
)
return
get_pixel_values
(
image_data
,
aspect_ratio
,
grid_pinpoints
,
self
.
processor
)
async
def
generate_request
(
self
,
obj
:
GenerateReqInput
):
if
self
.
to_create_loop
:
...
...
python/sglang/srt/server.py
View file @
c70b3cfa
...
...
@@ -380,12 +380,13 @@ def launch_server(server_args, pipe_finish_writer):
success
=
False
for
i
in
range
(
60
):
time
.
sleep
(
1
)
try
:
res
=
requests
.
get
(
url
+
"/get_model_info"
,
timeout
=
5
)
success
=
True
break
except
requests
.
exceptions
.
RequestException
as
e
:
time
.
sleep
(
1
)
pass
if
success
:
pipe_finish_writer
.
send
(
"init ok"
)
...
...
@@ -406,7 +407,7 @@ class Runtime:
model_mode
:
List
[
str
]
=
(),
schedule_heuristic
:
str
=
"lpm"
,
random_seed
:
int
=
42
,
log_level
:
str
=
"
warning
"
,
log_level
:
str
=
"
error
"
,
):
host
=
"127.0.0.1"
port
=
alloc_usable_network_port
(
1
)[
0
]
...
...
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