Skip to content

Commit

Permalink
Use .NET Standard 2.1 for the library and .NET 7.0 for the example (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiidams authored Aug 12, 2023
1 parent 8726afe commit 7da329b
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 16 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/build-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
run: dotnet build --configuration Release --no-restore
# - name: Test
# run: dotnet test --no-restore --verbosity normal
26 changes: 26 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
41 changes: 41 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
26 changes: 26 additions & 0 deletions NeMoOnnxSharp.Example/NeMoOnnxSharp.Example.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<None Remove="QuartzNet15x5Base-En.onnx" />
</ItemGroup>

<ItemGroup>
<Content Include="QuartzNet15x5Base-En.onnx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.ML.OnnxRuntime" Version="1.15.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\NeMoOnnxSharp\NeMoOnnxSharp.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.IO;
using System.Runtime.InteropServices;

namespace NeMoOnnxSharp
namespace NeMoOnnxSharp.Example
{
internal class Program
{
Expand Down
File renamed without changes.
8 changes: 7 additions & 1 deletion NeMoOnnxSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
13 changes: 3 additions & 10 deletions NeMoOnnxSharp/NeMoOnnxSharp.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.ML.OnnxRuntime" Version="1.10.0" />
<PackageReference Include="Microsoft.ML.OnnxRuntime.Managed" Version="1.10.0" />
</ItemGroup>

<ItemGroup>
<None Update="QuartzNet15x5Base-En.onnx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<PackageReference Include="Microsoft.ML.OnnxRuntime.Managed" Version="1.15.1" />
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 7da329b

Please sign in to comment.