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
b503881b
Unverified
Commit
b503881b
authored
Oct 11, 2024
by
Yiding-Lu
Committed by
GitHub
Oct 11, 2024
Browse files
[Bug] Fix the Image Input of Batch Generation (#1579)
parent
58093b86
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
python/sglang/srt/managers/io_struct.py
python/sglang/srt/managers/io_struct.py
+1
-2
python/sglang/srt/openai_api/adapter.py
python/sglang/srt/openai_api/adapter.py
+2
-2
No files found.
python/sglang/srt/managers/io_struct.py
View file @
b503881b
...
@@ -119,8 +119,7 @@ class GenerateReqInput:
...
@@ -119,8 +119,7 @@ class GenerateReqInput:
elif
not
isinstance
(
self
.
image_data
,
list
):
elif
not
isinstance
(
self
.
image_data
,
list
):
self
.
image_data
=
[
self
.
image_data
]
*
num
self
.
image_data
=
[
self
.
image_data
]
*
num
elif
isinstance
(
self
.
image_data
,
list
):
elif
isinstance
(
self
.
image_data
,
list
):
# FIXME incorrect order for duplication
pass
self
.
image_data
=
self
.
image_data
*
num
if
self
.
sampling_params
is
None
:
if
self
.
sampling_params
is
None
:
self
.
sampling_params
=
[{}]
*
num
self
.
sampling_params
=
[{}]
*
num
...
...
python/sglang/srt/openai_api/adapter.py
View file @
b503881b
...
@@ -924,7 +924,7 @@ def v1_chat_generate_request(
...
@@ -924,7 +924,7 @@ def v1_chat_generate_request(
else
:
else
:
prompt_kwargs
=
{
"input_ids"
:
input_ids
}
prompt_kwargs
=
{
"input_ids"
:
input_ids
}
sampling_params_list
=
sampling_params_list
[
0
]
sampling_params_list
=
sampling_params_list
[
0
]
image_data
=
image_data_list
[
0
]
image_data
_list
=
image_data_list
[
0
]
return_logprobs
=
return_logprobs
[
0
]
return_logprobs
=
return_logprobs
[
0
]
logprob_start_lens
=
logprob_start_lens
[
0
]
logprob_start_lens
=
logprob_start_lens
[
0
]
top_logprobs_nums
=
top_logprobs_nums
[
0
]
top_logprobs_nums
=
top_logprobs_nums
[
0
]
...
@@ -937,7 +937,7 @@ def v1_chat_generate_request(
...
@@ -937,7 +937,7 @@ def v1_chat_generate_request(
adapted_request
=
GenerateReqInput
(
adapted_request
=
GenerateReqInput
(
**
prompt_kwargs
,
**
prompt_kwargs
,
image_data
=
image_data
,
image_data
=
image_data
_list
,
sampling_params
=
sampling_params_list
,
sampling_params
=
sampling_params_list
,
return_logprob
=
return_logprobs
,
return_logprob
=
return_logprobs
,
logprob_start_len
=
logprob_start_lens
,
logprob_start_len
=
logprob_start_lens
,
...
...
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