Method ReadFromStream
ReadFromStream(Stream, bool)
Reads GGUF metadata from stream, starting at its current
position, which must be the GGUF magic. The stream position is not preserved.
public static GgufMetadata ReadFromStream(Stream stream, bool leaveOpen = true)
Parameters
streamStreamReadable, seekable stream positioned at the GGUF magic.
leaveOpenbooltrueto leavestreamopen after reading (the default);falseto dispose it.
Returns
- GgufMetadata
The parsed metadata.
Exceptions
- ArgumentNullException
streamis null.- ArgumentException
streamis not readable or not seekable.- InvalidModelException
The stream does not carry a valid GGUF v2/v3 payload, is truncated, or declares metadata that exceeds the safety ceilings.