Add API to get version information (#2309)

This commit is contained in:
Fangjun Kuang
2025-06-25 00:22:21 +08:00
committed by GitHub
parent 7f2145539d
commit bda427f4b2
169 changed files with 1480 additions and 12 deletions

View File

@@ -0,0 +1 @@
../sherpa-onnx/kotlin-api/VersionInfo.kt

View File

@@ -25,6 +25,18 @@ if [[ ! -f ../build/lib/libsherpa-onnx-jni.dylib && ! -f ../build/lib/libsherpa
fi
export LD_LIBRARY_PATH=$PWD/build/lib:$LD_LIBRARY_PATH
echo $LD_LIBRARY_PATH
function testVersion() {
out_filename=test_version.jar
kotlinc-jvm -include-runtime -d $out_filename \
test_version.kt \
VersionInfo.kt
ls -lh $out_filename
java -Djava.library.path=../build/lib -jar $out_filename
}
function testSpeakerEmbeddingExtractor() {
if [ ! -f ./3dspeaker_speech_eres2net_large_sv_zh-cn_3dspeaker_16k.onnx ]; then
@@ -436,6 +448,7 @@ function testOfflineSenseVoiceWithHr() {
ls -lh $out_filename
java -Djava.library.path=../build/lib -jar $out_filename
}
testVersion
testOfflineSenseVoiceWithHr
testOfflineSpeechDenoiser

View File

@@ -0,0 +1,8 @@
package com.k2fsa.sherpa.onnx
fun main() {
println("sherpa-onnx version: ${VersionInfo.version}");
println("sherpa-onnx gitSha1: ${VersionInfo.gitSha1}");
println("sherpa-onnx gitDate: ${VersionInfo.gitDate}");
}