If you run the following code to copy llama3 to test, it creates a modelfile with escape qotes for the last PARAMETER stop.
If I use ollama create test -f test.modelfile, it works fine.
Original modelfile:
# Modelfile generated by "ollama show"
# To build a new Modelfile based on this one, replace the FROM line with:
# FROM llama3:latest
FROM /Users/cgk/.ollama/models/blobs/sha256-00e1317cbf74d901080d7100f57580ba8dd8de57203072dc6f668324ba545f29
TEMPLATE """{{ if .System }}<|start_header_id|>system<|end_header_id|>
{{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|>
{{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>
{{ .Response }}<|eot_id|>"""
PARAMETER num_keep 24
PARAMETER stop "<|start_header_id|>"
PARAMETER stop "<|end_header_id|>"
PARAMETER stop "<|eot_id|>"
Modified modelfile:
# Modelfile generated by "ollama show"
# To build a new Modelfile based on this one, replace the FROM line with:
# FROM llama3:latest
FROM llama3:latest
TEMPLATE """{{ if .System }}<|start_header_id|>system<|end_header_id|>
{{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|>
{{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>
{{ .Response }}<|eot_id|>"""
PARAMETER num_keep 24
PARAMETER stop "<|start_header_id|>"
PARAMETER stop "<|end_header_id|>"
PARAMETER stop "<|eot_id|>"
Response:
Hello there! It's nice to meet you. Is there something I can help you with, or would you like to chat?<|eot_id|>
new modelfile:
# Modelfile generated by "ollama show"
# To build a new Modelfile based on this one, replace the FROM line with:
# FROM test:latest
FROM llama3:latest
TEMPLATE """{{ if .System }}<|start_header_id|>system<|end_header_id|>
{{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|>
{{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>
{{ .Response }}<|eot_id|>"""
PARAMETER num_keep 24
PARAMETER stop "<|start_header_id|>"
PARAMETER stop "<|end_header_id|>"
PARAMETER stop "\"<|eot_id|>\""
If you look at the last line, there's the escape quotes \". Not sure why only the last line has that.
Also if you look at the response string, it ends with <|eot_id|> because the last PARAMETER stop string in the new modelfile doesn't work.
Could you look into this?
Thanks so much!
Hi,
If you run the following code to copy llama3 to test, it creates a modelfile with escape qotes for the last PARAMETER stop. If I use
ollama create test -f test.modelfile
, it works fine.Here's the output.
If you look at the last line, there's the escape quotes \". Not sure why only the last line has that. Also if you look at the response string, it ends with <|eot_id|> because the last PARAMETER stop string in the new modelfile doesn't work. Could you look into this? Thanks so much!