[Frontend] Avoid startup error log for models without chat template (#37040)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2026-03-15 00:36:11 +08:00
committed by GitHub
parent 3ed46f374b
commit 5467d137b3

View File

@@ -176,6 +176,8 @@ class BaseRenderer(ABC, Generic[_T]):
For multi-modal requests:
- Importing libraries such as librosa triggers JIT compilation.
"""
from vllm.entrypoints.chat_utils import ChatTemplateResolutionError
try:
logger.info("Warming up chat template processing...")
start_time = time.perf_counter()
@@ -184,6 +186,8 @@ class BaseRenderer(ABC, Generic[_T]):
elapsed = time.perf_counter() - start_time
logger.info("Chat template warmup completed in %.3fs", elapsed)
except ChatTemplateResolutionError:
logger.info("This model does not support chat template.")
except Exception:
logger.exception("Chat template warmup failed")