From cf54e4e7671c814a8b31273bd3dbec4bf23c8217 Mon Sep 17 00:00:00 2001 From: Jan Krukowski Date: Sun, 17 Mar 2024 12:18:46 +0100 Subject: [PATCH 1/2] whisperkit-cli 0.4.0 (new formula) --- Formula/w/whisperkit-cli.rb | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Formula/w/whisperkit-cli.rb diff --git a/Formula/w/whisperkit-cli.rb b/Formula/w/whisperkit-cli.rb new file mode 100644 index 0000000000000..72ac73dd21ad1 --- /dev/null +++ b/Formula/w/whisperkit-cli.rb @@ -0,0 +1,38 @@ +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" + + depends_on xcode: ["15.0", :build] + depends_on arch: :arm64 + depends_on :macos + depends_on macos: :ventura + 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:" + end +end From 0e0847193e39dcfc704e04b5e6f2add37473ea17 Mon Sep 17 00:00:00 2001 From: Patrick Linnane Date: Mon, 18 Mar 2024 14:58:28 +0000 Subject: [PATCH 2/2] whisperkit-cli: add 0.4.0 bottle. --- Formula/w/whisperkit-cli.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Formula/w/whisperkit-cli.rb b/Formula/w/whisperkit-cli.rb index 72ac73dd21ad1..37e22d960102c 100644 --- a/Formula/w/whisperkit-cli.rb +++ b/Formula/w/whisperkit-cli.rb @@ -6,6 +6,11 @@ class WhisperkitCli < Formula 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