Post

Replies

Boosts

Views

Activity

Reply to Using Core ML in a .swiftpm file
@moto_coreml_apple Hey, thanks for your reply! Unfortunately, it seems like I might be doing something differently or wrong. First, my .swiftpm file doesn’t have a Sources folder; it only has a Resources folder. When I tried running the command: cp -r /tmp/model.mlmodelc /path/to/My.swiftpmFile/Sources/RandomFolder/ I got an error saying that the path is invalid. Even when I tried replacing Sources with Resources, it didn’t work either. So, I attempted to create a Sources folder manually, and inside it, I created a subfolder named NumbersModel where I placed both my .mlmodelc and .swift files. However, the issue persists. Additionally, my package file is slightly different from yours. Here’s how it looks: targets: [ .executableTarget( name: "AppModule", path: ".", resources: [ .copy("Resources/MyModel.mlmodelc") ], swiftSettings: [ .enableUpcomingFeature("BareSlashRegexLiterals") ] ) ] Whereas, yours seems like this: targets: [ .target( name: "ModelInSwiftPackage", resources: [ .copy("model.mlmodelc") ] ) ] I’m still facing the same problem and would really appreciate any guidance. Do you think I might be missing something, or is there another step I should be taking? Let me know if you need any more details. Thanks in advance!
2d