diff --git a/sherpa-onnx/java-api/Makefile b/sherpa-onnx/java-api/Makefile index 2b419a455..61a652d20 100644 --- a/sherpa-onnx/java-api/Makefile +++ b/sherpa-onnx/java-api/Makefile @@ -13,6 +13,7 @@ java_files += FeatureConfig.java java_files += OnlineLMConfig.java java_files += OnlineParaformerModelConfig.java java_files += OnlineZipformer2CtcModelConfig.java +java_files += OnlineNeMoCtcModelConfig.java java_files += OnlineTransducerModelConfig.java java_files += OnlineModelConfig.java java_files += OnlineCtcFstDecoderConfig.java diff --git a/sherpa-onnx/java-api/src/com/k2fsa/sherpa/onnx/OnlineModelConfig.java b/sherpa-onnx/java-api/src/com/k2fsa/sherpa/onnx/OnlineModelConfig.java index 60505576c..a833b7cd1 100644 --- a/sherpa-onnx/java-api/src/com/k2fsa/sherpa/onnx/OnlineModelConfig.java +++ b/sherpa-onnx/java-api/src/com/k2fsa/sherpa/onnx/OnlineModelConfig.java @@ -7,6 +7,7 @@ public class OnlineModelConfig { private final OnlineTransducerModelConfig transducer; private final OnlineParaformerModelConfig paraformer; private final OnlineZipformer2CtcModelConfig zipformer2Ctc; + private final OnlineNeMoCtcModelConfig neMoCtc; private final String tokens; private final int numThreads; private final boolean debug; @@ -17,6 +18,7 @@ private OnlineModelConfig(Builder builder) { this.transducer = builder.transducer; this.paraformer = builder.paraformer; this.zipformer2Ctc = builder.zipformer2Ctc; + this.neMoCtc = builder.neMoCtc; this.tokens = builder.tokens; this.numThreads = builder.numThreads; this.debug = builder.debug; @@ -40,6 +42,10 @@ public OnlineZipformer2CtcModelConfig getZipformer2Ctc() { return zipformer2Ctc; } + public OnlineNeMoCtcModelConfig getNeMoCtc() { + return neMoCtc; + } + public String getTokens() { return tokens; } @@ -64,6 +70,7 @@ public static class Builder { private OnlineParaformerModelConfig paraformer = OnlineParaformerModelConfig.builder().build(); private OnlineTransducerModelConfig transducer = OnlineTransducerModelConfig.builder().build(); private OnlineZipformer2CtcModelConfig zipformer2Ctc = OnlineZipformer2CtcModelConfig.builder().build(); + private OnlineNeMoCtcModelConfig neMoCtc = OnlineNeMoCtcModelConfig.builder().build(); private String tokens = ""; private int numThreads = 1; private boolean debug = true; @@ -89,6 +96,11 @@ public Builder setZipformer2Ctc(OnlineZipformer2CtcModelConfig zipformer2Ctc) { return this; } + public Builder setNeMoCtc(OnlineNeMoCtcModelConfig neMoCtc) { + this.neMoCtc = neMoCtc; + return this; + } + public Builder setTokens(String tokens) { this.tokens = tokens; return this; diff --git a/sherpa-onnx/java-api/src/com/k2fsa/sherpa/onnx/OnlineNeMoCtcModelConfig.java b/sherpa-onnx/java-api/src/com/k2fsa/sherpa/onnx/OnlineNeMoCtcModelConfig.java new file mode 100644 index 000000000..e23410612 --- /dev/null +++ b/sherpa-onnx/java-api/src/com/k2fsa/sherpa/onnx/OnlineNeMoCtcModelConfig.java @@ -0,0 +1,32 @@ +// Copyright 2024 Xiaomi Corporation +package com.k2fsa.sherpa.onnx; + +public class OnlineNeMoCtcModelConfig { + private final String model; + + private OnlineNeMoCtcModelConfig(Builder builder) { + this.model = builder.model; + } + + public static Builder builder() { + return new Builder(); + } + + public String getModel() { + return model; + } + + public static class Builder { + private String model = ""; + + public OnlineNeMoCtcModelConfig build() { + return new OnlineNeMoCtcModelConfig(this); + } + + public Builder setModel(String model) { + this.model = model; + return this; + } + } + +}