Roblox UtilitiesDevlHub Roblox Documentation

Class

MLService

NotCreatableServiceNotReplicated
Inherits
Instance › Object
Memory category
Instances

A service that runs in-engine machine learning inference by loading model bundles and creating inference sessions.

MLService loads machine learning model bundles and produces MLSession objects used to run inference on the client. It fetches a model asset and constructs a neural network session from the downloaded bundle, which the returned MLSession then executes.

Methods 1#

CreateSessionAsyncCreates an MLSession for the model bundle identified by the given asset ID.Yields

CreateSessionAsync(assetId: string): MLSession#

Yields

Fetches the model bundle identified by assetId, constructs a neural network session from it, and resolves with a MLSession wrapping that session. As a yield function, it returns only once the model has been downloaded and the session created; if the asset cannot be fetched or the bundle is invalid, it raises an error instead of returning a session.

NameTypeDefaultDescription
assetIdstringThe asset ID of the model bundle to load.
Returns

Inherited members#

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed