Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/android-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ on:

jobs:
native-build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}

- name: Install Android NDK
uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/dotnet-maui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:

- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
with:
xcode-version: '16.2'
xcode-version: '16.3'

- name: Download Artifacts
id: download-artifact
uses: actions/download-artifact@v4
Expand All @@ -40,16 +40,16 @@ jobs:
run: |
dotnet workload install maui --ignore-failed-sources
dotnet workload install tvos --ignore-failed-sources

- 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: 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:
Expand Down Expand Up @@ -80,13 +80,13 @@ 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
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- 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-*"

Expand All @@ -96,7 +96,7 @@ jobs:
api-level: 29
arch: x86_64
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() }}
uses: actions/upload-artifact@v4
Expand All @@ -108,7 +108,7 @@ jobs:
dotnet-maui-test-ios:
runs-on: macos-15
needs: dotnet-maui-build

env:
USE_WHISPER_MAUI: "TRUE"

Expand All @@ -120,7 +120,7 @@ jobs:
with:
dotnet-version: |
8.0.x

- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
with:
xcode-version: '16.2'
Expand All @@ -131,14 +131,14 @@ jobs:
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
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/linux-cuda-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ on:

jobs:
native-build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}

- name: Install aarch64-linux-gnu-gcc
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu && sudo apt-get install -y g++-aarch64-linux-gnu
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/linux-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ on:

jobs:
native-build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}

- name: Install aarch64-linux-gnu-gcc
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu && sudo apt-get install -y g++-aarch64-linux-gnu
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/linux-noavx-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ on:

jobs:
native-build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}

- name: Install aarch64-linux-gnu-gcc
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu && sudo apt-get install -y g++-aarch64-linux-gnu
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/linux-openvino-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ on:

jobs:
native-build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}

- name: Install aarch64-linux-gnu-gcc
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu && sudo apt-get install -y g++-aarch64-linux-gnu
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/linux-vulkan-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ on:

jobs:
native-build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}

- name: Install aarch64-linux-gnu-gcc
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu && sudo apt-get install -y g++-aarch64-linux-gnu
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/macos-coreml-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}

- name: Run apple coreml build for x64
run: make apple_coreml_x64
Expand All @@ -36,7 +35,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}

- name: Run apple coreml build for arm
run: make apple_coreml_arm
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/macos-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}

- name: Run apple build for x64
run: make apple_x64
Expand All @@ -36,7 +35,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}

- name: Run apple build for arm
run: make apple_arm
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/wasm-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ on:

jobs:
native-build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}

- name: Install Emscripten
uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/windows-cuda-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:

with:
submodules: true
ref: ${{ github.head_ref }}

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/windows-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:

with:
submodules: true
ref: ${{ github.head_ref }}

- name: Install Ninja
id: install_ninja
Expand All @@ -43,7 +42,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}

- name: Install Ninja
id: install_ninja
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/windows-noavx-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}

- name: Install Ninja
id: install_ninja
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/windows-openvino-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/windows-vulkan-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ copy_metal_coreml:
wasm:
rm -rf build/wasm
emcmake cmake -S . -B build/wasm -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
cmake --build build/wasm --config $(BUILD_TYPE)
emcmake cmake --build build/wasm --config $(BUILD_TYPE)
mkdir -p runtimes/Whisper.net.Runtime/browser-wasm
cp build/wasm/whisper.cpp/src/libwhisper.a ./runtimes/Whisper.net.Runtime/browser-wasm/libwhisper.a
cp build/wasm/whisper.cpp/ggml/src/libggml-whisper.a ./runtimes/Whisper.net.Runtime/browser-wasm/libggml-whisper.a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ internal static WhisperProcessor BuildWhisperProcessor(this SpeechToTextOptions?

if (GetAdditionalProperty<string>(LanguageKey, options!, out var language) && !string.IsNullOrEmpty(language))
{
processorBuilder.WithLanguage(language);
processorBuilder.WithLanguage(language!);
}

if (GetAdditionalProperty<bool>(LanguageDetectionKey, options!, out var languageDetection) && languageDetection)
Expand Down
3 changes: 2 additions & 1 deletion Whisper.net/Wave/WaveParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ private async IAsyncEnumerable<long[]> InternalReadSamples(bool useAsync, [Enume
yield return currentSamples;
sampleIndex++;
}
};
}

if (sampleIndex < SamplesCount)
{
throw new CorruptedWaveException("Invalid wave file, the size is too small and couldn't read all the samples.");
Expand Down
2 changes: 1 addition & 1 deletion Whisper.net/WhisperFactoryOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Whisper.net;

public struct WhisperFactoryOptions
{
public static WhisperFactoryOptions Default => new WhisperFactoryOptions();
public static WhisperFactoryOptions Default => new();

public WhisperFactoryOptions()
{
Expand Down
2 changes: 1 addition & 1 deletion Whisper.net/WhisperProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public IAsyncEnumerable<SegmentData> ProcessAsync(float[] samples, CancellationT
/// Returns the strings in the given <paramref name="segmentData"/> to the string pool.
/// </summary>
/// <remarks>
/// This method should be used when <seealso cref="WhisperProcessorBuilder.WithStringPooling(bool)"/> was activated.
/// This method should be used when <seealso cref="WhisperProcessorBuilder.WithStringPool(IStringPool?)"/> was activated.
/// Once a <paramref name="segmentData"/> is returned, the string values inside it (e.g. <seealso cref="SegmentData.Text"/>) might be changed.
/// </remarks>
public void Return(SegmentData segmentData)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Licensed under the MIT license: https://opensource.org/licenses/MIT

using System.Globalization;
using Foundation;
using Microsoft.DotNet.XHarness.TestRunners.Common;
using Microsoft.DotNet.XHarness.TestRunners.Xunit;
Expand All @@ -14,7 +13,7 @@ public class TestApplicationDelegate : UIApplicationDelegate
{
public override UIWindow? Window { get; set; }

public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
public override bool FinishedLaunching(UIApplication application, NSDictionary? launchOptions)
{
Window = new UIWindow(UIScreen.MainScreen.Bounds)
{
Expand Down
Loading