Documentation
¶
Index ¶
Constants ¶
View Source
const ( QuantizationUnknown = "unknown" QuantizationMixed = "mixed" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct {
Metadata map[string]interface{}
Tensors map[string]TensorInfo
}
Header represents the JSON header in a safetensors file
func ParseSafetensorsHeader ¶
ParseSafetensorsHeader reads only the header from a safetensors file without loading the entire file. This is memory-efficient for large model files (which can be many GB).
Safetensors format:
[8 bytes: header length (uint64, little-endian)] [N bytes: JSON header] [remaining: tensor data]
func (*Header) CalculateParameters ¶
CalculateParameters sums up all tensor parameters
func (*Header) ExtractMetadata ¶
ExtractMetadata converts header to string map (similar to GGUF)
func (*Header) GetQuantization ¶
GetQuantization determines the quantization type from tensor dtypes
type TensorInfo ¶
TensorInfo contains information about a tensor
Click to show internal directories.
Click to hide internal directories.