Error: json: cannot unmarshal array into Go struct field Params.eos_token_id of type int

#40
by SadeghPouriyan - opened

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

Sign up or log in to comment