mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-07 11:23:56 +01:00
ggml.c : get arr str and f32
This commit is contained in:
parent
34469b9ea7
commit
2c22e3bcdb
10
ggml.c
10
ggml.c
@ -18768,6 +18768,16 @@ enum gguf_type gguf_get_type(struct gguf_context * ctx, int i) {
|
|||||||
return ctx->header.kv[i].type;
|
return ctx->header.kv[i].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];
|
||||||
|
return str->data;
|
||||||
|
}
|
||||||
|
|
||||||
|
float gguf_get_arr_f32(struct gguf_context * ctx, int key_id, int i) {
|
||||||
|
return ((float *) ctx->header.kv[key_id].value.arr.data)[i];
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t gguf_get_val_u8(struct gguf_context * ctx, int i) {
|
uint8_t gguf_get_val_u8(struct gguf_context * ctx, int i) {
|
||||||
return ctx->header.kv[i].value.uint8;
|
return ctx->header.kv[i].value.uint8;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user