diff --git a/ggml.c b/ggml.c index aa81d7007ff033..2af631e1bfaaeb 100644 --- a/ggml.c +++ b/ggml.c @@ -18741,6 +18741,10 @@ size_t gguf_get_tensor_offset(struct gguf_context * ctx, int i) { return ctx->infos[i].offset; } +char * gguf_get_tensor_name(struct gguf_context * ctx, int i) { + return ctx->infos[i].name.data; +} + //////////////////////////////////////////////////////////////////////////////// int ggml_cpu_has_avx(void) { diff --git a/ggml.h b/ggml.h index 98eee8c49165f8..ddd8af293aa609 100644 --- a/ggml.h +++ b/ggml.h @@ -1653,6 +1653,7 @@ extern "C" { GGML_API int gguf_get_n_tensors (struct gguf_context * ctx); GGML_API size_t gguf_get_tensor_offset(struct gguf_context * ctx, int i); + GGML_API char * gguf_get_tensor_name (struct gguf_context * ctx, int i); // // system info