-
Notifications
You must be signed in to change notification settings - Fork 4.3k
whisper: add xcframework build script #2873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is just a minor change required for the validate scripts which are currently failing with the following error:
$ ./scripts/apple/validate-apps.sh
===== iOS Validation Process Started =====
Creating test iOS app project...
Copying XCFramework to test project...
Building and archiving test app...
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:iOS, arch:arm64, id:00008030-001A0C4611EB402E, name:Daniels iPhone }
{ platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:00008122-000258CA0180001C, name:My Mac }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
/Users/danbev/work/ai/whisper.cpp/validation-builds/ios/temp/iOSWhisperTest/iOSWhisperTest/Sources/ContentView.swift:20:35: error: value of type 'whisper_context_params' has no member 'n_ctx'
Text("n_ctx: \(params.n_ctx)")
~~~~~~ ^~~~~
note: Using codesigning identity override: -
** ARCHIVE FAILED **
===== iOS Validation Process Failed =====
I've left a comment with a suggestion.
Will this enable the swift package to work again without manually building via CMAKE? |
After the next release the xcframework should be available as an artifact in the release page. This will allow a swift project use the xframework like this: // swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "MyWhisperPackage",
targets: [
.executableTarget(
name: "MyWhisperPackage",
dependencies: [
"WhisperFramework"
]),
.binaryTarget(
name: "WhisperFramework",
url: "https://github.com/ggerganov/whisper.cpp/releases/download/bxxxx/whisper-bxxxx-xcframework.zip",
checksum: "<checksum>"
)
]
) In the mean time one option is to build the xcframework locally by running the $ cat Package.swift
// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "Whisper",
targets: [
.executableTarget(
name: "Whisper",
dependencies: [
"WhisperFramework"
]),
.binaryTarget(
name: "WhisperFramework",
path: "../../ai/whisper.cpp/build-apple/whisper.xcframework"
)
]
) |
Sorry I was wrong about this and we need to add the xcframework to the github releases first. This is tracked by #2886. |
* whisper: add xcframework build script * added apple validation scripts * fixed Readme * validation script fix
hi, currently this xcframework is not supporting Mac Catalyst, would you extend it to support it? |
This is adding xcframework support for Whisper; I followed the same strategy as the work done by @danbev on Llama ggml-org/llama.cpp#11996
I didn't yet ported the apple validation scripts; I'll have to check that part tomorrow but shouldn't be hard to add.UPDATE: the Apple Validation scripts are added. We should be good to go.