Skip to content

Commit 630f7b8

Browse files
authored
Return 400 for chat template build errors (#1356)
1 parent 41ed8e9 commit 630f7b8

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lightllm/server/build_prompt.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ async def build_prompt(request, tools) -> str:
159159

160160
try:
161161
input_str = tokenizer.apply_chat_template(**kwargs, tokenize=False, add_generation_prompt=True, tools=tools)
162-
except BaseException as e:
163-
logger.error(f"Failed to build prompt: {e}")
164-
raise e
162+
except Exception as e:
163+
raise ValueError(f"Failed to build prompt: {e}") from None
165164
return input_str

0 commit comments

Comments
 (0)