Having trouble setting up the template.

#7
by frenchiveruti - opened

Hi, I am on windows with Ollama,

Could you help me understand what I am doing wrong?

When I make the "modelfile" to create the model on ollama I am using this:

FROM ./DeepSeek-Coder-V2-Lite-Instruct-Q6_K.gguf
TEMPLATE "{%- if not add_generation_prompt is defined -%}
    {%- set add_generation_prompt = false -%}
{%- endif -%}
{{- bos_token -}}
{%- for message in messages -%}
    {%- if message["role"] == "user" -%}
        {{- "User: " + message["content"] + "\n\n" -}}
    {%- elif message["role"] == "assistant" -%}
        {{- "Assistant: " + message["content"] + eos_token -}}
    {%- elif message["role"] == "system" -%}
        {{- message["content"] + "\n\n" -}}
    {%- endif -%}
{%- endfor -%}
{%- if add_generation_prompt -%}
    {{- "Assistant:" -}}
{%- endif -%}"
PARAMETER num_ctx 131072

With LF endings and using the command:
ollama create deepseek-coder-v2-lite-q6k -f Modelfile

But I am getting this error:

gathering model components
copying file sha256:1ff79f43ad5728d3179bf8fa7ee2993652f4306d6aeca9c35055f4f5b7b864cd 100%
parsing GGUF
verifying conversion
Error: template error: template: :4: function "bos_token" not define

I copied the template that it's on the model card here. https://huggingface.co/bartowski/DeepSeek-Coder-V2-Lite-Instruct-GGUF?chat_template=default

Any help is very appreciated.

Sign up or log in to comment