Fix CI errors introduced by supporting loading keywords from buffers (#1366)
This commit is contained in:
@@ -17,6 +17,8 @@ namespace SherpaOnnx
|
||||
KeywordsScore = 1.0F;
|
||||
KeywordsThreshold = 0.25F;
|
||||
KeywordsFile = "";
|
||||
KeywordsBuf= "";
|
||||
KeywordsBufSize= 0;
|
||||
}
|
||||
public FeatureConfig FeatConfig;
|
||||
public OnlineModelConfig ModelConfig;
|
||||
@@ -28,5 +30,10 @@ namespace SherpaOnnx
|
||||
|
||||
[MarshalAs(UnmanagedType.LPStr)]
|
||||
public string KeywordsFile;
|
||||
|
||||
[MarshalAs(UnmanagedType.LPStr)]
|
||||
public string KeywordsBuf;
|
||||
|
||||
public int KeywordsBufSize;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
package sherpa_onnx
|
||||
|
||||
// #cgo LDFLAGS: -L ${SRCDIR}/lib/aarch64-unknown-linux-gnu -lsherpa-onnx-c-api -lsherpa-onnx-core -lkaldi-native-fbank-core -lkaldi-decoder-core -lsherpa-onnx-kaldifst-core -lsherpa-onnx-fstfar -lsherpa-onnx-fst -lpiper_phonemize -lespeak-ng -lucd -lonnxruntime -lssentencepiece_core -Wl,-rpath,${SRCDIR}/lib/aarch64-unknown-linux-gnu
|
||||
// #cgo LDFLAGS: -L ${SRCDIR}/lib/aarch64-unknown-linux-gnu -lsherpa-onnx-c-api -lonnxruntime -Wl,-rpath,${SRCDIR}/lib/aarch64-unknown-linux-gnu
|
||||
import "C"
|
||||
|
||||
@@ -43,6 +43,8 @@ static Napi::External<SherpaOnnxKeywordSpotter> CreateKeywordSpotterWrapper(
|
||||
SHERPA_ONNX_ASSIGN_ATTR_FLOAT(keywords_score, keywordsScore);
|
||||
SHERPA_ONNX_ASSIGN_ATTR_FLOAT(keywords_threshold, keywordsThreshold);
|
||||
SHERPA_ONNX_ASSIGN_ATTR_STR(keywords_file, keywordsFile);
|
||||
SHERPA_ONNX_ASSIGN_ATTR_STR(keywords_buf, keywordsBuf);
|
||||
SHERPA_ONNX_ASSIGN_ATTR_INT32(keywords_buf_size, keywordsBufSize);
|
||||
|
||||
SherpaOnnxKeywordSpotter *kws = SherpaOnnxCreateKeywordSpotter(&c);
|
||||
|
||||
@@ -86,6 +88,10 @@ static Napi::External<SherpaOnnxKeywordSpotter> CreateKeywordSpotterWrapper(
|
||||
delete[] c.keywords_file;
|
||||
}
|
||||
|
||||
if (c.keywords_buf) {
|
||||
delete[] c.keywords_buf;
|
||||
}
|
||||
|
||||
if (!kws) {
|
||||
Napi::TypeError::New(env, "Please check your config!")
|
||||
.ThrowAsJavaScriptException();
|
||||
|
||||
Reference in New Issue
Block a user