gguf : write metadata in gguf_file_saver

This commit is contained in:
M. Yusuf Sarıgöz 2023-08-11 20:07:43 +03:00
parent 781b9ec3f5
commit d09fd10713
3 changed files with 38 additions and 1 deletions

4
ggml.c
View file

@ -19035,6 +19035,10 @@ enum gguf_type gguf_get_kv_type(struct gguf_context * ctx, int i) {
return ctx->header.kv[i].type;
}
enum gguf_type gguf_get_arr_type(struct gguf_context * ctx, int i) {
return ctx->header.kv[i].value.arr.type;
}
const char * gguf_get_arr_str(struct gguf_context * ctx, int key_id, int i) {
struct gguf_kv * kv = &ctx->header.kv[key_id];
struct gguf_str * str = &((struct gguf_str *) kv->value.arr.data)[i];