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
15 changes: 13 additions & 2 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

windows:
uses: ./.github/workflows/windows-native-build.yml

windows-no-avx:
uses: ./.github/workflows/windows-noavx-native-build.yml

Expand All @@ -58,7 +58,7 @@ jobs:

windows-openvino:
uses: ./.github/workflows/windows-openvino-native-build.yml

linux-cuda:
if: ${{ inputs.BuildCuda == 'true' }}
uses: ./.github/workflows/linux-cuda-native-build.yml
Expand All @@ -69,13 +69,24 @@ jobs:
macos-coreml:
uses: ./.github/workflows/macos-coreml-native-build.yml

dotnet-noavx:
needs:
- windows-no-avx
- linux-no-avx
uses: ./.github/workflows/dotnet-noavx.yml
secrets: inherit

dotnet-build:
needs:
- android
- macos
- windows
- wasm
- linux
- windows-vulkan
- linux-vulkan
- windows-openvino
- linux-openvino
uses: ./.github/workflows/dotnet.yml
secrets: inherit

Expand Down
119 changes: 119 additions & 0 deletions .github/workflows/dotnet-noavx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: Dotnet NoAvx Build and Test

permissions:
contents: read
checks: write
security-events: write

on:
workflow_call:


env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
USE_WHISPER_NOAVX_TESTS: true
VSTEST_CONNECTION_TIMEOUT : 600

jobs:

dotnet-noavx-windows:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x

- name: Download Artifacts
id: download-artifact
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: runtimes

- name: Restore dependencies
run: dotnet restore ./Whisper.net.sln

- name: Run Dependency Checker
run: dotnet run --project ./tools/WhisperNetDependencyChecker/WhisperNetDependencyChecker.csproj CpuNoAvx

- name: Build
run: dotnet build ./Whisper.net.sln --no-restore -warnaserror

- name: Test
run: |
dotnet test ./Whisper.net.sln --no-build --logger "trx"

- name: Test Reporter
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5
if: success() || failure() # run this step even if previous step failed
with:
name: Whisper.net Windows Test Results
path: ./**/*.trx
reporter: dotnet-trx

- name: Upload trx files
uses: actions/upload-artifact@v4
if: success() || failure() # run this step even if previous step failed
with:
name: test-results-windows-noavx
path: ./**/*.trx
retention-days: 7

dotnet-noavx-linux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x

- name: Download Artifacts
id: download-artifact
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: runtimes

- name: Restore dependencies
run: dotnet restore ./Whisper.net.sln

- name: Run Dependency Checker
run: dotnet run --project ./tools/WhisperNetDependencyChecker/WhisperNetDependencyChecker.csproj CpuNoAvx

- name: Build
run: dotnet build ./Whisper.net.sln --no-restore -warnaserror

- name: Test
run: |
dotnet test ./Whisper.net.sln --no-build --logger "trx"

- name: Test Reporter
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5
if: success() || failure() # run this step even if previous step failed
with:
name: Whisper.net Linux Test Results
path: ./**/*.trx
reporter: dotnet-trx

- name: Upload trx files
uses: actions/upload-artifact@v4
if: success() || failure() # run this step even if previous step failed
with:
name: test-results-linux-noavx
path: ./**/*.trx
retention-days: 7

13 changes: 9 additions & 4 deletions Whisper.net.Demo/Whisper.net.Demo.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Condition="'$(EnableCoreML)' != 'true'" Project="../runtimes/Whisper.net.Runtime/Whisper.net.Runtime.targets" />
<Import Condition="'$(EnableCoreML)' == 'true'" Project="../runtimes/Whisper.net.Runtime.CoreML/Whisper.net.Runtime.CoreML.targets" />
<PropertyGroup>
<Import Condition="'$(EnableCoreML)' != 'true' AND $(USE_WHISPER_NOAVX_TESTS) == ''"
Project="../runtimes/Whisper.net.Runtime/Whisper.net.Runtime.targets" />
<Import Condition="'$(EnableCoreML)' == 'true' AND $(USE_WHISPER_NOAVX_TESTS) == ''"
Project="../runtimes/Whisper.net.Runtime.CoreML/Whisper.net.Runtime.CoreML.targets" />
<Import Condition="'$(EnableCoreML)' != 'true' AND $(USE_WHISPER_NOAVX_TESTS) != ''"
Project="../runtimes/Whisper.net.Runtime.NoAvx/Whisper.net.Runtime.NoAvx.targets" />

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net9.0</TargetFrameworks>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>13</LangVersion>
</PropertyGroup>

