[Bugfix] Disallow renderer_num_workers > 1 with mm processor cache (#38418)

Signed-off-by: Bvicii <yizhanhuang2002@gmail.com>
This commit is contained in:
Bvicii
2026-03-28 06:32:52 -07:00
committed by GitHub
parent 2bf5b70ae8
commit bda3eda82d
2 changed files with 35 additions and 0 deletions
+13
View File
@@ -647,6 +647,19 @@ class ModelConfig:
self.multimodal_config = MultiModalConfig(**mm_config_kwargs) # type: ignore[arg-type]
if (
self.renderer_num_workers > 1
and self.multimodal_config.mm_processor_cache_gb > 0
):
raise ValueError(
"Cannot use --renderer-num-workers > 1 with the "
"multimodal processor cache enabled. The cache is "
"not thread-safe and does not support concurrent "
"renderer workers. Please set "
"--renderer-num-workers 1 (the default), or "
"disable the cache with --mm-processor-cache-gb 0."
)
# Multimodal GGUF models must use original repo for mm processing
if is_gguf(self.tokenizer) and self.is_multimodal_model:
raise ValueError(