Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions .github/workflows/development-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ jobs:
cancel-in-progress: true
uses: ./.github/workflows/unit-tests.yml
with:
ios-version: "18.6"
ios-device: "iPhone 16"
watchos-version: "11.5"
visionos-version: "2.5"
macos-runner: "macos-15"
ios-version: "26.1"
ios-device: "iPhone 17"
watchos-version: "26.1"
visionos-version: "26.1"
macos-runner: "macos-26"
xcode-version: "latest-stable"

check-approvals:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -50,18 +51,18 @@ jobs:
strategy:
matrix:
include:
- os: macos-13-xlarge
ios-version: "17.2"
ios-device: "iPhone 14"
watchos-version: "10.2"
visionos-version: "1.0"
xcode-version: "15.2"
- os: macos-14
ios-version: "17.2"
ios-device: "iPhone 15"
watchos-version: "10.2"
visionos-version: "1.0"
xcode-version: "15.2"
xcode-version: "16.1"
- os: macos-15
ios-version: "18.5"
ios-device: "iPhone 16"
watchos-version: "11.5"
visionos-version: "2.5"
xcode-version: "16.4"
uses: ./.github/workflows/unit-tests.yml
with:
macos-runner: ${{ matrix.os }}
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@ jobs:
strategy:
matrix:
include:
- os: macos-13-xlarge
ios-version: "17.2" # TODO: Download older simulators for macOS 13
ios-device: "iPhone 14"
watchos-version: "10.2"
visionos-version: "1.0"
xcode-version: "15.2"
- os: macos-14
ios-version: "17.5"
ios-device: "iPhone 15"
watchos-version: "10.2"
visionos-version: "1.0"
xcode-version: "15.4"
xcode-version: "16.1"
- os: macos-15
ios-version: "18.6" # Latest available version
ios-version: "18.5"
ios-device: "iPhone 16"
watchos-version: "11.5"
visionos-version: "2.5"
xcode-version: "16.4"
- os: macos-26
ios-version: "26.1"
ios-device: "iPhone 17"
watchos-version: "26.1"
visionos-version: "26.1"
macos-runner: "macos-26"
xcode-version: "latest-stable"
uses: ./.github/workflows/unit-tests.yml
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ jobs:
}
- {
name: "watchOS",
condition: "${{ inputs.macos-runner == 'macos-15' }}",
condition: "${{ inputs.macos-runner == 'macos-26' }}",
clean-destination: "generic/platform=watchOS",
test-destination: "platform=watchOS Simulator,OS=${{ inputs.watchos-version }},name=Apple Watch Ultra 2 (49mm)",
test-destination: "platform=watchOS Simulator,OS=${{ inputs.watchos-version }},name=Apple Watch Ultra 3 (49mm)",
}
- {
name: "visionOS",
condition: "${{ inputs.macos-runner == 'macos-15' }}",
condition: "${{ inputs.macos-runner == 'macos-26' }}",
clean-destination: "generic/platform=visionOS",
test-destination: "platform=visionOS Simulator,OS=${{ inputs.visionos-version }},name=Apple Vision Pro",
}
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
echo "Destinations for testing:"
xcodebuild test-without-building -testPlan UnitTestsPlan -scheme whisperkit-Package -showdestinations
- name: Boot Simulator and Wait
if: ${{ matrix.run-config['condition'] == true }} && ${{ matrix.run-config['name'] != 'macOS' }} && ${{ inputs.macos-runner == 'macos-15' }}
if: ${{ matrix.run-config['condition'] == true }} && ${{ matrix.run-config['name'] != 'macOS' }} && ${{ inputs.macos-runner == 'macos-26' }}
# Slower runners require some time to fully boot the simulator
# Parse the simulator name from the destination string, boot it, and wait
run: |
Expand Down
22 changes: 20 additions & 2 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let package = Package(
)
],
dependencies: [
.package(url: "https://github.com/huggingface/swift-transformers.git", .upToNextMinor(from: "0.1.8")),
.package(url: "https://github.com/huggingface/swift-transformers.git", .upToNextMinor(from: "1.1.2")),
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.3.0"),
] + (isServerEnabled() ? [
.package(url: "https://github.com/vapor/vapor.git", from: "4.115.1"),
Expand All @@ -36,19 +36,20 @@ let package = Package(
.target(
name: "WhisperKit",
dependencies: [
.product(name: "Transformers", package: "swift-transformers"),
.product(name: "Hub", package: "swift-transformers"),
.product(name: "Tokenizers", package: "swift-transformers"),
]
),
.testTarget(
name: "WhisperKitTests",
dependencies: [
"WhisperKit",
.product(name: "Transformers", package: "swift-transformers"),
.product(name: "Hub", package: "swift-transformers"),
.product(name: "Tokenizers", package: "swift-transformers"),
],
path: "Tests",
resources: [
.process("WhisperKitTests/Resources"),
.copy("Models/whisperkit-coreml"),
]
),
.executableTarget(
Expand All @@ -64,9 +65,9 @@ let package = Package(
path: "Sources/WhisperKitCLI",
exclude: (isServerEnabled() ? [] : ["Server"]),
swiftSettings: (isServerEnabled() ? [.define("BUILD_SERVER_CLI")] : [])

)
]
],
swiftLanguageVersions: [.v5]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not strictly needed, added for awareness for when we upgrade to swift-tools-version 6 at a later date.

)

func isServerEnabled() -> Bool {
Expand Down
19 changes: 10 additions & 9 deletions Sources/WhisperKit/Utilities/Extensions+Public.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ public extension String {
public extension MLMultiArray {
convenience init(shape: [NSNumber], dataType: MLMultiArrayDataType, initialValue: Any) throws {
switch dataType {
case .float16:
// IOSurface-backed arrays are implicitly float16. They can
// reduce buffer copies for some OS:compute unit combinations.
guard let pixelBuffer = Self.pixelBuffer(for: shape) else {
throw WhisperError.initializationError("MLMultiArray: Failed to initialize PixelBuffer")
}
self.init(pixelBuffer: pixelBuffer, shape: shape)
default:
try self.init(shape: shape, dataType: dataType)
case .float16:
// IOSurface-backed arrays are implicitly float16. They can
// reduce buffer copies for some OS:compute unit combinations.
guard let pixelBuffer = Self.pixelBuffer(for: shape) else {
throw WhisperError.initializationError("MLMultiArray: Failed to initialize PixelBuffer")
}
self.init(pixelBuffer: pixelBuffer, shape: shape)
default:
try self.init(shape: shape, dataType: dataType)
}

switch dataType {
Expand Down Expand Up @@ -303,3 +303,4 @@ public extension WhisperKit {
return ModelUtilities.formatModelFiles(modelFiles)
}
}

Loading