mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-10-31 08:51:55 +00:00 
			
		
		
		
	tool-call: fix non-tool-calling grammar crashes w/ Qwen / Hermes 2 templates (#12900)
				
					
				
			* `tool-call`: don't call common_chat_params_init_hermes_2_pro when there aren't tools (or when there's a schema) * test all chat formats w/o tools
This commit is contained in:
		| @@ -1622,7 +1622,7 @@ static common_chat_params common_chat_templates_apply_jinja( | ||||
|     } | ||||
|  | ||||
|     // Hermes 2/3 Pro, Qwen 2.5 Instruct (w/ tools) | ||||
|     if (src.find("<tool_call>") != std::string::npos && params.json_schema.is_null()) { | ||||
|     if (src.find("<tool_call>") != std::string::npos && params.json_schema.is_null() && params.tools.is_array() && params.json_schema.is_null()) { | ||||
|         return common_chat_params_init_hermes_2_pro(tmpl, params); | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Olivier Chafik
					Olivier Chafik