Class
MLService
NotCreatableServiceNotReplicated
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#
| CreateSessionAsync | Creates 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.
| Name | Type | Default | Description |
|---|---|---|---|
assetId | string | The asset ID of the model bundle to load. |
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild