Session
The First Step in Making Predictions
NatML exposes the Session
type for managing prediction sessions with a given Predictor
:
Sessions created for EDGE
predictors can be cached on-device, allowing a single session to be used across the lifetime of an app install.
Sessions should only be cached on the device that created the session. A single session will not work across different devices.
Identifying the Session
Sessions are uniquely identified with an id
. This id
can be used in mutations that require specifying a session
.
Inspecting the Predictor
Sessions are always bound to a Predictor
.
Inspecting the Platform
Sessions are always created for a specific Device
which specifies its platform
:
Platform
The platform
can be used to infer the format of the model graph that is served to the device.
Fetching the Model Graph
Sessions contain a pre-signed URL to the model graph. This graph should be downloaded by the client and used to create an on-device inference session.
The format of the model graph will vary depending on the device platform.
The graph
URL is valid for 10 minutes, so use it to fetch the model graph immediately.
Inspecting the Graph Format
Sessions provide information about the format of the returned graph.
Graph Format
NatML automatically converts uploaded ML models and delivers the correct format for a given platform
.
Last updated