Table of Contents

Method CreateFileDataSource

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

CreateFileDataSource(string, string, LM, MetadataCollection)

Creates a new file-backed DataSource instance with the specified identifier and language model. This method creates a new file at the given path and opens it with read-write access. The resulting DataSource is initially created in-memory and then associated with the backing file stream, enabling future updates to be synchronized with the file.

public static DataSource CreateFileDataSource(string path, string identifier, LM model, MetadataCollection metadata = null)

Parameters

path string

The file path where the data source will be created. This must be a valid path and the file must not already exist.

identifier string

The unique identifier for the data source.

model LM

The language model associated with the data source.

metadata MetadataCollection

Optional metadata to be associated with the data source.

Returns

DataSource

A new DataSource instance that is backed by a file.

Exceptions

ArgumentNullException

Thrown if path is null, empty, or consists solely of white-space characters.