NLModel won't initialize in MessageFilterExtension

i'm trying to create an NLModel within a MessageFilterExtension handler.

The code works fine in the main app, but when I try to use it in the extension it fails to initialize. Just this doesn't even work and gets the error below.

Single line that fails.
SMS_Classifier is the class xcode generated for my model. This line works fine in the main app.

let mlModel = try SMS_Classifier(configuration: MLModelConfiguration()).model

Error
Unable to locate Asset for contextual word embedding model for local en. MLModelAsset: load failed with error Error Domain=com.apple.CoreML Code=0 "initialization of text classifier model with model data failed" UserInfo={NSLocalizedDescription=initialization of text classifier model with model data failed}

Any ideas?

Anyone have any ideas or suggestions on this? I've mostly had to give up using both BERT and ELMo based models, but static models seems to work fine.

I'm experiencing something similar. I trained model using Create ML using French embeddings (polish not available). Application reports couple of errors:

MA-auto{_failedLockContent} | failure reported by server | error:[com.apple.MobileAssetError.AutoAsset:6503]
Unable to locate Asset for contextual word embedding model for local fr.

It can be reproduced using:
    if NLEmbedding.wordEmbedding(for: .french) == nil {
        print("EMBEDINGS NOT FOUND")
    } else {
        print("EMBEDINGS EXISTS")
    }

The server error also happens for polish language when I'm using alternative algorithm for which polish embeddings are available.

NLModel won't initialize in MessageFilterExtension
 
 
Q