From 7da329b15ffbc3cd3f1cc51444e0a2c5e546fe41 Mon Sep 17 00:00:00 2001 From: Katsuya Iida Date: Sat, 12 Aug 2023 14:23:01 +0900 Subject: [PATCH] Use .NET Standard 2.1 for the library and .NET 7.0 for the example (#10) --- .github/workflows/build-validation.yml | 21 ++++++++-- .vscode/launch.json | 26 ++++++++++++ .vscode/tasks.json | 41 +++++++++++++++++++ .../NeMoOnnxSharp.Example.csproj | 26 ++++++++++++ .../Program.cs | 2 +- .../QuartzNet15x5Base-En.onnx | 0 NeMoOnnxSharp.sln | 8 +++- NeMoOnnxSharp/NeMoOnnxSharp.csproj | 13 ++---- README.md | 2 + 9 files changed, 123 insertions(+), 16 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 NeMoOnnxSharp.Example/NeMoOnnxSharp.Example.csproj rename {NeMoOnnxSharp => NeMoOnnxSharp.Example}/Program.cs (98%) rename {NeMoOnnxSharp => NeMoOnnxSharp.Example}/QuartzNet15x5Base-En.onnx (100%) diff --git a/.github/workflows/build-validation.yml b/.github/workflows/build-validation.yml index 6521bf1..3dad20b 100644 --- a/.github/workflows/build-validation.yml +++ b/.github/workflows/build-validation.yml @@ -18,12 +18,25 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + lfs: true + - name: Checkout LFS objects + run: git lfs checkout - name: Setup .NET - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x + - uses: actions/cache@v3 with: - dotnet-version: 5.0.x + path: ~/.nuget/packages + # Look to see if there is a cache hit for the corresponding requirements file + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} + restore-keys: | + ${{ runner.os }}-nuget - name: Restore dependencies run: dotnet restore - name: Build - run: dotnet build --configuration Release --no-restore \ No newline at end of file + run: dotnet build --configuration Release --no-restore + # - name: Test + # run: dotnet test --no-restore --verbosity normal \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..e5b9391 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,26 @@ +{ + "version": "0.2.0", + "configurations": [ + { + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/NeMoOnnxSharp.Example/bin/Debug/net7.0/NeMoOnnxSharp.Example.dll", + "args": [], + "cwd": "${workspaceFolder}/NeMoOnnxSharp.Example", + // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console + "console": "internalConsole", + "stopAtEntry": false + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..4a023be --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,41 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/NeMoOnnxSharp.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/NeMoOnnxSharp.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "run", + "--project", + "${workspaceFolder}/NeMoOnnxSharp.sln" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/NeMoOnnxSharp.Example/NeMoOnnxSharp.Example.csproj b/NeMoOnnxSharp.Example/NeMoOnnxSharp.Example.csproj new file mode 100644 index 0000000..d342c7a --- /dev/null +++ b/NeMoOnnxSharp.Example/NeMoOnnxSharp.Example.csproj @@ -0,0 +1,26 @@ + + + + Exe + net7.0 + + + + + + + + + PreserveNewest + + + + + + + + + + + + diff --git a/NeMoOnnxSharp/Program.cs b/NeMoOnnxSharp.Example/Program.cs similarity index 98% rename from NeMoOnnxSharp/Program.cs rename to NeMoOnnxSharp.Example/Program.cs index 4172930..205fcd1 100644 --- a/NeMoOnnxSharp/Program.cs +++ b/NeMoOnnxSharp.Example/Program.cs @@ -2,7 +2,7 @@ using System.IO; using System.Runtime.InteropServices; -namespace NeMoOnnxSharp +namespace NeMoOnnxSharp.Example { internal class Program { diff --git a/NeMoOnnxSharp/QuartzNet15x5Base-En.onnx b/NeMoOnnxSharp.Example/QuartzNet15x5Base-En.onnx similarity index 100% rename from NeMoOnnxSharp/QuartzNet15x5Base-En.onnx rename to NeMoOnnxSharp.Example/QuartzNet15x5Base-En.onnx diff --git a/NeMoOnnxSharp.sln b/NeMoOnnxSharp.sln index 0b70871..5409837 100644 --- a/NeMoOnnxSharp.sln +++ b/NeMoOnnxSharp.sln @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.32014.148 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NeMoOnnxSharp", "NeMoOnnxSharp\NeMoOnnxSharp.csproj", "{D583F4A1-65A9-4BD2-91D5-8A24E0B325E0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NeMoOnnxSharp.Example", "NeMoOnnxSharp.Example\NeMoOnnxSharp.Example.csproj", "{D583F4A1-65A9-4BD2-91D5-8A24E0B325E0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NeMoOnnxSharp", "NeMoOnnxSharp\NeMoOnnxSharp.csproj", "{69A674F7-593C-48C4-A5C7-5BCBC205E281}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -15,6 +17,10 @@ Global {D583F4A1-65A9-4BD2-91D5-8A24E0B325E0}.Debug|Any CPU.Build.0 = Debug|Any CPU {D583F4A1-65A9-4BD2-91D5-8A24E0B325E0}.Release|Any CPU.ActiveCfg = Release|Any CPU {D583F4A1-65A9-4BD2-91D5-8A24E0B325E0}.Release|Any CPU.Build.0 = Release|Any CPU + {69A674F7-593C-48C4-A5C7-5BCBC205E281}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {69A674F7-593C-48C4-A5C7-5BCBC205E281}.Debug|Any CPU.Build.0 = Debug|Any CPU + {69A674F7-593C-48C4-A5C7-5BCBC205E281}.Release|Any CPU.ActiveCfg = Release|Any CPU + {69A674F7-593C-48C4-A5C7-5BCBC205E281}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/NeMoOnnxSharp/NeMoOnnxSharp.csproj b/NeMoOnnxSharp/NeMoOnnxSharp.csproj index 973046b..8cee8b1 100644 --- a/NeMoOnnxSharp/NeMoOnnxSharp.csproj +++ b/NeMoOnnxSharp/NeMoOnnxSharp.csproj @@ -1,19 +1,12 @@ - Exe - netcoreapp3.1 + netstandard2.1 + enable - - - - - - - PreserveNewest - + diff --git a/README.md b/README.md index be1a46f..5d07dac 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Speech recognizer with QuartzNet and ONNX Runtime +[![build](https://github.com/kaiidams/NeMoOnnxSharp/actions/workflows/build-validation.yml/badge.svg)](https://github.com/kaiidams/NeMoOnnxSharp/actions/workflows/build-validation.yml) + This repository explains how to export [QuartzNet](https://arxiv.org/abs/1910.10261) of