|
TinyLlama.cpp 1.0
A lightweight C++ implementation of the TinyLlama language model
|
Complete representation of a GGUF file's contents. More...
#include <gguf_structs.h>

Public Member Functions | |
| GGUFData () | |
| ~GGUFData () | |
| GGUFData (const GGUFData &)=delete | |
| GGUFData & | operator= (const GGUFData &)=delete |
| GGUFData (GGUFData &&other) noexcept | |
| GGUFData & | operator= (GGUFData &&other) noexcept |
Public Attributes | |
| GGUFHeader | header |
| std::map< std::string, GGUFMetadataValue > | metadata |
| std::vector< GGUFTensorInfo > | tensor_infos |
| std::map< std::string, GGUFTensorInfo > | tensor_infos_map |
| std::vector< std::string > | tokenizer_tokens |
| std::vector< float > | tokenizer_scores |
| std::vector< uint32_t > | tokenizer_token_types |
| std::vector< std::string > | tokenizer_merges |
| int | file_descriptor = -1 |
| void * | mapped_tensor_data = nullptr |
| size_t | mapped_tensor_data_size = 0 |
| uint64_t | data_alignment = 32 |
| size_t | offset_diff_for_mmap = 0 |
| std::vector< uint8_t > | tensor_data |
Static Public Attributes | |
| static const void * | MMapFailure = MAP_FAILED |
Complete representation of a GGUF file's contents.
This structure contains all the data from a GGUF file, including header information, metadata, tensor information, and the actual tensor data. It also includes tokenizer-specific data that may be present in the file.
Definition at line 80 of file gguf_structs.h.
|
inline |
Definition at line 111 of file gguf_structs.h.
|
inline |
Definition at line 117 of file gguf_structs.h.
References file_descriptor, mapped_tensor_data, mapped_tensor_data_size, MMapFailure, and offset_diff_for_mmap.
|
delete |
|
inlinenoexcept |
Definition at line 149 of file gguf_structs.h.
Definition at line 183 of file gguf_structs.h.
References data_alignment, file_descriptor, header, mapped_tensor_data, mapped_tensor_data_size, metadata, MMapFailure, offset_diff_for_mmap, tensor_data, tensor_infos, tensor_infos_map, tokenizer_merges, tokenizer_scores, tokenizer_token_types, and tokenizer_tokens.
| uint64_t GGUFData::data_alignment = 32 |
Alignment requirement for tensor data
Definition at line 103 of file gguf_structs.h.
Referenced by load_gguf_meta(), and operator=().
| int GGUFData::file_descriptor = -1 |
File descriptor for POSIX mmap
Definition at line 94 of file gguf_structs.h.
Referenced by load_gguf_meta(), operator=(), and ~GGUFData().
| GGUFHeader GGUFData::header |
File header
Definition at line 81 of file gguf_structs.h.
Referenced by load_gguf_meta(), and operator=().
| void* GGUFData::mapped_tensor_data = nullptr |
Pointer to memory-mapped tensor data block
Definition at line 101 of file gguf_structs.h.
Referenced by TinyLlamaModel::initialize_weights(), load_gguf_meta(), operator=(), and ~GGUFData().
| size_t GGUFData::mapped_tensor_data_size = 0 |
Size of the mapped tensor data block in bytes
Definition at line 102 of file gguf_structs.h.
Referenced by load_gguf_meta(), operator=(), and ~GGUFData().
| std::map<std::string, GGUFMetadataValue> GGUFData::metadata |
Metadata key-value pairs
Definition at line 82 of file gguf_structs.h.
Referenced by load_gguf_meta(), operator=(), parse_model_config_from_gguf(), and Tokenizer::Tokenizer().
|
static |
POSIX mmap failure indicator - DECLARED here, DEFINED in .cpp
Definition at line 95 of file gguf_structs.h.
Referenced by load_gguf_meta(), operator=(), and ~GGUFData().
| size_t GGUFData::offset_diff_for_mmap = 0 |
Difference between aligned mmap offset and actual data start
Definition at line 104 of file gguf_structs.h.
Referenced by load_gguf_meta(), operator=(), and ~GGUFData().
| std::vector<uint8_t> GGUFData::tensor_data |
Tensor data loaded into memory (non-mmap mode)
Definition at line 107 of file gguf_structs.h.
Referenced by TinyLlamaModel::initialize_weights(), load_gguf_meta(), and operator=().
| std::vector<GGUFTensorInfo> GGUFData::tensor_infos |
List of tensor information
Definition at line 83 of file gguf_structs.h.
Referenced by load_gguf_meta(), and operator=().
| std::map<std::string, GGUFTensorInfo> GGUFData::tensor_infos_map |
Map of tensor names to information
Definition at line 84 of file gguf_structs.h.
Referenced by load_gguf_meta(), and operator=().
| std::vector<std::string> GGUFData::tokenizer_merges |
BPE merge rules
Definition at line 90 of file gguf_structs.h.
Referenced by load_gguf_meta(), operator=(), parse_model_config_from_gguf(), and Tokenizer::Tokenizer().
| std::vector<float> GGUFData::tokenizer_scores |
Token scores for BPE
Definition at line 88 of file gguf_structs.h.
Referenced by load_gguf_meta(), operator=(), and Tokenizer::Tokenizer().
| std::vector<uint32_t> GGUFData::tokenizer_token_types |
Token type information
Definition at line 89 of file gguf_structs.h.
Referenced by load_gguf_meta(), operator=(), and Tokenizer::Tokenizer().
| std::vector<std::string> GGUFData::tokenizer_tokens |
Vocabulary tokens
Definition at line 87 of file gguf_structs.h.
Referenced by load_gguf_meta(), operator=(), and Tokenizer::Tokenizer().