Skip to content

Commit

Permalink
Bumped Whispercpp 1.7.3 that adds WithNoSpeechThreshold (#305)
Browse files Browse the repository at this point in the history
* Bumped Whispercpp 1.7.3 that adds WithNoSpeechThreshold

* Fixed updated ggml-metal path

* WIP

* WIP

* WIP

* find -name

* find libggml-metal-whisper.dylib

* metal path fix

* WIP

* fixed blas path

* Added new libs to nuget packages

* Removed ggml log set

* Removed force load of ggml library.

* Fixes

* Test

* Added generic dependency loader.

* Fixed warning

* Trying to add ios artifact

* bumped minimum ios to 12.2 and removed ios.toolchain.cmake

* WIP

* Tried to add -r iossimulator-arm64

* Try again

* build android as well instead of publish

* Try again

* Switch to debug builds

* Bumepd to macos 15 and fixed NativeLibraryLoader

* Tried to add setup xcode 16.2

* aaa

* AA

* aaaa

* Try again

* WIP

* WTF

* Added USE_WHISPER_MAUI_TESTS to build net9-ios

* WIP

* WIP

* Transformed tests to target net8,9 only when USE_WHISPER_MAUI_TESTS

* Try again

* try again

* one more try

* aaa

* one more try

* Test

* Test 2

* Added test results for ios

* Skipping TestCancelEncoder on ios

* Added SkipOnIos

* Skipped TestCancelEncoder
  • Loading branch information
sandrohanea authored Dec 26, 2024
1 parent 0b9bb5d commit ffc0cdb
Show file tree
Hide file tree
Showing 37 changed files with 912 additions and 1,149 deletions.
61 changes: 56 additions & 5 deletions .github/workflows/dotnet-maui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ on:

jobs:
dotnet-maui-build:
runs-on: macos-14
runs-on: macos-15

env:
USE_WHISPER_MAUI: "TRUE"
USE_WHISPER_MAUI_TESTS: "TRUE"

steps:
- uses: actions/checkout@v4
Expand All @@ -22,6 +23,10 @@ jobs:
dotnet-version: |
9.0.x
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.2'

- name: Download Artifacts
id: download-artifact
uses: actions/download-artifact@v4
Expand All @@ -36,15 +41,19 @@ jobs:
- name: Restore dependencies
run: dotnet restore ./Whisper.net.Maui.Tests.sln

- name: Build ios-simulator
run: dotnet build ./tests/Whisper.net.Maui.Tests/Whisper.net.Maui.Tests.csproj -c Debug -f net9.0-ios -r iossimulator-arm64 -p:EmbedAssembliesIntoAppBundle=true -p:CodesignKey="" -p:CodesignProvision=""

- name: Publish android build
run: dotnet publish ./tests/Whisper.net.Maui.Tests/Whisper.net.Maui.Tests.csproj -c Debug -f net9.0-android -p:EmbedAssembliesIntoApk=true
- name: Build android
run: dotnet build ./tests/Whisper.net.Maui.Tests/Whisper.net.Maui.Tests.csproj -c Debug -f net9.0-android -p:EmbedAssembliesIntoApk=true

- name: Upload apk and ios app
uses: actions/upload-artifact@v4
with:
name: maui-build-artifacts
path: |
./tests/Whisper.net.Maui.Tests/bin/Debug/net9.0-ios/iossimulator-arm64/Whisper.net.Maui.Tests.app
./tests/Whisper.net.Maui.Tests/bin/Debug/net9.0-android/com.companyname.whisper.net.maui.tests-Signed.apk
dotnet-maui-test-android:
Expand All @@ -69,7 +78,7 @@ jobs:
with:
name: maui-build-artifacts
path: maui-build-artifacts

- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
Expand All @@ -84,7 +93,7 @@ jobs:
with:
api-level: 29
arch: x86_64
script: xharness android test --app=./maui-build-artifacts/com.companyname.whisper.net.maui.tests-Signed.apk -p com.companyname.whisper.net.maui.tests -i com.companyname.whisper.net.maui.tests.AndroidMauiTestInstrumentation -o=./test-results/android
script: xharness android test --app=./maui-build-artifacts/net9.0-android/com.companyname.whisper.net.maui.tests-Signed.apk -p com.companyname.whisper.net.maui.tests -i com.companyname.whisper.net.maui.tests.AndroidMauiTestInstrumentation -o=./test-results/android

- name: Upload Maui Android xharness test results
if: ${{ always() }}
Expand All @@ -93,3 +102,45 @@ jobs:
name: xharness-android-test-results
path: |
./test-results/*
dotnet-maui-test-ios:
runs-on: macos-15
needs: dotnet-maui-build

env:
USE_WHISPER_MAUI: "TRUE"

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.2'

- name: Download Artifacts
id: download-artifact
uses: actions/download-artifact@v4
with:
name: maui-build-artifacts
path: maui-build-artifacts

- name: Install xharness
run: dotnet tool install Microsoft.DotNet.XHarness.CLI --global --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json --version "10.0.0-*"


- name: run ios tests
run: xharness apple test --app=./maui-build-artifacts/net9.0-ios/iossimulator-arm64/Whisper.net.Maui.Tests.app --output-directory=./test-results/ios --target=ios-simulator-64

- name: Upload Maui iOS xharness test results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: xharness-ios-test-results
path: |
./test-results/*
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:

jobs:
dotnet-macos:
runs-on: macos-14
runs-on: macos-15

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos-coreml-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
retention-days: 7

arm-native-build:
runs-on: macos-14
runs-on: macos-15

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
retention-days: 7

arm-native-build:
runs-on: macos-14
runs-on: macos-15

steps:
- uses: actions/checkout@v4
Expand Down
30 changes: 29 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,38 @@ project ("Whisper.net")
# Include sub-projects.
add_subdirectory ("whisper.cpp")

set_target_properties(ggml PROPERTIES OUTPUT_NAME "ggml-whisper")
if(TARGET ggml)
set_target_properties(ggml PROPERTIES OUTPUT_NAME "ggml-whisper")
endif()

if(TARGET ggml-cpu)
set_target_properties(ggml-cpu PROPERTIES OUTPUT_NAME "ggml-cpu-whisper")
endif()

if(TARGET ggml-base)
set_target_properties(ggml-base PROPERTIES OUTPUT_NAME "ggml-base-whisper")
endif()

if(TARGET ggml-cuda)
set_target_properties(ggml-cuda PROPERTIES OUTPUT_NAME "ggml-cuda-whisper")
endif()

if(TARGET ggml-vulkan)
set_target_properties(ggml-vulkan PROPERTIES OUTPUT_NAME "ggml-vulkan-whisper")
endif()

if(TARGET ggml-metal)
set_target_properties(ggml-metal PROPERTIES OUTPUT_NAME "ggml-metal-whisper")
endif()

if(TARGET ggml-blas)
set_target_properties(ggml-blas PROPERTIES OUTPUT_NAME "ggml-blas-whisper")
endif()

if (CMAKE_SYSTEM_NAME STREQUAL "Android")
# Set alignment to 16 KB. See https://developer.android.com/guide/practices/page-sizes#cmake
target_link_options(ggml PRIVATE "-Wl,-z,max-page-size=16384")
target_link_options(whisper PRIVATE "-Wl,-z,max-page-size=16384")
target_link_options(ggml-cpu PRIVATE "-Wl,-z,max-page-size=16384")
target_link_options(ggml-base PRIVATE "-Wl,-z,max-page-size=16384")
endif()
Loading

0 comments on commit ffc0cdb

Please sign in to comment.