Instance Method

write(to:metadata:)

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

Declaration

func write(to fileURL: URL, metadata: MLModelMetadata? = nil) throws

Parameters

fileURL

The location in the file system to which the 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 file URL, creating any intermediate directories as needed. The framework automatically appends the .mlmodel extension to your file URL if you don’t explicitly specify it.

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

See Also

Saving a Sound Classifier

func write(toFile: String, metadata: MLModelMetadata?)

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