GGUFFiles
Documentation for GGUFFiles.
GGUFFiles.create_gguf — Methodcreate_gguf(file_path::String, header::GGUFHeader, metadata_kv::Vector{GGUFMetadataKV}, tensor_info::Vector{GGUFTensorInfo})Creates a GGUF file at the specified file path.
Arguments
file_path::String: The path to the GGUF file.header::GGUFHeader: The GGUF header.metadata_kv::Vector{GGUFMetadataKV}: The metadata key-value pairs.tensor_info::Vector{GGUFTensorInfo}: The tensor information.
GGUFFiles.isGGUFFile — MethodisGGUFFile(file_path::String)Checks if a given file is a GGUF file.
Arguments
file_path::String: The path to the file.
Returns
Bool: True if the file is a GGUF file, false otherwise.
GGUFFiles.parse_gguf — Methodparse_gguf(file_path::String)Parses a GGUF file from a given file path.
Arguments
file_path::String: The path to the GGUF file.
Returns
header::GGUFHeader: The GGUF header.metadata_kv::Vector{GGUFMetadataKV}: The metadata key-value pairs.tensor_info::Vector{GGUFTensorInfo}: The tensor information.
GGUFFiles.read_gguf_header — Methodread_gguf_header(io::IO)Reads the GGUF header from an IO stream.
Arguments
io::IO: The IO stream to read from.
Returns
GGUFHeader: The GGUF header.
GGUFFiles.read_gguf_metadata_kv — Methodread_gguf_metadata_kv(io::IO)Reads a metadata key-value pair from an IO stream.
Arguments
io::IO: The IO stream to read from.
Returns
GGUFMetadataKV: The metadata key-value pair.
GGUFFiles.read_gguf_tensor_info — Methodread_gguf_tensor_info(io::IO)Reads tensor information from an IO stream.
Arguments
io::IO: The IO stream to read from.
Returns
GGUFTensorInfo: The tensor information.
GGUFFiles.read_gguf_value — Methodread_gguf_value(io::IO, value_type::GGUFValueType)Reads a value from an IO stream based on its type.
Arguments
io::IO: The IO stream to read from.value_type::GGUFValueType: The type of the value to read.
Returns
Any: The value.
GGUFFiles.write_gguf_header — Methodwrite_gguf_header(io::IO, header::GGUFHeader)Writes the GGUF header to an IO stream.
Arguments
io::IO: The IO stream to write to.header::GGUFHeader: The GGUF header to write.
GGUFFiles.write_gguf_metadata_kv — Methodwrite_gguf_metadata_kv(io::IO, metadata_kv::GGUFMetadataKV)Writes a metadata key-value pair to an IO stream.
Arguments
io::IO: The IO stream to write to.metadata_kv::GGUFMetadataKV: The metadata key-value pair to write.
GGUFFiles.write_gguf_tensor_info — Methodwrite_gguf_tensor_info(io::IO, tensor_info::GGUFTensorInfo)Writes tensor information to an IO stream.
Arguments
io::IO: The IO stream to write to.tensor_info::GGUFTensorInfo: The tensor information to write.
GGUFFiles.write_gguf_value — Methodwrite_gguf_value(io::IO, value::Any, value_type::GGUFValueType)Writes a value to an IO stream based on its type.
Arguments
io::IO: The IO stream to write to.value::Any: The value to write.value_type::GGUFValueType: The type of the value.