Expand Down
1 change: 1 addition & 0 deletions Whisper.net.sln
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "github", "github", "{5C8656
.github\workflows\windows-noavx-native-build.yml = .github\workflows\windows-noavx-native-build.yml
.github\workflows\windows-openvino-native-build.yml = .github\workflows\windows-openvino-native-build.yml
.github\workflows\windows-vulkan-native-build.yml = .github\workflows\windows-vulkan-native-build.yml
.github\workflows\dotnet-noavx.yml = .github\workflows\dotnet-noavx.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{52C6C243-3BD7-41CF-A0B0-1DE31AC2C884}"
Expand Down
6 changes: 3 additions & 3 deletions Whisper.net/Whisper.net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>13</LangVersion>
<Version>1.8.0-preview1</Version>
<Version>1.8.1-preview1</Version>
<Authors>Sandro Hanea</Authors>
<Description>Cross-platform dotnet bindings for Whisper.</Description>
<PackageProjectUrl>https://github.com/sandrohanea/whisper.net</PackageProjectUrl>
Expand All @@ -27,7 +27,7 @@
<!--<PropertyGroup>
<USE_WHISPER_MAUI>TRUE</USE_WHISPER_MAUI>
</PropertyGroup>-->

<PropertyGroup Condition="$(USE_WHISPER_MAUI) != ''">
<TargetFrameworks>
net8.0;net9.0;netstandard2.0;net8.0-ios;net8.0-tvos;net8.0-maccatalyst;net8.0-android;net9.0-ios;net9.0-tvos;net9.0-maccatalyst;net9.0-android
Expand All @@ -40,7 +40,7 @@
<PackageReference Include="System.IO.Compression" />
<PackageReference Include="System.Net.Http" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="Whisper.net.Maui.Tests" />
<InternalsVisibleTo Include="Whisper.net.Tests" />
Expand Down
4 changes: 2 additions & 2 deletions examples/BlazorApp/BlazorApp.Client/BlazorApp.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.3" />
<PackageReference Include="Whisper.net.Runtime" Version="1.7.4" />
<PackageReference Include="Whisper.net" Version="1.7.4" />
<PackageReference Include="Whisper.net.Runtime" Version="1.8.0" />
<PackageReference Include="Whisper.net" Version="1.8.0" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions examples/ContinuousRecognition/ContinuousRecognition.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Whisper.net.Runtime" Version="1.7.4" />
<PackageReference Include="Whisper.net" Version="1.7.4" />
<PackageReference Include="Whisper.net.Runtime" Version="1.8.0" />
<PackageReference Include="Whisper.net" Version="1.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions examples/CoreML/CoreML.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Whisper.net" Version="1.7.4" />
<PackageReference Include="Whisper.net.Runtime.CoreML" Version="1.7.4" />
<PackageReference Include="Whisper.net" Version="1.8.0" />
<PackageReference Include="Whisper.net.Runtime.CoreML" Version="1.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions examples/CoreML/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ public static async Task Main(string[] args)
if (!Directory.Exists(coreMlModelcName))
{
// Note: The modelc directory needs to be extracted at the same level as the "ggml-base.bin" file (and the current executable).
await WhisperGgmlDownloader.GetEncoderCoreMLModelAsync(ggmlType)
await WhisperGgmlDownloader.Default.GetEncoderCoreMLModelAsync(ggmlType)
.ExtractToPath(".");
}

// Optional logging from the native library

