BaseModelParser

Abstract base class for model parsers that provides common functionality for validation, error handling, and tensor size calculations.

Subclasses must implement:

  • parseMetadata(filePath) - format-specific metadata parsing

  • supportedExtension - file extension for this format

  • format - the ModelFormat enum value

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun getModelInfo(): ModelInfo

Get general model information.

Link copied to clipboard
open suspend override fun getTensors(): List<TensorInfo>

Get list of tensors with their metadata.

Link copied to clipboard
open override fun isInitialized(): Boolean

Check if the parser has been initialized with a model.

Link copied to clipboard
open override fun isValid(): Boolean

Check if the last parsing attempt was successful.