[model-gateway]: add gRPC router embeddings endpoint implementation (#15273)
This commit is contained in:
@@ -1710,9 +1710,14 @@ class Scheduler(
|
||||
if recv_req.image_inputs is not None:
|
||||
image_inputs = self._get_multimodal_inputs(recv_req.image_inputs)
|
||||
# Expand a single image token into multiple dummy tokens for receiving image embeddings
|
||||
req.origin_input_ids = self.pad_input_ids_func(
|
||||
req.origin_input_ids, image_inputs
|
||||
)
|
||||
# The `pad_input_ids_func` is model-specific and may be None for
|
||||
# embedding models or models not requiring special padding.
|
||||
# If None, `req.origin_input_ids` is expected to be correctly populated already.
|
||||
if self.pad_input_ids_func:
|
||||
req.origin_input_ids = self.pad_input_ids_func(
|
||||
req.origin_input_ids, image_inputs
|
||||
)
|
||||
|
||||
req.extend_image_inputs(image_inputs)
|
||||
|
||||
if len(req.origin_input_ids) >= self.max_req_input_len:
|
||||
|
||||
Reference in New Issue
Block a user