electron271 commited on
Commit
9edae41
·
verified ·
1 Parent(s): 2b7080c

Upload /Modelfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Modelfile +54 -0
Modelfile ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ FROM model-Q4_K_M.gguf
3
+ TEMPLATE """
4
+ {{- $lastUserIdx := -1 -}}
5
+ {{- range $idx, $msg := .Messages -}}
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
+ # Tools
15
+
16
+ You may call one or more functions to assist with the user query.
17
+
18
+ You are provided with function signatures within <tools></tools> XML tags:
19
+ <tools>
20
+ {{- range .Tools }}
21
+ {"type": "function", "function": {{ .Function }}}
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
+ {{ else if eq .Role "assistant" }}<|im_start|>assistant
37
+ {{ if (and $.IsThinkSet (and .Thinking (or $last (gt $i $lastUserIdx)))) -}}
38
+ <think>{{ .Thinking }}</think>
39
+ {{ end -}}
40
+ {{ if .Content }}{{ .Content }}
41
+ {{- else if .ToolCalls }}<tool_call>
42
+ {{ range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
43
+ {{ end }}</tool_call>
44
+ {{- end }}{{ if not $last }}<|im_end|>
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
+ """