Skip to content

Commit

Permalink
use ggml_tensor for storing GGUF data
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesGaessler committed Dec 2, 2024
1 parent e5fc9b2 commit 5441c04
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 190 deletions.
4 changes: 2 additions & 2 deletions include/ggml.h
Original file line number Diff line number Diff line change
Expand Up @@ -2139,7 +2139,7 @@ extern "C" {
GGML_API int gguf_get_n_tensors (const struct gguf_context * ctx);
GGML_API int gguf_find_tensor (const struct gguf_context * ctx, const char * name);
GGML_API size_t gguf_get_tensor_offset(const struct gguf_context * ctx, int i);
GGML_API char * gguf_get_tensor_name (const struct gguf_context * ctx, int i);
GGML_API const char * gguf_get_tensor_name (const struct gguf_context * ctx, int i);
GGML_API enum ggml_type gguf_get_tensor_type (const struct gguf_context * ctx, int i);

// removes key if it exists
Expand Down Expand Up @@ -2167,7 +2167,7 @@ extern "C" {
// manage tensor info
GGML_API void gguf_add_tensor(struct gguf_context * ctx, const struct ggml_tensor * tensor);
GGML_API void gguf_set_tensor_type(struct gguf_context * ctx, const char * name, enum ggml_type type);
GGML_API void gguf_set_tensor_data(struct gguf_context * ctx, const char * name, const void * data, size_t size);
GGML_API void gguf_set_tensor_data(struct gguf_context * ctx, const char * name, const void * data);

// writing gguf files can be done in 2 ways:
//
Expand Down
Loading

0 comments on commit 5441c04

Please sign in to comment.