Table of Contents

Method ValidateFormat

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

ValidateFormat(string, bool)

Validates the specified model file to ensure it adheres to a supported format, including verifying 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

Determines whether to throw an exception if the validation fails.

- If set to true, an InvalidDataException is thrown when the file does not conform to any supported model format. - If set to false, the method returns false instead of throwing an exception.

Returns

bool

true if the file is valid and conforms to a supported format; otherwise, false.

Exceptions

InvalidDataException

Thrown when the file does not conform to the expected format and throwException is set to true.