Skip to content
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

whisperkit-cli 0.4.0 (new formula) #166391

Merged
merged 2 commits into from Mar 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
43 changes: 43 additions & 0 deletions Formula/w/whisperkit-cli.rb
@@ -0,0 +1,43 @@
class WhisperkitCli < Formula
desc "Swift native on-device speech recognition with Whisper for Apple Silicon"
homepage "https://github.com/argmaxinc/WhisperKit"
url "https://github.com/argmaxinc/WhisperKit.git",
tag: "v0.4.0",
revision: "59cb8516c708e3e2f18198002600026b5a1135ca"
license "MIT"

bottle do
sha256 cellar: :any_skip_relocation, arm64_sonoma: "6abaf4c40cab1995dfb0ca8f91fd61c7099f69ea1d4159a81a4d05ac9c55c297"
sha256 cellar: :any_skip_relocation, arm64_ventura: "4a373194bfcc4304ff3763763f8de3d3ceb62a57ec7f27433cf3e1d45cd51df2"
end

depends_on xcode: ["15.0", :build]
depends_on arch: :arm64
depends_on :macos
depends_on macos: :ventura
p-linnane marked this conversation as resolved.
Show resolved Hide resolved
uses_from_macos "swift"

def install
system "swift", "build", "-c", "release", "--product", "whisperkit-cli", "--disable-sandbox"
bin.install ".build/release/whisperkit-cli"
end

test do
mkdir_p "#{testpath}/tokenizer"
mkdir_p "#{testpath}/model"
whisperkit_command = [
"#{bin}/whisperkit-cli",
"transcribe",
"--model",
"tiny",
"--download-model-path",
"#{testpath}/model",
"--download-tokenizer-path",
"#{testpath}/tokenizer",
"--audio-path",
test_fixtures("test.mp3"),
"--verbose",
].join(" ")
assert_includes shell_output(whisperkit_command), "Transcription:"
MikeMcQuaid marked this conversation as resolved.
Show resolved Hide resolved
end
end