DeepScaleR-1.5B-Preview is a language model fine-tuned from DeepSeek-R1-Distilled-Qwen-1.5B using distributed reinforcement learning (RL)
65 Pulls Updated 7 weeks ago
87170ebb1aa4 · 2.2kB
{{- if .BosToken }}{{ .BosToken }}{{- end }}
{{- $systemPrompt := "" }}
{{- $isTool := false }}
{{- $isFirstToolCall := true }}
{{- $isOutputFirst := true }}
{{- range .Messages }}
{{- if eq .Role "system" }}
{{- $systemPrompt = .Content }}
{{- end }}
{{- end }}
{{ $systemPrompt }}
{{- range $index, $msg := .Messages }}
{{- if eq $msg.Role "user" }}
{{- $isTool = false }}
<|User|>{{ $msg.Content }}
{{- end }}
{{- if and (eq $msg.Role "assistant") (not $msg.Content) }}
{{- $isTool = false }}
{{- range $tool := $msg.ToolCalls }}
{{- if $isFirstToolCall }}
<|Assistant|><|tool_calls_begin|><|tool_call_begin|>{{ $tool.Type }}<|tool_sep|>{{ $tool.Function.Name }}
```json
{{ json $tool.Function.Arguments }}
```
<|tool_call_end|>
{{- $isFirstToolCall = false }}
{{- else }}
\n<|tool_call_begin|>{{ $tool.Type }}<|tool_sep|>{{ $tool.Function.Name }}
```json
{{ json $tool.Function.Arguments }}
```
<|tool_call_end|><|tool_calls_end|><|end_of_sentence|>
{{- end }}
{{- end }}
{{- end }}
{{- if and (eq $msg.Role "assistant") $msg.Content }}
{{- if $isTool }}
<|tool_outputs_end|>{{ $msg.Content }}<|end_of_sentence|>
{{- $isTool = false }}
{{- else }}
{{- $content := $msg.Content }}
{{- if call (index "contains" "</think>") $content }}
{{/* Note: Split isn't available, so we'll keep full content as workaround */}}
<|Assistant|>{{ $content }}<|end_of_sentence|>
{{- else }}
<|Assistant|>{{ $content }}<|end_of_sentence|>
{{- end }}
{{- end }}
{{- end }}
{{- if eq $msg.Role "tool" }}
{{- $isTool = true }}
{{- if $isOutputFirst }}
<|tool_outputs_begin|><|tool_output_begin|>{{ $msg.Content }}<|tool_output_end|>
{{- $isOutputFirst = false }}
{{- else }}
\n<|tool_output_begin|>{{ $msg.Content }}<|tool_output_end|>
{{- end }}
{{- end }}
{{- end }}
{{- if $isTool }}
<|tool_outputs_end|>
{{- end }}
{{- if and .AddGenerationPrompt (not $isTool) }}
<|Assistant|><think>
{{- end }}
<think>