Error: json: cannot unmarshal array into Go struct field Params.eos_token_id of type int
I was importing the llama 3.1 8B model from using ollama create -f Modelfile
but i got this error:Error: json: cannot unmarshal array into Go struct field Params.eos_token_id of type int
I found the shallow cause of the error. and i fixed it naively. but i wanted to know why this error happened and what is the better solution.
the Go struct
gets int
for eos_token_id
.
But the config.json
file and generation_config.json
file contain "eos_token_id": [128001, 128008, 128009]
.
So they face type mismatch and we get the error.
I changed the eos_token_id
value to "eos_token_id": 128001
without a concrete reason why i chose 128001
instead of the others. and it solved the problem and a model is created.
But why this error happened? What is the correct solution?
I don't know. I'd be appreciated to know.
what is your modelfile ? I tried this and it still didn't work
edit: fixed, remove multi-lines
Error: json: cannot unmarshal array into Go struct field .model.merges of type strin
is what i get trying to use a fine tuned moel i did with LLama Factory; it works with huggingface inference though using ollama yields a similar error. no solution yet for ollama :/ will try to design a solution sticking with the huggingface inference engine