char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
6c84c7d5d
char/aliceai-t5-moe
1#pragma once 2 3#include "gguf.h" 4#include "llama.h" 5#include "llama-arch.h" 6 7#include <vector> 8 9// FIXME temporary function for better error messages 10bool llama_model_saver_supports_arch (llm_arch arch ); 11 12struct llama_model_saver { 13struct gguf_context * gguf_ctx = nullptr; 14const bool gguf_ctx_owned ; 15const struct llama_model * model ; 16const struct LLM_KV llm_kv ; 17 18llama_model_saver (const struct llama_model * model ); 19llama_model_saver (enum llm_arch arch ,struct gguf_context * gguf_ctx ); 20 ~llama_model_saver (); 21 22void add_kv ( enum llm_kv key , uint32_t value ); 23void add_kv ( enum llm_kv key , int32_t value ); 24void add_kv ( enum llm_kv key , uint64_t value ); 25void add_kv ( enum llm_kv key , float value ); 26void add_kv ( enum llm_kv key , bool value ); 27void add_kv ( enum llm_kv key , const char * value ); 28 29[[ noreturn ]] 30void add_kv ( enum llm_kv key , char value ); // needed to make the template below compile 31 32template < typename Container > 33void add_kv ( enum llm_kv key , const Container & value , bool per_layer = false); 34 35void add_kv ( enum llm_kv key , const std:: vector < std :: string > & value ); 36 37void add_tensor ( const struct ggml_tensor * tensor ); 38 39void add_kv_from_model (); 40 41void add_tensors_from_model (); 42 43void save ( const std:: string & path_model ); 44void save (FILE * file ); 45};