gguf : support custom alignment value

This commit is contained in:
M. Yusuf Sarıgöz 2023-07-31 09:59:36 +03:00
parent 6b3a7b9f4f
commit 7aa0a0e7f7
3 changed files with 10 additions and 2 deletions

5
ggml.c
View file

@ -18543,7 +18543,10 @@ struct gguf_context * gguf_init_from_file(const char * fname, struct gguf_init_p
ctx->alignment = GGUF_DEFAULT_ALIGNMENT;
// TODO: determine new alignment from kv if available
int alignment_idx = gguf_find_key(ctx, "general.alignment");
if (alignment_idx != -1) {
ctx->alignment = gguf_get_u32(ctx, alignment_idx);
}
// we require the data section to be aligned, so take into account any padding
{