Created
June 2, 2025 10:34
-
-
Save jacobsapps/f88422c45176d4a727c67809ac4acd2a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
func loadCLIPModelAndEmbeddings() { | |
let defaultConfig = MLModelConfiguration() | |
let modelURL = Bundle.main.url(forResource: "mobileclip_blt_image", withExtension: "mlmodelc")! | |
let imageClassifierModel = try! MLModel(contentsOf: modelURL, configuration: defaultConfig) | |
self.imageClassifierVisionModel = try? VNCoreMLModel(for: imageClassifierModel)! | |
let statsURL = Bundle.main.url(forResource: "stats_embeddings", withExtension: "json")! | |
let statsData = try! Data(contentsOf: statsURL) | |
self.statsEmbeddings = try! JSONDecoder().decode([StatEmbedding].self, from: statsData) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment