kalq18 commited on
Commit
5d83dd5
·
verified ·
1 Parent(s): 6b83224

Create ollama_modelfile

Browse files
Files changed (1) hide show
  1. ollama_modelfile +56 -0
ollama_modelfile ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM {__FILE_LOCATION__}
2
+ TEMPLATE """{{ if .Messages }}
3
+ {{- if or .System .Tools }}<|start_header_id|>system<|end_header_id|>
4
+ {{- if .System }}
5
+
6
+ {{ .System }}
7
+ {{- end }}
8
+ {{- if .Tools }}
9
+
10
+ You are a helpful assistant with tool calling capabilities. When you receive a tool call response, use the output to format an answer to the orginal use question.
11
+ {{- end }}
12
+ {{- end }}<|eot_id|>
13
+ {{- range $i, $_ := .Messages }}
14
+ {{- $last := eq (len (slice $.Messages $i)) 1 }}
15
+ {{- if eq .Role "user" }}<|start_header_id|>user<|end_header_id|>
16
+ {{- if and $.Tools $last }}
17
+
18
+ Given the following functions, please respond with a JSON for a function call with its proper arguments that best answers the given prompt.
19
+
20
+ Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}. Do not use variables.
21
+
22
+ {{ $.Tools }}
23
+ {{- end }}
24
+
25
+ {{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|>
26
+
27
+ {{ end }}
28
+ {{- else if eq .Role "assistant" }}<|start_header_id|>assistant<|end_header_id|>
29
+ {{- if .ToolCalls }}
30
+
31
+ {{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "parameters": {{ .Function.Arguments }}}{{ end }}
32
+ {{- else }}
33
+
34
+ {{ .Content }}{{ if not $last }}<|eot_id|>{{ end }}
35
+ {{- end }}
36
+ {{- else if eq .Role "tool" }}<|start_header_id|>ipython<|end_header_id|>
37
+
38
+ {{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|>
39
+
40
+ {{ end }}
41
+ {{- end }}
42
+ {{- end }}
43
+ {{- else }}
44
+ {{- if .System }}<|start_header_id|>system<|end_header_id|>
45
+
46
+ {{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|>
47
+
48
+ {{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>
49
+
50
+ {{ end }}{{ .Response }}{{ if .Response }}<|eot_id|>{{ end }}"""
51
+ PARAMETER stop "<|start_header_id|>"
52
+ PARAMETER stop "<|end_header_id|>"
53
+ PARAMETER stop "<|eot_id|>"
54
+ PARAMETER stop "<|eom_id|>"
55
+ PARAMETER temperature 1.5
56
+ PARAMETER min_p 0.1