Update Modelfile
Browse files
Modelfile
CHANGED
|
@@ -1,54 +1,32 @@
|
|
|
|
|
| 1 |
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
{{- if eq $msg.Role "user" }}{{ $lastUserIdx = $idx }}{{ end -}}
|
| 7 |
-
{{- end }}
|
| 8 |
-
{{- if or .System .Tools }}<|im_start|>system
|
| 9 |
-
{{ if .System }}
|
| 10 |
-
{{ .System }}
|
| 11 |
-
{{- end }}
|
| 12 |
-
{{- if .Tools }}
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
-
<
|
| 20 |
-
{{
|
| 21 |
-
{
|
| 22 |
-
{{- end }}
|
| 23 |
-
</tools>
|
| 24 |
-
|
| 25 |
-
For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
|
| 26 |
-
<tool_call>
|
| 27 |
-
{"name": <function-name>, "arguments": <args-json-object>}
|
| 28 |
-
</tool_call>
|
| 29 |
-
{{- end -}}
|
| 30 |
-
<|im_end|>
|
| 31 |
-
{{ end }}
|
| 32 |
-
{{- range $i, $_ := .Messages }}
|
| 33 |
-
{{- $last := eq (len (slice $.Messages $i)) 1 -}}
|
| 34 |
-
{{- if eq .Role "user" }}<|im_start|>user
|
| 35 |
{{ .Content }}<|im_end|>
|
| 36 |
-
{{
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
{{ end }}
|
| 46 |
-
{{- else if eq .Role "tool" }}<|im_start|>user
|
| 47 |
-
<tool_response>
|
| 48 |
-
{{ .Content }}
|
| 49 |
-
</tool_response><|im_end|>
|
| 50 |
-
{{ end }}
|
| 51 |
-
{{- if and (ne .Role "assistant") $last }}<|im_start|>assistant
|
| 52 |
-
{{ end }}
|
| 53 |
-
{{- end }}
|
| 54 |
-
"""
|
|
|
|
| 1 |
+
FROM fyve-ai.gguf
|
| 2 |
|
| 3 |
+
# Your Socratic tutor system prompt (customize as needed)
|
| 4 |
+
SYSTEM """You are a Socratic Python Tutor that analyses python error and provides guiding statement to students. You must output your response in JSON format with exactly two keys:
|
| 5 |
+
1. "reasoning": A brief internal analysis of the error and a plan to guide the student without giving the answer.
|
| 6 |
+
2. "hint": The final 3-line Socratic hint (Diagnosis, Rule, Directive).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
The "hint" string must follow this structure:
|
| 9 |
+
Line 1: Diagnose the specific error.
|
| 10 |
+
Line 2: Explain the relevant Python rule clearly.
|
| 11 |
+
Line 3: Provide a directive statement (starting with 'Think about...' or 'Consider...').
|
| 12 |
|
| 13 |
+
Rules:
|
| 14 |
+
- DO NOT provide the corrected code.
|
| 15 |
+
- DO NOT use metaphors or analogies.
|
| 16 |
+
- DO NOT use headings or labels like 'Line 1:'. Just write the sentences.
|
| 17 |
+
- Use a natural, gently directive tone starting with 'Think about...' or 'Consider...'."""
|
| 18 |
|
| 19 |
+
# Minimal ChatML template – exactly what you trained on
|
| 20 |
+
TEMPLATE """{{ if .System }}<|im_start|>system
|
| 21 |
+
{{ .System }}<|im_end|>
|
| 22 |
+
{{ end }}{{ range .Messages }}<|im_start|>{{ .Role }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
{{ .Content }}<|im_end|>
|
| 24 |
+
{{ end }}<|im_start|>assistant
|
| 25 |
+
"""
|
| 26 |
+
|
| 27 |
+
# Generation parameters (you can adjust these)
|
| 28 |
+
PARAMETER stop "<|im_end|>"
|
| 29 |
+
PARAMETER temperature 0.6
|
| 30 |
+
PARAMETER top_p 0.95
|
| 31 |
+
PARAMETER top_k 20
|
| 32 |
+
PARAMETER repeat_penalty 1.1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|