gguf : expose the gguf_type enum through the API for now

This commit is contained in:
Georgi Gerganov 2023-07-27 11:10:34 +03:00
parent c85d3178b3
commit d89533dff6
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735
3 changed files with 14 additions and 26 deletions

View File

@ -7,19 +7,6 @@
#include <fstream>
#include <vector>
enum gguf_type {
GGUF_TYPE_UINT8 = 0,
GGUF_TYPE_INT8 = 1,
GGUF_TYPE_UINT16 = 2,
GGUF_TYPE_INT16 = 3,
GGUF_TYPE_UINT32 = 4,
GGUF_TYPE_INT32 = 5,
GGUF_TYPE_FLOAT32 = 6,
GGUF_TYPE_BOOL = 7,
GGUF_TYPE_STRING = 8,
GGUF_TYPE_ARRAY = 9,
};
template<typename T>
static std::string to_string(const T & val) {
std::stringstream ss;

13
ggml.c
View File

@ -18297,19 +18297,6 @@ size_t ggml_quantize_chunk(enum ggml_type type, const float * src, void * dst, i
////////////////////////////////////////////////////////////////////////////////
enum gguf_type {
GGUF_TYPE_UINT8 = 0,
GGUF_TYPE_INT8 = 1,
GGUF_TYPE_UINT16 = 2,
GGUF_TYPE_INT16 = 3,
GGUF_TYPE_UINT32 = 4,
GGUF_TYPE_INT32 = 5,
GGUF_TYPE_FLOAT32 = 6,
GGUF_TYPE_BOOL = 7,
GGUF_TYPE_STRING = 8,
GGUF_TYPE_ARRAY = 9,
};
struct gguf_str {
uint32_t n;
char * data;

14
ggml.h
View File

@ -1619,6 +1619,20 @@ extern "C" {
// gguf
//
// TODO: can be removed if the API is extended for writing
enum gguf_type {
GGUF_TYPE_UINT8 = 0,
GGUF_TYPE_INT8 = 1,
GGUF_TYPE_UINT16 = 2,
GGUF_TYPE_INT16 = 3,
GGUF_TYPE_UINT32 = 4,
GGUF_TYPE_INT32 = 5,
GGUF_TYPE_FLOAT32 = 6,
GGUF_TYPE_BOOL = 7,
GGUF_TYPE_STRING = 8,
GGUF_TYPE_ARRAY = 9,
};
struct gguf_context;
struct gguf_init_params {