From 4df66414ce1088c284c7190712b9463b8e0f3e58 Mon Sep 17 00:00:00 2001 From: Alpamys Date: Wed, 1 Apr 2026 13:53:48 +0500 Subject: [PATCH] fix: auto-detect chat template in export --deploy ollama path Use _auto_detect_template() from soup.yaml instead of hardcoding chatml in the --deploy ollama flow. Falls back to chatml if detection fails. --- soup_cli/commands/export.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/soup_cli/commands/export.py b/soup_cli/commands/export.py index 4e59aaa..0399b9d 100644 --- a/soup_cli/commands/export.py +++ b/soup_cli/commands/export.py @@ -605,7 +605,11 @@ def _auto_deploy_ollama( f"named '{ollama_name}'." ) - modelfile = create_modelfile(gguf_path=output_path, template="chatml") + # Auto-detect template from soup.yaml, fall back to chatml + from soup_cli.commands.deploy import _auto_detect_template + + resolved_template = _auto_detect_template() or "chatml" + modelfile = create_modelfile(gguf_path=output_path, template=resolved_template) success, message = deploy_to_ollama(ollama_name, modelfile) if not success: console.print(f"[red]Deploy failed:[/] {message}")