Skip to main content

train

train(wait?, pollInterval?): Promise<void>

Train the model. Training updates the model parameters based on the attached data.

Parameters

NameTypeDefault valueDescription
waitbooleantrueWhether to wait for the model to finish training.
pollIntervalnumber0.2The interval at which to poll the server for the model status.

Returns

Promise<void>

Promise that resolves when the model has been trained.

Throws

If the server request fails.

Example

const model = await client.getModel('test-model');
await model.train();