model: Minicpmo (#3023)
This commit is contained in:
@@ -45,6 +45,8 @@ class GenerateReqInput:
|
||||
# The image input. It can be a file name, a url, or base64 encoded string.
|
||||
# See also python/sglang/srt/utils.py:load_image.
|
||||
image_data: Optional[Union[List[str], str]] = None
|
||||
# The audio input. Like image data, tt can be a file name, a url, or base64 encoded string.
|
||||
audio_data: Optional[Union[List[str], str]] = None
|
||||
# The sampling_params. See descriptions below.
|
||||
sampling_params: Optional[Union[List[Dict], Dict]] = None
|
||||
# The request id.
|
||||
@@ -167,6 +169,13 @@ class GenerateReqInput:
|
||||
elif isinstance(self.image_data, list):
|
||||
pass
|
||||
|
||||
if self.audio_data is None:
|
||||
self.audio_data = [None] * num
|
||||
elif not isinstance(self.audio_data, list):
|
||||
self.audio_data = [self.audio_data] * num
|
||||
elif isinstance(self.audio_data, list):
|
||||
pass
|
||||
|
||||
if self.sampling_params is None:
|
||||
self.sampling_params = [{}] * num
|
||||
elif not isinstance(self.sampling_params, list):
|
||||
@@ -231,6 +240,7 @@ class GenerateReqInput:
|
||||
text=self.text[i] if self.text is not None else None,
|
||||
input_ids=self.input_ids[i] if self.input_ids is not None else None,
|
||||
image_data=self.image_data[i],
|
||||
audio_data=self.audio_data[i],
|
||||
sampling_params=self.sampling_params[i],
|
||||
rid=self.rid[i],
|
||||
return_logprob=self.return_logprob[i],
|
||||
@@ -259,8 +269,8 @@ class TokenizedGenerateReqInput:
|
||||
input_text: str
|
||||
# The input token ids
|
||||
input_ids: List[int]
|
||||
# The image inputs
|
||||
image_inputs: dict
|
||||
# The multimodal inputs
|
||||
mm_inputs: dict
|
||||
# The sampling parameters
|
||||
sampling_params: SamplingParams
|
||||
# Whether to return the logprobs
|
||||
|
||||
Reference in New Issue
Block a user