Created
July 18, 2024 14:47
-
-
Save allenporter/67852610cf70a857c5efa3cb20e05d95 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mistral:latest | |
TEMPLATE """{{- range $index, $_ := .Messages }} | |
{{- if eq .Role "user" }} | |
{{- if and (eq (len (slice $.Messages $index)) 1) $.Tools }}[AVAILABLE_TOOLS] {{ $.Tools }}[/AVAILABLE_TOOLS] | |
{{- end }}[INST] {{ if and (eq (len (slice $.Messages $index)) 1) $.System }}{{ $.System }} | |
{{ end }}{{ .Content }}[/INST] | |
{{- else if eq .Role "assistant" }} | |
{{- if .Content }} {{ .Content }}</s> | |
{{- else if .ToolCalls }}[TOOL_CALLS] [ | |
{{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}} | |
{{- end }}]</s> | |
{{- end }} | |
{{- else if eq .Role "tool" }}[TOOL_RESULTS] {"content": {{ .Content }}}[/TOOL_RESULTS] | |
{{- end }} | |
{{- end }}""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment