Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support RISC-V #609

Merged
merged 2 commits into from
Feb 25, 2024
Merged
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
205 changes: 205 additions & 0 deletions .github/workflows/riscv64-linux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
name: riscv64-linux

on:
push:
branches:
- master
paths:
- '.github/workflows/riscv64-linux.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'toolchains/riscv64-linux-gnu.toolchain.cmake'
- 'build-riscv64-linux-gnu.sh'
tags:
- '*'
pull_request:
branches:
- master
paths:
- '.github/workflows/riscv64-linux.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'toolchains/riscv64-linux-gnu.toolchain.cmake'
- 'build-riscv64-linux-gnu.sh'

workflow_dispatch:

concurrency:
group: riscv64-linux-${{ github.ref }}
cancel-in-progress: true

jobs:
riscv64_linux:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} ${{ matrix.lib_type }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
lib_type: [static, shared]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.os }}-riscv64-${{ matrix.lib_type }}

- name: cache-qemu
id: cache-qemu
uses: actions/cache@v4
with:
path: qemu-install
key: qemu-riscv-install-20240225

- name: install-qemu-build-deps
if: steps.cache-qemu.outputs.cache-hit != 'true'
run: |
sudo apt-get update
sudo apt-get install autoconf automake autotools-dev ninja-build
- name: checkout-qemu
if: steps.cache-qemu.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: qemu/qemu
path: qemu

- name: qemu
if: steps.cache-qemu.outputs.cache-hit != 'true'
run: |
cd qemu
./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=riscv64-linux-user --disable-system
make -j2
make install
ls -lh $GITHUB_WORKSPACE/qemu-install
ls -lh $GITHUB_WORKSPACE/qemu-install/bin
- name: cache-toolchain
id: cache-toolchain
uses: actions/cache@v4
with:
path: toolchain
key: riscv64-glibc-ubuntu-20.04-gcc-nightly-2023.10.17-nightly

- name: Download toolchain
if: steps.cache-toolchain.outputs.cache-hit != 'true'
shell: bash
run: |
mkdir $GITHUB_WORKSPACE/toolchain
wget -q https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2023.10.17/riscv64-glibc-ubuntu-20.04-gcc-nightly-2023.10.17-nightly.tar.gz
tar xvf ./riscv64-glibc-ubuntu-20.04-gcc-nightly-2023.10.17-nightly.tar.gz --strip-components 1 -C $GITHUB_WORKSPACE/toolchain
- name: Display toolchain info
shell: bash
run: |
export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH
riscv64-unknown-linux-gnu-gcc --version
- name: Display qemu-riscv64 -h
shell: bash
run: |
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/sysroot
qemu-riscv64 -h
- name: build riscv64-linux
shell: bash
run: |
export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake --version
lib_type=${{ matrix.lib_type }}
if [[ $lib_type == "shared" ]]; then
export BUILD_SHARED_LIBS=ON
else
export BUILD_SHARED_LIBS=OFF
fi
./build-riscv64-linux-gnu.sh
ls -lh build-riscv64-linux-gnu/bin
ls -lh build-riscv64-linux-gnu/lib
file build-riscv64-linux-gnu/bin/sherpa-onnx
- name: Test sherpa-onnx
shell: bash
run: |
export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/sysroot
ls -lh ./build-riscv64-linux-gnu/bin
echo "----------sherpa-onnx----------"
qemu-riscv64 ./build-riscv64-linux-gnu/bin/sherpa-onnx --help
readelf -d ./build-riscv64-linux-gnu/bin/sherpa-onnx
echo "----------sherpa-onnx-offline----------"
qemu-riscv64 ./build-riscv64-linux-gnu/bin/sherpa-onnx-offline --help
readelf -d ./build-riscv64-linux-gnu/bin/sherpa-onnx-offline
echo "----------sherpa-onnx-offline-tts----------"
qemu-riscv64 ./build-riscv64-linux-gnu/bin/sherpa-onnx-offline-tts --help
readelf -d ./build-riscv64-linux-gnu/bin/sherpa-onnx-offline-tts
- name: Copy files
shell: bash
run: |
export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH
riscv64-unknown-linux-gnu-strip --version
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-riscv64-${{ matrix.lib_type }}
mkdir $dst
ls -lh build-riscv64-linux-gnu/install/lib
cp -a build-riscv64-linux-gnu/install/bin $dst/
ls -lh $dst/bin/*
riscv64-unknown-linux-gnu-strip $dst/bin/*
ls -lh $dst
lib_type=${{ matrix.lib_type }}
if [[ $lib_type == "shared" ]]; then
cp -a build-riscv64-linux-gnu/install/lib $dst/
rm -fv $dst/lib/libasound.so
rm -fv $dst/lib/libonnxruntime.so
rm -fv $dst/lib/libsherpa-onnx-fst.so
fi
tree $dst
tar cjvf ${dst}.tar.bz2 $dst
- uses: actions/upload-artifact@v4
if: matrix.lib_type == 'shared'
with:
name: sherpa-onnx-linux-riscv64-shared
path: sherpa-onnx-*linux-riscv64-shared.tar.bz2

- uses: actions/upload-artifact@v4
if: matrix.lib_type == 'static'
with:
name: sherpa-onnx-linux-riscv64-static
path: sherpa-onnx-*linux-riscv64-static.tar.bz2

- name: Release pre-compiled binaries and libs for riscv64 linux ${{ matrix.lib_type }}
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
file_glob: true
overwrite: true
file: sherpa-onnx-*linux-riscv64*.tar.bz2
71 changes: 71 additions & 0 deletions build-riscv64-linux-gnu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/env bash

if ! command -v riscv64-unknown-linux-gnu-g++ &> /dev/null; then
echo "Please install the toolchain first."
echo
echo "You can use the following command to install the toolchain:"
echo
echo " mkdir -p $HOME/software"
echo " cd $HOME/software"
echo " mkdir riscv64-glibc-ubuntu-18.04-nightly-2022.11.12-nightly"
echo " cd riscv64-glibc-ubuntu-18.04-nightly-2022.11.12-nightly"
echo " wget https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2022.11.12/riscv64-glibc-ubuntu-18.04-nightly-2022.11.12-nightly.tar.gz"
echo " tar xvf riscv64-glibc-ubuntu-18.04-nightly-2022.11.12-nightly.tar.gz --strip-components=1"
echo " export PATH=$HOME/software/riscv64-glibc-ubuntu-18.04-nightly-2022.11.12-nightly/bin"
echo
exit 1
fi

if [ x$dir = x"" ]; then
dir=build-riscv64-linux-gnu
fi
mkdir -p $dir
cd $dir

if [ ! -f alsa-lib/src/.libs/libasound.so ]; then
echo "Start to cross-compile alsa-lib"
if [ ! -d alsa-lib ]; then
git clone --depth 1 https://github.com/alsa-project/alsa-lib
fi
# If it shows:
# ./gitcompile: line 79: libtoolize: command not found
# Please use:
# sudo apt-get install libtool m4 automake
#
pushd alsa-lib
CC=riscv64-unknown-linux-gnu-gcc ./gitcompile --host=riscv64-unknown-linux-gnu
popd
echo "Finish cross-compiling alsa-lib"
fi

export CPLUS_INCLUDE_PATH=$PWD/alsa-lib/include:$CPLUS_INCLUDE_PATH
export SHERPA_ONNX_ALSA_LIB_DIR=$PWD/alsa-lib/src/.libs

if [[ x"$BUILD_SHARED_LIBS" == x"" ]]; then
# By default, use static link
BUILD_SHARED_LIBS=OFF
fi

cmake \
-DBUILD_PIPER_PHONMIZE_EXE=OFF \
-DBUILD_PIPER_PHONMIZE_TESTS=OFF \
-DBUILD_ESPEAK_NG_EXE=OFF \
-DBUILD_ESPEAK_NG_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX=./install \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS \
-DSHERPA_ONNX_ENABLE_TESTS=OFF \
-DSHERPA_ONNX_ENABLE_PYTHON=OFF \
-DSHERPA_ONNX_ENABLE_CHECK=OFF \
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
-DSHERPA_ONNX_ENABLE_JNI=OFF \
-DSHERPA_ONNX_ENABLE_C_API=OFF \
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
-DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv64-linux-gnu.toolchain.cmake \
..

make VERBOSE=1 -j4
make install/strip

# Enable it if only needed
# cp -v $SHERPA_ONNX_ALSA_LIB_DIR/libasound.so* ./install/lib/
64 changes: 64 additions & 0 deletions cmake/onnxruntime-linux-riscv64-static.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright (c) 2022-2024 Xiaomi Corporation
message(STATUS "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")

if(NOT CMAKE_SYSTEM_NAME STREQUAL Linux)
message(FATAL_ERROR "This file is for Linux only. Given: ${CMAKE_SYSTEM_NAME}")
endif()

if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL riscv64)
message(FATAL_ERROR "This file is for riscv64 only. Given: ${CMAKE_SYSTEM_PROCESSOR}")
endif()

if(BUILD_SHARED_LIBS)
message(FATAL_ERROR "This file is for building static libraries. BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
endif()

set(onnxruntime_URL "https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.18.0/onnxruntime-linux-riscv64-static_lib-1.18.0.zip")
set(onnxruntime_URL2 "https://hub.nuaa.cf/csukuangfj/onnxruntime-libs/releases/download/v1.18.0/onnxruntime-linux-riscv64-static_lib-1.18.0.zip")
set(onnxruntime_HASH "SHA256=6791d695d17118db6815364c975a9d7ea9a8909754516ed1b089fe015c20912e")

# If you don't have access to the Internet,
# please download onnxruntime to one of the following locations.
# You can add more if you want.
set(possible_file_locations
$ENV{HOME}/Downloads/onnxruntime-linux-riscv64-static_lib-1.18.0.zip
${CMAKE_SOURCE_DIR}/onnxruntime-linux-riscv64-static_lib-1.18.0.zip
${CMAKE_BINARY_DIR}/onnxruntime-linux-riscv64-static_lib-1.18.0.zip
/tmp/onnxruntime-linux-riscv64-static_lib-1.18.0.zip
/star-fj/fangjun/download/github/onnxruntime-linux-riscv64-static_lib-1.18.0.zip
)

foreach(f IN LISTS possible_file_locations)
if(EXISTS ${f})
set(onnxruntime_URL "${f}")
file(TO_CMAKE_PATH "${onnxruntime_URL}" onnxruntime_URL)
message(STATUS "Found local downloaded onnxruntime: ${onnxruntime_URL}")
set(onnxruntime_URL2)
break()
endif()
endforeach()

FetchContent_Declare(onnxruntime
URL
${onnxruntime_URL}
${onnxruntime_URL2}
URL_HASH ${onnxruntime_HASH}
)

FetchContent_GetProperties(onnxruntime)
if(NOT onnxruntime_POPULATED)
message(STATUS "Downloading onnxruntime from ${onnxruntime_URL}")
FetchContent_Populate(onnxruntime)
endif()
message(STATUS "onnxruntime is downloaded to ${onnxruntime_SOURCE_DIR}")

# for static libraries, we use onnxruntime_lib_files directly below
include_directories(${onnxruntime_SOURCE_DIR}/include)

file(GLOB onnxruntime_lib_files "${onnxruntime_SOURCE_DIR}/lib/lib*.a")

set(onnxruntime_lib_files ${onnxruntime_lib_files} PARENT_SCOPE)

message(STATUS "onnxruntime lib files: ${onnxruntime_lib_files}")
install(FILES ${onnxruntime_lib_files} DESTINATION lib)
73 changes: 73 additions & 0 deletions cmake/onnxruntime-linux-riscv64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Copyright (c) 2022-2024 Xiaomi Corporation
message(STATUS "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")

if(NOT CMAKE_SYSTEM_NAME STREQUAL Linux)
message(FATAL_ERROR "This file is for Linux only. Given: ${CMAKE_SYSTEM_NAME}")
endif()

if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL riscv64)
message(FATAL_ERROR "This file is for riscv64 only. Given: ${CMAKE_SYSTEM_PROCESSOR}")
endif()

if(NOT BUILD_SHARED_LIBS)
message(FATAL_ERROR "This file is for building shared libraries. BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
endif()

set(onnxruntime_URL "https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.18.0/onnxruntime-linux-riscv64-1.18.0.zip")
set(onnxruntime_URL2 "https://hub.nuaa.cf/csukuangfj/onnxruntime-libs/releases/download/v1.18.0/onnxruntime-linux-riscv64-1.18.0.zip")
set(onnxruntime_HASH "SHA256=87ef36dbba28ee332069e7e511dcb409913bdeeed231b45172fe200d71c690a2")

# If you don't have access to the Internet,
# please download onnxruntime to one of the following locations.
# You can add more if you want.
set(possible_file_locations
$ENV{HOME}/Downloads/onnxruntime-linux-riscv64-1.18.0.zip
${CMAKE_SOURCE_DIR}/onnxruntime-linux-riscv64-1.18.0.zip
${CMAKE_BINARY_DIR}/onnxruntime-linux-riscv64-1.18.0.zip
/tmp/onnxruntime-linux-riscv64-1.18.0.zip
/star-fj/fangjun/download/github/onnxruntime-linux-riscv64-1.18.0.zip
)

foreach(f IN LISTS possible_file_locations)
if(EXISTS ${f})
set(onnxruntime_URL "${f}")
file(TO_CMAKE_PATH "${onnxruntime_URL}" onnxruntime_URL)
message(STATUS "Found local downloaded onnxruntime: ${onnxruntime_URL}")
set(onnxruntime_URL2)
break()
endif()
endforeach()

FetchContent_Declare(onnxruntime
URL
${onnxruntime_URL}
${onnxruntime_URL2}
URL_HASH ${onnxruntime_HASH}
)

FetchContent_GetProperties(onnxruntime)
if(NOT onnxruntime_POPULATED)
message(STATUS "Downloading onnxruntime from ${onnxruntime_URL}")
FetchContent_Populate(onnxruntime)
endif()
message(STATUS "onnxruntime is downloaded to ${onnxruntime_SOURCE_DIR}")

find_library(location_onnxruntime onnxruntime
PATHS
"${onnxruntime_SOURCE_DIR}/lib"
NO_CMAKE_SYSTEM_PATH
)

message(STATUS "location_onnxruntime: ${location_onnxruntime}")

add_library(onnxruntime SHARED IMPORTED)

set_target_properties(onnxruntime PROPERTIES
IMPORTED_LOCATION ${location_onnxruntime}
INTERFACE_INCLUDE_DIRECTORIES "${onnxruntime_SOURCE_DIR}/include/onnxruntime"
)

file(GLOB onnxruntime_lib_files "${onnxruntime_SOURCE_DIR}/lib/libonnxruntime*")
message(STATUS "onnxruntime lib files: ${onnxruntime_lib_files}")
install(FILES ${onnxruntime_lib_files} DESTINATION lib)
6 changes: 6 additions & 0 deletions cmake/onnxruntime.cmake
Original file line number Diff line number Diff line change
@@ -6,6 +6,12 @@ function(download_onnxruntime)
message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
if(SHERPA_ONNX_ENABLE_WASM)
include(onnxruntime-wasm-simd)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL riscv64)
if(BUILD_SHARED_LIBS)
include(onnxruntime-linux-riscv64)
else()
include(onnxruntime-linux-riscv64-static)
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL Linux AND CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64)
if(BUILD_SHARED_LIBS)
include(onnxruntime-linux-aarch64)
2 changes: 1 addition & 1 deletion cmake/piper-phonemize.cmake
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ function(download_piper_phonemize)
include(FetchContent)

set(piper_phonemize_URL "https://github.com/csukuangfj/piper-phonemize/archive/dc6b5f4441bffe521047086930b0fc12686acd56.zip")
set(piper_phonemize_URL2 "")
set(piper_phonemize_URL2 "https://hub.nuaa.cf/csukuangfj/piper-phonemize/archive/dc6b5f4441bffe521047086930b0fc12686acd56.zip")
set(piper_phonemize_HASH "SHA256=b9faa04204b1756fa455a962abb1f037041c040133d55be58d11f11ab9b3ce14")

# If you don't have access to the Internet,
17 changes: 17 additions & 0 deletions toolchains/riscv64-linux-gnu.toolchain.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copied from https://github.com/Tencent/ncnn/blob/master/toolchains/riscv64-linux-gnu.toolchain.cmake
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR riscv64)

set(CMAKE_C_COMPILER "riscv64-unknown-linux-gnu-gcc")
set(CMAKE_CXX_COMPILER "riscv64-unknown-linux-gnu-g++")

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

set(CMAKE_C_FLAGS "-march=rv64gc")
set(CMAKE_CXX_FLAGS "-march=rv64gc")

# cache flags
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "c++ flags")

Unchanged files with check annotations Beta

class Options
{
[Option(Required = true, HelpText = "Path to tokens.txt")]
public string Tokens { get; set; }

Check warning on line 21 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (ubuntu-latest, 3.8)

Non-nullable property 'Tokens' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 21 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (macos-latest, 3.8)

Non-nullable property 'Tokens' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
[Option(Required = false, Default = "cpu", HelpText = "Provider, e.g., cpu, coreml")]
public string Provider { get; set; }

Check warning on line 24 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (ubuntu-latest, 3.8)

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 24 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (macos-latest, 3.8)

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
[Option(Required = false, HelpText = "Path to transducer encoder.onnx")]
public string Encoder { get; set; }

Check warning on line 27 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (ubuntu-latest, 3.8)

Non-nullable property 'Encoder' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 27 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (macos-latest, 3.8)

Non-nullable property 'Encoder' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
[Option(Required = false, HelpText = "Path to transducer decoder.onnx")]
public string Decoder { get; set; }

Check warning on line 30 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (ubuntu-latest, 3.8)

Non-nullable property 'Decoder' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 30 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (macos-latest, 3.8)

Non-nullable property 'Decoder' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
[Option(Required = false, HelpText = "Path to transducer joiner.onnx")]
public string Joiner { get; set; }

Check warning on line 33 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (ubuntu-latest, 3.8)

Non-nullable property 'Joiner' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 33 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (macos-latest, 3.8)

Non-nullable property 'Joiner' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
[Option("paraformer-encoder", Required = false, HelpText = "Path to paraformer encoder.onnx")]
public string ParaformerEncoder { get; set; }

Check warning on line 36 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (ubuntu-latest, 3.8)

Non-nullable property 'ParaformerEncoder' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 36 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (macos-latest, 3.8)

Non-nullable property 'ParaformerEncoder' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
[Option("paraformer-decoder", Required = false, HelpText = "Path to paraformer decoder.onnx")]
public string ParaformerDecoder { get; set; }

Check warning on line 39 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (ubuntu-latest, 3.8)

Non-nullable property 'ParaformerDecoder' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 39 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (macos-latest, 3.8)

Non-nullable property 'ParaformerDecoder' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
[Option("zipformer2-ctc", Required = false, HelpText = "Path to zipformer2 CTC onnx model")]
public string Zipformer2Ctc { get; set; }

Check warning on line 42 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (ubuntu-latest, 3.8)

Non-nullable property 'Zipformer2Ctc' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 42 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (macos-latest, 3.8)

Non-nullable property 'Zipformer2Ctc' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
[Option("num-threads", Required = false, Default = 1, HelpText = "Number of threads for computation")]
public int NumThreads { get; set; }
[Option("decoding-method", Required = false, Default = "greedy_search",
HelpText = "Valid decoding methods are: greedy_search, modified_beam_search")]
public string DecodingMethod { get; set; }

Check warning on line 49 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (ubuntu-latest, 3.8)

Non-nullable property 'DecodingMethod' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 49 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (macos-latest, 3.8)

Non-nullable property 'DecodingMethod' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
[Option(Required = false, Default = false, HelpText = "True to show model info during loading")]
public bool Debug { get; set; }
public float Rule3MinUtteranceLength { get; set; }
[Option("files", Required = true, HelpText = "Audio files for decoding")]
public IEnumerable<string> Files { get; set; }

Check warning on line 83 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (ubuntu-latest, 3.8)

Non-nullable property 'Files' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 83 in dotnet-examples/online-decode-files/Program.cs

GitHub Actions / test-dot-net (macos-latest, 3.8)

Non-nullable property 'Files' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
}