From ce48b2032a6c294a9258978aaaff9a9f811b9d9c Mon Sep 17 00:00:00 2001 From: Mike Malburg Date: Wed, 1 May 2024 16:47:20 -0400 Subject: [PATCH 1/4] Update whisper.cpp to 1.6.2 --- custom-ports/whispercpp/portfile.cmake | 4 ++-- custom-ports/whispercpp/vcpkg.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/custom-ports/whispercpp/portfile.cmake b/custom-ports/whispercpp/portfile.cmake index f9849c92..07bd750d 100644 --- a/custom-ports/whispercpp/portfile.cmake +++ b/custom-ports/whispercpp/portfile.cmake @@ -2,8 +2,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ggerganov/whisper.cpp - REF e72e4158debb04126a0fabedf0452a5551780ea0 - SHA512 67939e665542931a75a5ea05a873e5e0a73fc18b443720bcfeb340eb7e39818937c0078976320d9799f0643d8759a64adcb2da371e072f1053232802c1c107af + REF "v${VERSION}" + SHA512 17e0485fb93fdea1a89f584a64db35f05371e0b8710a539f0dffca30bd3a2fff44c72ea754556566ca3cc55415b1e8f2bb868665437f5c93b9ce666b4fe53fb3 HEAD_REF master ) diff --git a/custom-ports/whispercpp/vcpkg.json b/custom-ports/whispercpp/vcpkg.json index 9e6fc7a6..2964dbef 100644 --- a/custom-ports/whispercpp/vcpkg.json +++ b/custom-ports/whispercpp/vcpkg.json @@ -1,6 +1,6 @@ { "name": "whispercpp", - "version": "1.5.4", + "version": "1.6.2", "port-version": 1, "description": "A high-performance inference of OpenAI's Whisper automatic speech recognition (ASR) model.", "homepage": "https://github.com/ggerganov/whisper.cpp", From fef9c971a2058966e34d3034b5a49d5b10ffbc02 Mon Sep 17 00:00:00 2001 From: Mike Malburg Date: Thu, 2 May 2024 16:16:33 -0400 Subject: [PATCH 2/4] Remove dylib symlinks for whispercpp whispercpp 1.5.5 now has dylib symlinks. We will remove those so that we just end up with libwhisper.dylib in our package. --- custom-steps/whispercpp/post-build.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/custom-steps/whispercpp/post-build.ps1 b/custom-steps/whispercpp/post-build.ps1 index 82fddc51..c89bd2a0 100644 --- a/custom-steps/whispercpp/post-build.ps1 +++ b/custom-steps/whispercpp/post-build.ps1 @@ -11,6 +11,9 @@ if(-not (Get-Module -Name $moduleName)) { Import-Module "$ModulesRoot/$moduleName" -Force -DisableNameChecking } -if((Get-IsOnWindowsOS)) { +if ((Get-IsOnMacOS)) { + Remove-DylibSymlinks -BuildArtifactsPath $BuildArtifactsPath +} +elseif((Get-IsOnWindowsOS)) { Update-VersionInfoForDlls -buildArtifactsPath $buildArtifactsPath -versionInfoJsonPath "$PSScriptRoot/version-info.json" -} \ No newline at end of file +} From 057577a70ff6a548059d0de37cb63bf3e4a2219c Mon Sep 17 00:00:00 2001 From: Mike Malburg Date: Fri, 7 Jun 2024 12:27:03 -0400 Subject: [PATCH 3/4] Embed Metal library source (ggml-metal.metal) into binary This does 3 things: 1. Updates deprecated `vcpkg_configure_cmake` to `vcpkg_cmake_configure`, which uses ninja by default 2. Update whisper metal lib (ex. ggml-metal.metal) to be embedded into the bin on Mac. See: https://github.com/ggerganov/whisper.cpp/commit/163e74b6c362dd1e0ccb2a0cd6e32bce90f2b413 3. Suppress spammy debugging output at runtime, related to metal. See: https://github.com/ggerganov/whisper.cpp/blob/87acd6d629461ff48c3d58a504ea797736d4b070/CMakeLists.txt#L183-L185 and https://github.com/ggerganov/whisper.cpp/blob/87acd6d629461ff48c3d58a504ea797736d4b070/ggml-metal.m#L289-L296 This should get rid of these errors we were seeing when running SpeechToTextLib on Macs: - `could not use bundle path to find ggml-metal.metal, falling back to trying cwd` - `The file "ggml-metal.metal" couldn't be opened because there is no such file` --- custom-ports/whispercpp/portfile.cmake | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/custom-ports/whispercpp/portfile.cmake b/custom-ports/whispercpp/portfile.cmake index 07bd750d..2d3f6eb0 100644 --- a/custom-ports/whispercpp/portfile.cmake +++ b/custom-ports/whispercpp/portfile.cmake @@ -7,10 +7,18 @@ vcpkg_from_github( HEAD_REF master ) -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA -) +if(APPLE) + vcpkg_cmake_configure( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DWHISPER_METAL_EMBED_LIBRARY=ON + -DWHISPER_METAL_NDEBUG=ON + ) +else() + vcpkg_cmake_configure( + SOURCE_PATH ${SOURCE_PATH} + ) +endif() vcpkg_install_cmake() vcpkg_copy_pdbs() From 657ebd6f44a9c294fef77b8eac82147b0e44ca96 Mon Sep 17 00:00:00 2001 From: Mike Malburg Date: Fri, 7 Jun 2024 12:34:43 -0400 Subject: [PATCH 4/4] Update dll metadata for Windows - Update version metadata to 1.6.2 - Update description metadata from: https://github.com/ggerganov/whisper.cpp/blob/v1.6.2/README.md - Update copyright metadata from: https://github.com/ggerganov/whisper.cpp/blob/v1.6.2/LICENSE --- custom-steps/whispercpp/version-info.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom-steps/whispercpp/version-info.json b/custom-steps/whispercpp/version-info.json index cc307770..9faae8eb 100644 --- a/custom-steps/whispercpp/version-info.json +++ b/custom-steps/whispercpp/version-info.json @@ -2,11 +2,11 @@ "files": [ { "filename": "bin/whisper.dll", - "fileDescription": "Whisper speech recognition", - "fileVersion": "1.5.4", + "fileDescription": "High-performance inference of OpenAI's Whisper automatic speech recognition (ASR) model.", + "fileVersion": "1.6.2", "productName": "WhisperCpp", - "productVersion": "1.5.4", - "copyright": "Copyright (c) 2023 Georgi Gerganov" + "productVersion": "1.6.2", + "copyright": "Copyright (c) 2023-2024 The ggml authors" } ] }