GGUFFiles

Documentation for GGUFFiles.

GGUFFiles.create_ggufMethod
create_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.
source
GGUFFiles.isGGUFFileMethod
isGGUFFile(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.
source
GGUFFiles.parse_ggufMethod
parse_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.
source
GGUFFiles.read_gguf_headerMethod
read_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.
source
GGUFFiles.read_gguf_metadata_kvMethod
read_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.
source
GGUFFiles.read_gguf_tensor_infoMethod
read_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.
source
GGUFFiles.read_gguf_valueMethod
read_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.
source
GGUFFiles.write_gguf_headerMethod
write_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.
source
GGUFFiles.write_gguf_metadata_kvMethod
write_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.
source
GGUFFiles.write_gguf_tensor_infoMethod
write_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.
source
GGUFFiles.write_gguf_valueMethod
write_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.
source