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

Fix CI tests. #907

Merged
merged 3 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions cmake/cmake_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def get_binaries():
"kaldi-decoder-core.dll",
"kaldi-native-fbank-core.dll",
"onnxruntime.dll",
"ssentencepiece_core.dll",
"piper_phonemize.dll",
"sherpa-onnx-c-api.dll",
"sherpa-onnx-core.dll",
Expand Down
2 changes: 1 addition & 1 deletion cmake/sherpa-onnx-no-tts.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Cflags: -I"${includedir}"
# Note: -lcargs is required only for the following file
# https://github.com/k2-fsa/sherpa-onnx/blob/master/c-api-examples/decode-file-c-api.c
# We add it here so that users don't need to specify -lcargs when compiling decode-file-c-api.c
Libs: -L"${libdir}" -lsherpa-onnx-c-api -lsherpa-onnx-core -lkaldi-decoder-core -lsherpa-onnx-kaldifst-core -lsherpa-onnx-fst -lkaldi-native-fbank-core -lonnxruntime -Wl,-rpath,${libdir} @SHERPA_ONNX_PKG_WITH_CARGS@ @SHERPA_ONNX_PKG_CONFIG_EXTRA_LIBS@
Libs: -L"${libdir}" -lsherpa-onnx-c-api -lsherpa-onnx-core -lkaldi-decoder-core -lsherpa-onnx-kaldifst-core -lsherpa-onnx-fst -lkaldi-native-fbank-core -lonnxruntime -lssentencepiece_core -Wl,-rpath,${libdir} @SHERPA_ONNX_PKG_WITH_CARGS@ @SHERPA_ONNX_PKG_CONFIG_EXTRA_LIBS@
2 changes: 1 addition & 1 deletion cmake/sherpa-onnx.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Cflags: -I"${includedir}"
# Note: -lcargs is required only for the following file
# https://github.com/k2-fsa/sherpa-onnx/blob/master/c-api-examples/decode-file-c-api.c
# We add it here so that users don't need to specify -lcargs when compiling decode-file-c-api.c
Libs: -L"${libdir}" -lsherpa-onnx-c-api -lsherpa-onnx-core -lkaldi-decoder-core -lsherpa-onnx-kaldifst-core -lsherpa-onnx-fstfar -lsherpa-onnx-fst -lkaldi-native-fbank-core -lpiper_phonemize -lespeak-ng -lucd -lonnxruntime -Wl,-rpath,${libdir} @SHERPA_ONNX_PKG_WITH_CARGS@ @SHERPA_ONNX_PKG_CONFIG_EXTRA_LIBS@
Libs: -L"${libdir}" -lsherpa-onnx-c-api -lsherpa-onnx-core -lkaldi-decoder-core -lsherpa-onnx-kaldifst-core -lsherpa-onnx-fstfar -lsherpa-onnx-fst -lkaldi-native-fbank-core -lpiper_phonemize -lespeak-ng -lucd -lonnxruntime -lssentencepiece_core -Wl,-rpath,${libdir} @SHERPA_ONNX_PKG_WITH_CARGS@ @SHERPA_ONNX_PKG_CONFIG_EXTRA_LIBS@
6 changes: 3 additions & 3 deletions sherpa-onnx/csrc/offline-recognizer-paraformer-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ static OfflineRecognitionResult Convert(
mergeable = false;

if (i > 0) {
const uint8_t *p = reinterpret_cast<const uint8_t *>(
sym_table[src.tokens[i - 1]].c_str());
if (p[0] < 0x80) {
const uint8_t p = reinterpret_cast<const uint8_t *>(
sym_table[src.tokens[i - 1]].c_str())[0];
if (p < 0x80) {
// put a space between ascii and non-ascii
text.append(" ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public class OfflineModelConfig {
private final String provider;

private final String modelType;
private final String modelingUnit;
private final String bpeVocab;

private OfflineModelConfig(Builder builder) {
this.transducer = builder.transducer;
Expand All @@ -24,6 +26,8 @@ private OfflineModelConfig(Builder builder) {
this.debug = builder.debug;
this.provider = builder.provider;
this.modelType = builder.modelType;
this.modelingUnit = builder.modelingUnit;
this.bpeVocab = builder.bpeVocab;
}

public static Builder builder() {
Expand Down Expand Up @@ -62,6 +66,13 @@ public String getModelType() {
return modelType;
}

public String getModelingUnit() {
return modelingUnit;
}

public String getBpeVocab() {
return bpeVocab;
}

public static class Builder {
private OfflineParaformerModelConfig paraformer = OfflineParaformerModelConfig.builder().build();
Expand All @@ -73,6 +84,8 @@ public static class Builder {
private boolean debug = true;
private String provider = "cpu";
private String modelType = "";
private String modelingUnit = "cjkchar";
private String bpeVocab = "";

public OfflineModelConfig build() {
return new OfflineModelConfig(this);
Expand Down Expand Up @@ -122,5 +135,13 @@ public Builder setModelType(String modelType) {
this.modelType = modelType;
return this;
}

public void setModelingUnit(String modelingUnit) {
this.modelingUnit = modelingUnit;
}

public void setBpeVocab(String bpeVocab) {
this.bpeVocab = bpeVocab;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public class OnlineModelConfig {
private final boolean debug;
private final String provider;
private final String modelType;
private final String modelingUnit;
private final String bpeVocab;

private OnlineModelConfig(Builder builder) {
this.transducer = builder.transducer;
Expand All @@ -24,6 +26,8 @@ private OnlineModelConfig(Builder builder) {
this.debug = builder.debug;
this.provider = builder.provider;
this.modelType = builder.modelType;
this.modelingUnit = builder.modelingUnit;
this.bpeVocab = builder.bpeVocab;
}

public static Builder builder() {
Expand Down Expand Up @@ -66,6 +70,14 @@ public String getModelType() {
return modelType;
}

public String getModelingUnit() {
return modelingUnit;
}

public String getBpeVocab() {
return bpeVocab;
}

public static class Builder {
private OnlineParaformerModelConfig paraformer = OnlineParaformerModelConfig.builder().build();
private OnlineTransducerModelConfig transducer = OnlineTransducerModelConfig.builder().build();
Expand All @@ -76,6 +88,8 @@ public static class Builder {
private boolean debug = true;
private String provider = "cpu";
private String modelType = "";
private String modelingUnit = "cjkchar";
private String bpeVocab = "";

public OnlineModelConfig build() {
return new OnlineModelConfig(this);
Expand Down Expand Up @@ -125,5 +139,13 @@ public Builder setModelType(String modelType) {
this.modelType = modelType;
return this;
}

public void setModelingUnit(String modelingUnit) {
this.modelingUnit = modelingUnit;
}

public void setBpeVocab(String bpeVocab) {
this.bpeVocab = bpeVocab;
}
}
}
Loading