Table of Contents

Method ValidateFormat

Namespace
LMKit.Model
Assembly
LM-Kit.NET.dll

ValidateFormat(string, bool)

Validates the model file to ensure it conforms to the GGUF format, including its header and overall structure.

public static bool ValidateFormat(string modelPath, bool throwException = false)

Parameters

modelPath string

The file path of the model to validate.

throwException bool

Indicates whether to throw an exception if the validation fails. If set to true, an InvalidDataException will be thrown when the file does not match the GGUF format. If set to false, the method will return false instead.

Returns

bool

Returns true if the file is valid and conforms to the GGUF format; otherwise, false.

Exceptions

InvalidDataException

Thrown when the file integrity not match the expected GGUF format and throwException is set to true.