redhat6 commited on
Commit
985a90d
1 Parent(s): c336240

Create Modelfile

Browse files
Files changed (1) hide show
  1. Modelfile +61 -0
Modelfile ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM llama-3.1-korean-8b-instruct-q4_k_m.gguf
2
+
3
+ TEMPLATE """
4
+ {{ if .Messages }}
5
+ {{- if or .System .Tools }}<|start_header_id|>system<|end_header_id|>
6
+ {{- if .System }}
7
+
8
+ {{ .System }}
9
+ {{- end }}
10
+ {{- if .Tools }}
11
+
12
+ 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.
13
+ {{- end }}<|eot_id|>
14
+ {{- end }}
15
+ {{- range $i, $_ := .Messages }}
16
+ {{- $last := eq (len (slice $.Messages $i)) 1 }}
17
+ {{- if eq .Role "user" }}<|start_header_id|>user<|end_header_id|>
18
+ {{- if and $.Tools $last }}
19
+
20
+ Given the following functions, please respond with a JSON for a function call with its proper arguments that best answers the given prompt.
21
+
22
+ Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}. Do not use variables.
23
+
24
+ {{ $.Tools }}
25
+ {{- end }}
26
+
27
+ {{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|>
28
+
29
+ {{ end }}
30
+ {{- else if eq .Role "assistant" }}<|start_header_id|>assistant<|end_header_id|>
31
+ {{- if .ToolCalls }}
32
+
33
+ {{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "parameters": {{ .Function.Arguments }}}{{ end }}
34
+ {{- else }}
35
+
36
+ {{ .Content }}{{ if not $last }}<|eot_id|>{{ end }}
37
+ {{- end }}
38
+ {{- else if eq .Role "tool" }}<|start_header_id|>ipython<|end_header_id|>
39
+
40
+ {{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|>
41
+
42
+ {{ end }}
43
+ {{- end }}
44
+ {{- end }}
45
+ {{- else }}
46
+ {{- if .System }}<|start_header_id|>system<|end_header_id|>
47
+
48
+ {{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|>
49
+
50
+ {{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>
51
+
52
+ {{ end }}{{ .Response }}{{ if .Response }}<|eot_id|>{{ end }}
53
+ """
54
+
55
+ SYSTEM """A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions."""
56
+
57
+ PARAMETER stop "<|start_header_id|>"
58
+ PARAMETER stop "<|end_header_id|>"
59
+ PARAMETER stop "<|eot_id|>"
60
+
61
+