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
3579162a
"src/vscode:/vscode.git/clone" did not exist on "a9c403c00197d8d6eb854128dda2f7849cedd100"
Unverified
Commit
3579162a
authored
Aug 26, 2024
by
Kaichen Zhang - NTU
Committed by
GitHub
Aug 26, 2024
Browse files
[Fix] Multi-images loading error (#1218)
parent
7514b9f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
python/sglang/srt/managers/tokenizer_manager.py
python/sglang/srt/managers/tokenizer_manager.py
+1
-1
test/srt/test_vision_openai_server.py
test/srt/test_vision_openai_server.py
+2
-2
No files found.
python/sglang/srt/managers/tokenizer_manager.py
View file @
3579162a
...
@@ -428,7 +428,7 @@ class TokenizerManager:
...
@@ -428,7 +428,7 @@ class TokenizerManager:
async
def
_get_pixel_values
(
self
,
image_data
):
async
def
_get_pixel_values
(
self
,
image_data
):
if
isinstance
(
image_data
,
list
)
and
len
(
image_data
)
>
0
:
if
isinstance
(
image_data
,
list
)
and
len
(
image_data
)
>
0
:
return
await
self
.
_get_pixel_values_internal
(
image_data
[
0
]
)
return
await
self
.
_get_pixel_values_internal
(
image_data
)
elif
isinstance
(
image_data
,
str
):
elif
isinstance
(
image_data
,
str
):
return
await
self
.
_get_pixel_values_internal
(
image_data
)
return
await
self
.
_get_pixel_values_internal
(
image_data
)
else
:
else
:
...
...
test/srt/test_vision_openai_server.py
View file @
3579162a
...
@@ -114,8 +114,8 @@ class TestOpenAIVisionServer(unittest.TestCase):
...
@@ -114,8 +114,8 @@ class TestOpenAIVisionServer(unittest.TestCase):
text
=
response
.
choices
[
0
].
message
.
content
text
=
response
.
choices
[
0
].
message
.
content
assert
isinstance
(
text
,
str
)
assert
isinstance
(
text
,
str
)
print
(
text
)
print
(
text
)
assert
"man"
in
text
or
"cab
"
in
text
,
text
assert
"man"
in
text
and
"taxi
"
in
text
,
text
#
assert "logo" in text, text
assert
"logo"
in
text
,
text
assert
response
.
id
assert
response
.
id
assert
response
.
created
assert
response
.
created
assert
response
.
usage
.
prompt_tokens
>
0
assert
response
.
usage
.
prompt_tokens
>
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