Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Fix the Image Input of Batch Generation #1579

Merged
merged 5 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions python/sglang/srt/managers/io_struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ def post_init(self):
elif not isinstance(self.image_data, list):
self.image_data = [self.image_data] * num
elif isinstance(self.image_data, list):
# FIXME incorrect order for duplication
self.image_data = self.image_data * num
pass

if self.sampling_params is None:
self.sampling_params = [{}] * num
Expand Down
4 changes: 2 additions & 2 deletions python/sglang/srt/openai_api/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ def v1_chat_generate_request(
else:
prompt_kwargs = {"input_ids": input_ids}
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]
logprob_start_lens = logprob_start_lens[0]
top_logprobs_nums = top_logprobs_nums[0]
Expand All @@ -937,7 +937,7 @@ def v1_chat_generate_request(

adapted_request = GenerateReqInput(
**prompt_kwargs,
image_data=image_data,
image_data=image_data_list,
sampling_params=sampling_params_list,
return_logprob=return_logprobs,
logprob_start_len=logprob_start_lens,
Expand Down
Loading