The IBM Granite 2B and 8B models are designed to support tool-based use cases and support for retrieval augmented generation (RAG), streamlining code generation, translation and bug fixing.
tools
2b
8b
20.2K Pulls Updated 3 weeks ago
604785e698e9 · 664B
{{- if .Tools }}<|start_of_role|>available_tools<|end_of_role|>
{{- range .Tools }}
{{ . }}
{{ end }}<|end_of_text|>
{{ end }}
{{- range $index, $_ := .Messages }}<|start_of_role|>
{{- if eq .Role "tool" }}tool_response
{{- else }}{{ .Role }}
{{- end }}<|end_of_role|>
{{- if .Content }}{{ .Content }}
{{- else if .ToolCalls }}<|tool_call|>
{{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
{{- end }}
{{- end }}
{{- if eq (len (slice $.Messages $index)) 1 }}
{{- if eq .Role "assistant" }}
{{- else }}<|end_of_text|>
<|start_of_role|>assistant<|end_of_role|>
{{- end }}
{{- else }}<|end_of_text|>
{{ end }}
{{- end }}