@@ -222,14 +222,18 @@ static std::string chat_add_and_format(mtmd_cli_context & ctx, common_chat_msg &
222222
223223static int eval_message (mtmd_cli_context & ctx, common_chat_msg & msg) {
224224 bool add_bos = ctx.chat_history .empty ();
225- auto formatted_chat = chat_add_and_format (ctx, msg);
226- LOG_DBG (" formatted_chat.prompt: %s\n " , formatted_chat.c_str ());
227225
228226 mtmd_input_text text;
229- text.text = formatted_chat .c_str ();
227+ text.text = msg. content .c_str ();
230228 text.add_special = add_bos;
231229 text.parse_special = true ;
232230
231+ if (!mtmd_is_deepseekocr (ctx.ctx_vision .get ())) {
232+ auto formatted_chat = chat_add_and_format (ctx, msg);
233+ LOG_DBG (" formatted_chat.prompt: %s\n " , formatted_chat.c_str ());
234+ text.text = formatted_chat.c_str ();
235+ }
236+
233237 if (g_is_interrupted) return 0 ;
234238
235239 mtmd::input_chunks chunks (mtmd_input_chunks_init ());
@@ -332,6 +336,11 @@ int main(int argc, char ** argv) {
332336 }
333337
334338 } else {
339+ if (mtmd_is_deepseekocr (ctx.ctx_vision .get ())) {
340+ LOG_ERR (" \n DeepSeek-OCR doesn't support chat mode." );
341+ return 1 ;
342+ }
343+
335344 LOG (" \n Running in chat mode, available commands:" );
336345 if (mtmd_support_vision (ctx.ctx_vision .get ())) {
337346 LOG (" \n /image <path> load an image" );
0 commit comments