argmaxinc / WhisperKit

On-device Speech Recognition for Apple Silicon
https://takeargmax.com/blog/whisperkit
MIT License
3.17k stars 268 forks source link

Dependency issue with v0.2.0 #21

Closed sleeper closed 7 months ago

sleeper commented 7 months ago

Seems like I cannot resolve the packages correctly with 0.20:

swift package update                                                                                                               🌱 main 📝 ×3 via 🐦 v5.9.2
Updating https://github.com/apple/swift-argument-parser
Updating https://github.com/argmaxinc/whisperkit
Updated https://github.com/argmaxinc/whisperkit (0.43s)
Updated https://github.com/apple/swift-argument-parser (0.43s)
Computing version for https://github.com/argmaxinc/whisperkit
error: Dependencies could not be resolved because root depends on 'whisperkit' 0.2.0..<1.0.0.
'whisperkit' >= 0.2.0 cannot be used because no versions of 'whisperkit' match the requirement 0.2.1..<1.0.0 and package 'whisperkit' is required using a stable-version but 'whisperkit' depends on an unstable-version package 'swift-transformers'.

The doc on SPM dependencies says:

packages which use commit-based dependency requirements can't be added as dependencies to packages that use version-based dependency requirements

ZachNagengast commented 7 months ago

Thanks for reporting, looking into this - how does your Package.swift look?

sleeper commented 7 months ago

Here it is:

import PackageDescription

let package = Package(
    name: "s2t",
    platforms: [.macOS(.v14)],
    products: [
        .executable(name: "s2t", targets: ["s2t"])
    ],
    dependencies: [
        .package(url: "https://github.com/apple/swift-argument-parser", from: "1.3.0"),
        .package(url: "https://github.com/argmaxinc/whisperkit", from: "0.2.0"),
    ],
    targets: [
        // Targets are the basic building blocks of a package, defining a module or a test suite.
        // Targets can depend on other targets in this package and products from dependencies.
        .executableTarget(
            name: "s2t",
            dependencies: [
                .product(name: "ArgumentParser", package: "swift-argument-parser"),
                .product(name: "WhisperKit", package: "whisperkit")
            ],
            path: "Sources"
        ),
    ]
)
s

I'm new to Swift so it may be an issue on my side :/

ZachNagengast commented 7 months ago

This looks ok, I'll update shortly to 0.2.1 with a fix for this

sleeper commented 7 months ago

Thanks!

ZachNagengast commented 7 months ago

@sleeper Just updated with v0.2.1, can you give it a try?

sleeper commented 7 months ago

Working great! :

Working copy of https://github.com/argmaxinc/whisperkit resolved at 0.2.1

Many thanks !