"...git@developer.sourcefind.cn:2222/OpenDAS/vllm_cscc.git" did not exist on "0ddc991f5c4000d04581b58a5320d210257c6760"
Unverified Commit 54d244f2 authored by Cyrus Leung's avatar Cyrus Leung Committed by GitHub
Browse files

[UX] Improve error message for MM input too long (#39409)


Signed-off-by: default avatarDarkLight1337 <tlleungac@connect.ust.hk>
parent 6c749399
...@@ -405,11 +405,11 @@ class InputProcessor: ...@@ -405,11 +405,11 @@ class InputProcessor:
decoder_mm_positions = prompt_input["mm_placeholders"] decoder_mm_positions = prompt_input["mm_placeholders"]
for modality, mm_positions in decoder_mm_positions.items(): for modality, mm_positions in decoder_mm_positions.items():
for mm_position in mm_positions: for mm_position in mm_positions:
embed_length = mm_position.get_num_embeds() num_embeds = mm_position.get_num_embeds()
if embed_length > self.mm_encoder_cache_size: if num_embeds > self.mm_encoder_cache_size:
raise ValueError( raise ValueError(
f"The {prompt_type} prompt contains a(n) {modality} item " f"The {prompt_type} prompt contains a(n) {modality} item "
f"with length {embed_length}, which exceeds the " f"with {num_embeds} embedding tokens, which exceeds the "
f"pre-allocated encoder cache size " f"pre-allocated encoder cache size "
f"{self.mm_encoder_cache_size}. Please reduce the input " f"{self.mm_encoder_cache_size}. Please reduce the input "
f"size or increase the encoder cache size " f"size or increase the encoder cache size "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment