ahpah commited on
Commit
92c6aa0
·
verified ·
1 Parent(s): f1dd390

Fix Ollama Modelfile with Qwen3.5 ChatML + <think> template and stop tokens

Browse files
Files changed (1) hide show
  1. Modelfile +27 -3
Modelfile CHANGED
@@ -1,6 +1,30 @@
1
  FROM ./YokoCoder-4B-5epochs-Q4_K_M.gguf
2
- PARAMETER num_ctx 16384
3
- PARAMETER num_predict -1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  PARAMETER temperature 0.6
5
  PARAMETER top_p 0.95
6
- SYSTEM """You are an expert reasoning assistant. Think step-by-step before providing your final answer."""
 
 
 
 
 
 
1
  FROM ./YokoCoder-4B-5epochs-Q4_K_M.gguf
2
+
3
+ TEMPLATE """{{- if .System }}<|im_start|>system
4
+ {{ .System }}<|im_end|>
5
+ {{ end }}{{- range $i, $_ := .Messages }}{{- $last := eq (len (slice $.Messages $i)) 1 }}{{- if eq .Role "user" }}<|im_start|>user
6
+ {{ .Content }}<|im_end|>
7
+ {{ else if eq .Role "assistant" }}<|im_start|>assistant
8
+ {{ if and $.IsThinkSet (and $last .Thinking) }}<think>
9
+ {{ .Thinking }}
10
+ </think>
11
+
12
+ {{ end }}{{ .Content }}<|im_end|>
13
+ {{ end }}{{- if and $last (ne .Role "assistant") }}<|im_start|>assistant
14
+ {{ if and $.IsThinkSet (not $.Think) }}<think>
15
+
16
+ </think>
17
+
18
+ {{ else }}<think>
19
+ {{ end }}{{- end }}{{- end }}"""
20
+
21
+ SYSTEM """You are YokoCoder, an expert software engineering, bug-fixing, and 2D/3D video game coding assistant. Think step-by-step inside <think>...</think> tags (covering problem decomposition, mathematical/physics invariants, lexical variable scope audit, and edge-case bug prevention) before providing complete, runnable, zero-bug code."""
22
+
23
  PARAMETER temperature 0.6
24
  PARAMETER top_p 0.95
25
+ PARAMETER top_k 20
26
+ PARAMETER num_ctx 16384
27
+ PARAMETER num_predict -1
28
+ PARAMETER stop "<|im_start|>"
29
+ PARAMETER stop "<|im_end|>"
30
+ PARAMETER stop "<|endoftext|>"