-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
Description
Name and Version
version: 6877 (10fcc41)
built with Clang 17.0.3 for x64
Operating systems
No response
Which llama.cpp modules do you know to be affected?
No response
Command line
Problem description & steps to reproduce
llm_chat_template_from_str throws, as it simply is a std::map lookup via std::map::at(), almost useless wrapper. Then in the llm_chat_detect_template function it is wrapped in a try-catch block, which ignores the exception std::out_of_range, yet still pollutes the output with "exception thrown" message, and incurs negligible overhead. My main issue is the output pollution, so I propose to refactor the function to use sentinel value LLM_CHAT_TEMPLATE_UNKNOWN that already exists, and to check for that instead of catching exceptions.
First Bad Commit
No response
Relevant log output
Exception thrown at 0x00007FFF2A7FCD29 in chat.exe: Microsoft C++ exception: std::out_of_range at memory location 0x00000005BF5CF780.skoulik