Instance Method

write(toFile:metadata:)

Exports a Core ML model file for use in your app.

Declaration

func write(toFile path: String, metadata: MLModelMetadata? = nil) throws

Parameters

path

A file system path where the model file should be written.

metadata

Descriptive information to include with the exported model file.

Discussion

This method writes the Core ML model to the specified path, creating intermediate directories as needed and expanding any tildes (~) in the path.

If the path you specify is a directory path, the framework writes the model to that directory with the name SoundClassifier.mlmodel.

See Also

Saving a Sound Classifier

func write(to: URL, metadata: MLModelMetadata?)

Exports a Core ML model file for use in your app.