From 480a067396083d62f77e46c4ccdab4dfb65c9fe2 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Wed, 26 Jul 2023 16:36:03 +0300 Subject: [PATCH] gguf : add gguf_get_tensor_name() --- ggml.c | 4 ++++ ggml.h | 1 + 2 files changed, 5 insertions(+) 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