From 860c9c63ce204dea31fe994ef370c569f7a75596 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 f252363d9..030475062 100644 --- a/ggml.c +++ b/ggml.c @@ -18770,6 +18770,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 fac0f5e68..1a748d8d8 100644 --- a/ggml.h +++ b/ggml.h @@ -1670,6 +1670,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