Created
May 26, 2021 05:50
-
-
Save iosdevie/cae9a7dd9e9b6bd70664dec188de975d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func loadModel(url: URL) -> MLModel? { | |
do { | |
let config = MLModelConfiguration() | |
config.computeUnits = .all | |
return try MLModel(contentsOf: url, configuration: config) | |
} catch { | |
print("Error loading model: \(error)") | |
return nil | |
} | |
} | |
let modelURL = Bundle.main.url(forResource: "CatDogUpdatable", withExtension: "mlmodelc") | |
let updatableModel = loadModel(url: modelURL) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment