Skip to content

Commit

Permalink
Enable keyword modification without recompilation in the solution
Browse files Browse the repository at this point in the history
  • Loading branch information
lovemefan committed Mar 10, 2024
1 parent 270bbae commit 47d84f5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sherpa-onnx/c-api/c-api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,16 @@ SherpaOnnxKeywordSpotter* CreateKeywordSpotter(
SHERPA_ONNX_LOGE("%s\n", spotter_config.ToString().c_str());
}

#ifndef SHERPA_ONNX_ENABLE_WASM_KWS
// due to the limitations of the wasm file system,
// keywords file will be packaged into the sherpa-onnx-wasm-kws-main.data file
// Solution: take keyword_file variable is directly
// parsed as a string of keywords
if (!spotter_config.Validate()) {
SHERPA_ONNX_LOGE("Errors in config!");
return nullptr;
}
#endif

SherpaOnnxKeywordSpotter* spotter = new SherpaOnnxKeywordSpotter;

Expand Down

0 comments on commit 47d84f5

Please sign in to comment.