@@ -2258,30 +2258,22 @@ extern "C" {
22582258 //
22592259
22602260 enum gguf_type {
2261- GGUF_TYPE_UINT8 = 0 ,
2262- GGUF_TYPE_INT8 = 1 ,
2263- GGUF_TYPE_UINT16 = 2 ,
2264- GGUF_TYPE_INT16 = 3 ,
2265- GGUF_TYPE_UINT32 = 4 ,
2266- GGUF_TYPE_INT32 = 5 ,
2267- GGUF_TYPE_FLOAT32 = 6 ,
2268- GGUF_TYPE_BOOL = 7 ,
2269- GGUF_TYPE_STRING = 8 ,
2270- GGUF_TYPE_ARRAY = 9 ,
2271- GGUF_TYPE_UINT64 = 10 ,
2272- GGUF_TYPE_INT64 = 11 ,
2273- GGUF_TYPE_FLOAT64 = 12 ,
2274- GGUF_TYPE_NAMEDOBJECT = 13 ,
2261+ GGUF_TYPE_UINT8 = 0 ,
2262+ GGUF_TYPE_INT8 = 1 ,
2263+ GGUF_TYPE_UINT16 = 2 ,
2264+ GGUF_TYPE_INT16 = 3 ,
2265+ GGUF_TYPE_UINT32 = 4 ,
2266+ GGUF_TYPE_INT32 = 5 ,
2267+ GGUF_TYPE_FLOAT32 = 6 ,
2268+ GGUF_TYPE_BOOL = 7 ,
2269+ GGUF_TYPE_STRING = 8 ,
2270+ GGUF_TYPE_ARRAY = 9 ,
2271+ GGUF_TYPE_UINT64 = 10 ,
2272+ GGUF_TYPE_INT64 = 11 ,
2273+ GGUF_TYPE_FLOAT64 = 12 ,
22752274 GGUF_TYPE_COUNT , // marks the end of the enum
22762275 };
22772276
2278- struct gguf_nobj {
2279- uint64_t nname ;
2280- char * name ;
2281- uint64_t n ;
2282- char * data ;
2283- };
2284-
22852277 struct gguf_context ;
22862278
22872279 struct gguf_init_params {
@@ -2311,27 +2303,24 @@ extern "C" {
23112303 GGML_API enum gguf_type gguf_get_kv_type (const struct gguf_context * ctx , int key_id );
23122304 GGML_API enum gguf_type gguf_get_arr_type (const struct gguf_context * ctx , int key_id );
23132305
2314- GGML_API struct gguf_nobj gguf_find_name_nobj (const struct gguf_context * ctx , const char * name );
2315-
23162306 // will abort if the wrong type is used for the key
2317- GGML_API uint8_t gguf_get_val_u8 (const struct gguf_context * ctx , int key_id );
2318- GGML_API int8_t gguf_get_val_i8 (const struct gguf_context * ctx , int key_id );
2319- GGML_API uint16_t gguf_get_val_u16 (const struct gguf_context * ctx , int key_id );
2320- GGML_API int16_t gguf_get_val_i16 (const struct gguf_context * ctx , int key_id );
2321- GGML_API uint32_t gguf_get_val_u32 (const struct gguf_context * ctx , int key_id );
2322- GGML_API int32_t gguf_get_val_i32 (const struct gguf_context * ctx , int key_id );
2323- GGML_API float gguf_get_val_f32 (const struct gguf_context * ctx , int key_id );
2324- GGML_API uint64_t gguf_get_val_u64 (const struct gguf_context * ctx , int key_id );
2325- GGML_API int64_t gguf_get_val_i64 (const struct gguf_context * ctx , int key_id );
2326- GGML_API double gguf_get_val_f64 (const struct gguf_context * ctx , int key_id );
2327- GGML_API bool gguf_get_val_bool (const struct gguf_context * ctx , int key_id );
2328- GGML_API const char * gguf_get_val_str (const struct gguf_context * ctx , int key_id );
2329- GGML_API struct gguf_nobj gguf_get_val_nobj (const struct gguf_context * ctx , int key_id );
2330- GGML_API const void * gguf_get_val_data (const struct gguf_context * ctx , int key_id );
2331- GGML_API int gguf_get_arr_n (const struct gguf_context * ctx , int key_id );
2332- GGML_API const void * gguf_get_arr_data (const struct gguf_context * ctx , int key_id );
2333- GGML_API const char * gguf_get_arr_str (const struct gguf_context * ctx , int key_id , int i );
2334- GGML_API struct gguf_nobj gguf_get_arr_nobj (const struct gguf_context * ctx , int key_id , int i );
2307+ GGML_API uint8_t gguf_get_val_u8 (const struct gguf_context * ctx , int key_id );
2308+ GGML_API int8_t gguf_get_val_i8 (const struct gguf_context * ctx , int key_id );
2309+ GGML_API uint16_t gguf_get_val_u16 (const struct gguf_context * ctx , int key_id );
2310+ GGML_API int16_t gguf_get_val_i16 (const struct gguf_context * ctx , int key_id );
2311+ GGML_API uint32_t gguf_get_val_u32 (const struct gguf_context * ctx , int key_id );
2312+ GGML_API int32_t gguf_get_val_i32 (const struct gguf_context * ctx , int key_id );
2313+ GGML_API float gguf_get_val_f32 (const struct gguf_context * ctx , int key_id );
2314+ GGML_API uint64_t gguf_get_val_u64 (const struct gguf_context * ctx , int key_id );
2315+ GGML_API int64_t gguf_get_val_i64 (const struct gguf_context * ctx , int key_id );
2316+ GGML_API double gguf_get_val_f64 (const struct gguf_context * ctx , int key_id );
2317+ GGML_API bool gguf_get_val_bool (const struct gguf_context * ctx , int key_id );
2318+ GGML_API const char * gguf_get_val_str (const struct gguf_context * ctx , int key_id );
2319+ GGML_API uint64_t gguf_get_val_str_len (const struct gguf_context * ctx , int key_id );
2320+ GGML_API const void * gguf_get_val_data (const struct gguf_context * ctx , int key_id );
2321+ GGML_API int gguf_get_arr_n (const struct gguf_context * ctx , int key_id );
2322+ GGML_API const void * gguf_get_arr_data (const struct gguf_context * ctx , int key_id );
2323+ GGML_API const char * gguf_get_arr_str (const struct gguf_context * ctx , int key_id , int i );
23352324
23362325 GGML_API int gguf_get_n_tensors (const struct gguf_context * ctx );
23372326 GGML_API int gguf_find_tensor (const struct gguf_context * ctx , const char * name );
@@ -2355,10 +2344,9 @@ extern "C" {
23552344 GGML_API void gguf_set_val_f64 (struct gguf_context * ctx , const char * key , double val );
23562345 GGML_API void gguf_set_val_bool (struct gguf_context * ctx , const char * key , bool val );
23572346 GGML_API void gguf_set_val_str (struct gguf_context * ctx , const char * key , const char * val );
2358- GGML_API void gguf_set_val_nobj (struct gguf_context * ctx , const char * key , const char * name , const int len , const void * val );
2347+ GGML_API void gguf_set_val_data (struct gguf_context * ctx , const char * key , const char * val , int n );
23592348 GGML_API void gguf_set_arr_data (struct gguf_context * ctx , const char * key , enum gguf_type type , const void * data , int n );
23602349 GGML_API void gguf_set_arr_str (struct gguf_context * ctx , const char * key , const char * * data , int n );
2361- GGML_API void gguf_set_arr_nobj (struct gguf_context * ctx , const char * key , const struct gguf_nobj * data , int n );
23622350
23632351 // set or add KV pairs from another context
23642352 GGML_API void gguf_set_kv (struct gguf_context * ctx , struct gguf_context * src );
0 commit comments