Skip to content

convert-llama2c-to-ggml is opening llama2c .bin files in text mode instead of binary mode. #6332

Closed
@SpaceCowboy850

Description

@SpaceCowboy850

One character needs to be added:

https://github.com/ggerganov/llama.cpp/blob/32c8486e1f0297393cb22ac0a0d26a6b17ad4d54/examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp#L883

That line needs to open the file in "rb" mode, not "r" mode since the llama2c files are a binary format. I've tested this with my own trained files as well as Stories110M.bin pulled from https://github.com/karpathy/llama2.c?tab=readme-ov-file#models.

Symptoms: You will fail to succeed on the checkpoint_init_weights function, with the first fread only reading 11 values instead of the entire embedding table it should be reading.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions