Skip to content

Commit d89533d

Browse files
committed
gguf : expose the gguf_type enum through the API for now
1 parent c85d317 commit d89533d

File tree

3 files changed

+14
-26
lines changed

3 files changed

+14
-26
lines changed

examples/gguf/gguf.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,6 @@
77
#include <fstream>
88
#include <vector>
99

10-
enum gguf_type {
11-
GGUF_TYPE_UINT8 = 0,
12-
GGUF_TYPE_INT8 = 1,
13-
GGUF_TYPE_UINT16 = 2,
14-
GGUF_TYPE_INT16 = 3,
15-
GGUF_TYPE_UINT32 = 4,
16-
GGUF_TYPE_INT32 = 5,
17-
GGUF_TYPE_FLOAT32 = 6,
18-
GGUF_TYPE_BOOL = 7,
19-
GGUF_TYPE_STRING = 8,
20-
GGUF_TYPE_ARRAY = 9,
21-
};
22-
2310
template<typename T>
2411
static std::string to_string(const T & val) {
2512
std::stringstream ss;

ggml.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18297,19 +18297,6 @@ size_t ggml_quantize_chunk(enum ggml_type type, const float * src, void * dst, i
1829718297

1829818298
////////////////////////////////////////////////////////////////////////////////
1829918299

18300-
enum gguf_type {
18301-
GGUF_TYPE_UINT8 = 0,
18302-
GGUF_TYPE_INT8 = 1,
18303-
GGUF_TYPE_UINT16 = 2,
18304-
GGUF_TYPE_INT16 = 3,
18305-
GGUF_TYPE_UINT32 = 4,
18306-
GGUF_TYPE_INT32 = 5,
18307-
GGUF_TYPE_FLOAT32 = 6,
18308-
GGUF_TYPE_BOOL = 7,
18309-
GGUF_TYPE_STRING = 8,
18310-
GGUF_TYPE_ARRAY = 9,
18311-
};
18312-
1831318300
struct gguf_str {
1831418301
uint32_t n;
1831518302
char * data;

ggml.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,6 +1619,20 @@ extern "C" {
16191619
// gguf
16201620
//
16211621

1622+
// TODO: can be removed if the API is extended for writing
1623+
enum gguf_type {
1624+
GGUF_TYPE_UINT8 = 0,
1625+
GGUF_TYPE_INT8 = 1,
1626+
GGUF_TYPE_UINT16 = 2,
1627+
GGUF_TYPE_INT16 = 3,
1628+
GGUF_TYPE_UINT32 = 4,
1629+
GGUF_TYPE_INT32 = 5,
1630+
GGUF_TYPE_FLOAT32 = 6,
1631+
GGUF_TYPE_BOOL = 7,
1632+
GGUF_TYPE_STRING = 8,
1633+
GGUF_TYPE_ARRAY = 9,
1634+
};
1635+
16221636
struct gguf_context;
16231637

16241638
struct gguf_init_params {

0 commit comments

Comments
 (0)