Skip to content

Commit

Permalink
JNI and python fix
Browse files Browse the repository at this point in the history
  • Loading branch information
manickavela29 committed Jun 26, 2024
1 parent 4011948 commit 1cfd469
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sherpa-onnx/jni/keyword-spotter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static KeywordSpotterConfig GetKwsConfig(JNIEnv *env, jobject config) {
fid = env->GetFieldID(model_config_cls, "provider", "Ljava/lang/String;");
s = (jstring)env->GetObjectField(model_config, fid);
p = env->GetStringUTFChars(s, nullptr);
ans.model_config.provider = p;
ans.model_config.provider_config.provider = p;
env->ReleaseStringUTFChars(s, p);

fid = env->GetFieldID(model_config_cls, "modelType", "Ljava/lang/String;");
Expand Down
2 changes: 1 addition & 1 deletion sherpa-onnx/jni/offline-recognizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static OfflineRecognizerConfig GetOfflineConfig(JNIEnv *env, jobject config) {
fid = env->GetFieldID(model_config_cls, "provider", "Ljava/lang/String;");
s = (jstring)env->GetObjectField(model_config, fid);
p = env->GetStringUTFChars(s, nullptr);
ans.model_config.provider = p;
ans.model_config.provider_config.provider = p;
env->ReleaseStringUTFChars(s, p);

fid = env->GetFieldID(model_config_cls, "modelType", "Ljava/lang/String;");
Expand Down
2 changes: 2 additions & 0 deletions sherpa-onnx/python/csrc/sherpa-onnx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "sherpa-onnx/python/csrc/vad-model.h"
#include "sherpa-onnx/python/csrc/voice-activity-detector.h"
#include "sherpa-onnx/python/csrc/wave-writer.h"
#include "sherpa-onnx/python/csrc/provider-config.h"

#if SHERPA_ONNX_ENABLE_TTS == 1
#include "sherpa-onnx/python/csrc/offline-tts.h"
Expand All @@ -44,6 +45,7 @@ PYBIND11_MODULE(_sherpa_onnx, m) {
PybindOfflinePunctuation(&m);

PybindFeatures(&m);
PybindProviderConfig(&m);
PybindOnlineCtcFstDecoderConfig(&m);
PybindOnlineModelConfig(&m);
PybindOnlineLMConfig(&m);
Expand Down

0 comments on commit 1cfd469

Please sign in to comment.