Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

CoreML.CompileModel

Compiles a model file.

Component Version macOS Windows Linux Server iOS SDK
CoreML 7.4 ✅ Yes ❌ No ❌ No ✅ Yes, on macOS ✅ Yes
MBS( "CoreML.CompileModel"; Path )   More

Parameters

Parameter Description Example
Path The native file path to the model. "/Users/cs/Desktop/test.mlmodel"

Result

Returns OK or error.

Description

Compiles a model file.

This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.

Examples

Compile model when needed:

If [ Right ( CoreML::Model Path; 8 ) = ".mlmodel" ]
    Set Variable [ $r ; Value: MBS("CoreML.CompileModel"; CoreML::Model Path) ]
    If [ MBS("IsError") ]
        Show Custom Dialog [ "Failed to compile" ; $r ]
        Set Variable [ $$ML ; Value: "" ]
    Else
        Set Field [ CoreML::Model Path ; $r ]
    End If
End If

Compile a model:

MBS( "CoreML.CompileModel"; "/Users/cs/Desktop/UpdatableDrawingClassifier.mlmodel" )

See also

Example Databases

This function checks for a license.

Created 16th September 2017, last changed 16th December 2019


CoreML.Clear - CoreML.Description