File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -207,14 +207,17 @@ int main(int argc, char ** argv) {
207207 }
208208
209209 // auto enable conversation mode if chat template is available
210- if (
211- params.conversation_mode == COMMON_CONVERSATION_MODE_AUTO
212- && (!common_get_builtin_chat_template (model).empty () || !params.chat_template .empty ())
213- ) {
210+ const bool has_chat_template = !common_get_builtin_chat_template (model).empty () || !params.chat_template .empty ();
211+ if (params.conversation_mode == COMMON_CONVERSATION_MODE_AUTO && has_chat_template) {
214212 LOG_INF (" %s: chat template is available, enabling conversation mode (disable it with -no-cnv)\n " , __func__);
215213 params.conversation_mode = COMMON_CONVERSATION_MODE_ENABLED;
216214 }
217215
216+ // in case user force-activate conversation mode (via -cnv) without proper chat template, we show a warning
217+ if (params.conversation_mode && !has_chat_template) {
218+ LOG_WRN (" %s: chat template is not available or is not supported. This may cause the model to output suboptimal responses\n " , __func__);
219+ }
220+
218221 // print chat template example in conversation mode
219222 if (params.conversation_mode ) {
220223 if (params.enable_chat_template ) {
You can’t perform that action at this time.
0 commit comments