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.
This commit is contained in:
Alpamys 2026-04-01 13:53:48 +05:00
parent 1d84595938
commit 4df66414ce
1 changed files with 5 additions and 1 deletions

View File

@ -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}")