add: more tools, fix prompt
This commit is contained in:
74
Modelfile
Normal file
74
Modelfile
Normal file
@@ -0,0 +1,74 @@
|
||||
FROM gemma3:12b
|
||||
|
||||
PARAMETER num_ctx 128000
|
||||
PARAMETER temperature 0.1
|
||||
PARAMETER stop "<end_of_turn>"
|
||||
|
||||
TEMPLATE """
|
||||
{{- if .Messages }}
|
||||
{{- if or .System .Tools }}
|
||||
{{- if .System }}
|
||||
{{ .System }}
|
||||
{{- end }}
|
||||
{{- if .Tools }}
|
||||
The following tools are available when needed for specific tasks:
|
||||
{{ .Tools }}
|
||||
|
||||
Only use tools when the task specifically requires their functionality.
|
||||
For general questions or tasks that don't need external data, respond directly.
|
||||
|
||||
When using a tool, format as:
|
||||
<tool_calls>
|
||||
<tool_call>
|
||||
{"name": "function_name", "parameters": {"param1": "value1"}}
|
||||
</tool_call>
|
||||
</tool_calls>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- range $i, $_ := .Messages }}
|
||||
{{- $last := eq (len (slice $.Messages $i)) 1 }}
|
||||
{{- if eq .Role "user" }}<start_of_turn>user
|
||||
{{ .Content }}<end_of_turn>
|
||||
{{- if $last }}<start_of_turn>model
|
||||
{{ end }}
|
||||
{{- else if eq .Role "system" }}<start_of_turn>user
|
||||
{{ .Content }}<end_of_turn>
|
||||
{{- if $last }}<start_of_turn>model
|
||||
{{ end }}
|
||||
{{- else if eq .Role "assistant" }}<start_of_turn>model
|
||||
{{- if .ToolCalls }}
|
||||
<tool_calls>
|
||||
{{- range .ToolCalls }}
|
||||
<tool_call>
|
||||
{"name": "{{ .Function.Name }}", "parameters": {{ .Function.Arguments }}}
|
||||
</tool_call>
|
||||
{{- end }}
|
||||
</tool_calls>
|
||||
{{- else }}
|
||||
{{ .Content }}
|
||||
{{- end }}
|
||||
{{- if not $last }}<end_of_turn>
|
||||
{{ end }}
|
||||
{{- else if eq .Role "tool" }}
|
||||
<tool_outputs>
|
||||
<tool_output>
|
||||
{{ .Content }}
|
||||
</tool_output>
|
||||
</tool_outputs>
|
||||
{{- if and $last (ne .Role "assistant") }}<start_of_turn>model
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- if .System }}
|
||||
{{ .System }}
|
||||
{{- end }}
|
||||
{{- if .Prompt }}
|
||||
<start_of_turn>user
|
||||
{{ .Prompt }}<end_of_turn>
|
||||
<start_of_turn>model
|
||||
{{- end }}
|
||||
{{ .Response }}
|
||||
{{- if .Response }}{{ end }}
|
||||
{{- end }}
|
||||
"""
|
||||
Reference in New Issue
Block a user