using var whisperLogger = LogProvider.AddLogger((level, message) =>
{
Console.Write($"{level}: {message}");
Expand Down
4 changes: 2 additions & 2 deletions examples/Diarization/Diarization.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Whisper.net.Runtime" Version="1.7.4" />
<PackageReference Include="Whisper.net" Version="1.7.4" />
<PackageReference Include="Whisper.net.Runtime" Version="1.8.0" />
<PackageReference Include="Whisper.net" Version="1.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Whisper.net.Runtime" Version="1.7.4" />
<PackageReference Include="Whisper.net" Version="1.7.4" />
<PackageReference Include="Whisper.net.Runtime" Version="1.8.0" />
<PackageReference Include="Whisper.net" Version="1.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions examples/MultiRuntime/MultiRuntime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Whisper.net.Runtime.Cuda" Version="1.7.4" />
<PackageReference Include="Whisper.net.Runtime" Version="1.7.4" />
<PackageReference Include="Whisper.net" Version="1.7.4" />
<PackageReference Include="Whisper.net.Runtime.Cuda" Version="1.8.0" />
<PackageReference Include="Whisper.net.Runtime" Version="1.8.0" />
<PackageReference Include="Whisper.net" Version="1.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions examples/NAudioMp3/NAudioMp3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

<ItemGroup>
<PackageReference Include="NAudio" Version="2.2.1" />
<PackageReference Include="Whisper.net.Runtime" Version="1.7.4" />
<PackageReference Include="Whisper.net" Version="1.7.4" />
<PackageReference Include="Whisper.net.Runtime" Version="1.8.0" />
<PackageReference Include="Whisper.net" Version="1.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions examples/NAudioResampleWav/NAudioResampleWav.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

<ItemGroup>
<PackageReference Include="NAudio" Version="2.2.1" />
<PackageReference Include="Whisper.net.Runtime" Version="1.7.4" />
<PackageReference Include="Whisper.net" Version="1.7.4" />
<PackageReference Include="Whisper.net.Runtime" Version="1.8.0" />
<PackageReference Include="Whisper.net" Version="1.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions examples/NvidiaCuda/NvidiaCuda.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Whisper.net" Version="1.7.4" />
<PackageReference Include="Whisper.net.Runtime.Cuda" Version="1.7.4" />
<PackageReference Include="Whisper.net" Version="1.8.0" />
<PackageReference Include="Whisper.net.Runtime.Cuda" Version="1.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions examples/OpenVinoExample/OpenVinoExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Whisper.net.Runtime.OpenVino" Version="1.7.4" />
<PackageReference Include="Whisper.net" Version="1.7.4" />
<PackageReference Include="Whisper.net.Runtime.OpenVino" Version="1.8.0" />
<PackageReference Include="Whisper.net" Version="1.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions examples/OpenVinoExample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ public static async Task Main(string[] args)
if (!Directory.Exists(encoderDirectoryName))
{
// Note: The encoder directory needs to be extracted
await WhisperGgmlDownloader.GetEncoderOpenVinoModelAsync(ggmlType)
await WhisperGgmlDownloader.Default.GetEncoderOpenVinoModelAsync(ggmlType)
.ExtractToPath(encoderDirectoryName);
}

// This section creates the whisperFactory object which is used to create the processor object.
using var whisperFactory = WhisperFactory.FromPath(modelFileName);

// We need to get the path to the xml encoder manifest file
var xmlEncoderManifest = Path.Combine(encoderDirectoryName, WhisperGgmlDownloader.GetOpenVinoManifestFileName(ggmlType));
var xmlEncoderManifest = Path.Combine(encoderDirectoryName, WhisperGgmlDownloader.Default.GetOpenVinoManifestFileName(ggmlType));

// This section creates the processor object which is used to process the audio file, it uses language `auto` to detect the language of the audio file.
using var processor = whisperFactory.CreateBuilder()
Expand Down
4 changes: 2 additions & 2 deletions examples/ParallelExecution/ParallelExecution.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Whisper.net.Runtime" Version="1.7.4" />
<PackageReference Include="Whisper.net" Version="1.7.4" />
<PackageReference Include="Whisper.net.Runtime" Version="1.8.0" />
<PackageReference Include="Whisper.net" Version="1.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions examples/Simple/Simple.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Whisper.net.Runtime" Version="1.7.4" />
<PackageReference Include="Whisper.net" Version="1.7.4" />
<PackageReference Include="Whisper.net.Runtime" Version="1.8.0" />
<PackageReference Include="Whisper.net" Version="1.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions examples/SimpleSync/SimpleSync.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Whisper.net.Runtime" Version="1.7.4" />
<PackageReference Include="Whisper.net" Version="1.7.4" />
<PackageReference Include="Whisper.net.Runtime" Version="1.8.0" />
<PackageReference Include="Whisper.net" Version="1.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading