Skip to content

Commit

Permalink
remove the *-hotwrods-* from the paraformer and ctc test filename, si…
Browse files Browse the repository at this point in the history
…nce it's not be used.

for the keywords spotter test example, using test_keywords.txt from the test_wavs dir so that keywords can be spotted out.
  • Loading branch information
xiao committed Sep 18, 2024
1 parent c927b9a commit 0102b58
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions c-api-examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ add_executable(streaming-zipformer-buffered-tokens-hotwords-c-api
streaming-zipformer-buffered-tokens-hotwords-c-api.c)
target_link_libraries(streaming-zipformer-buffered-tokens-hotwords-c-api sherpa-onnx-c-api)

add_executable(streaming-paraformer-buffered-tokens-hotwords-c-api
streaming-paraformer-buffered-tokens-hotwords-c-api.c)
target_link_libraries(streaming-paraformer-buffered-tokens-hotwords-c-api sherpa-onnx-c-api)
add_executable(streaming-paraformer-buffered-tokens-c-api
streaming-paraformer-buffered-tokens-c-api.c)
target_link_libraries(streaming-paraformer-buffered-tokens-c-api sherpa-onnx-c-api)

add_executable(streaming-ctc-buffered-tokens-hotwords-c-api
streaming-ctc-buffered-tokens-hotwords-c-api.c)
target_link_libraries(streaming-ctc-buffered-tokens-hotwords-c-api sherpa-onnx-c-api)
add_executable(streaming-ctc-buffered-tokens-c-api
streaming-ctc-buffered-tokens-c-api.c)
target_link_libraries(streaming-ctc-buffered-tokens-c-api sherpa-onnx-c-api)

add_executable(keywords-spotter-buffered-tokens-keywords-c-api
keywords-spotter-buffered-tokens-keywords-c-api.c)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ int32_t main() {
const char *tokens_filename =
"sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01-mobile/tokens.txt";
const char *keywords_filename =
"sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01-mobile/"
"keywords.txt";
"sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01-mobile/test_wavs/"
"test_keywords.txt";
const SherpaOnnxWave *wave = SherpaOnnxReadWave(wav_filename);
if (wave == NULL) {
fprintf(stderr, "Failed to read %s\n", wav_filename);
return -1;
}

// reading tokens and hotwords to buffers
// reading tokens and keywords to buffers
const char *tokens_buf;
size_t token_buf_size = ReadFile(tokens_filename, &tokens_buf);
if (token_buf_size < 1) {
Expand All @@ -84,7 +84,7 @@ int32_t main() {
const char *keywords_buf;
size_t keywords_buf_size = ReadFile(keywords_filename, &keywords_buf);
if (keywords_buf_size < 1) {
fprintf(stderr, "Please check your hotwords.txt!\n");
fprintf(stderr, "Please check your keywords.txt!\n");
free((void *)keywords_buf);
return -1;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// c-api-examples/streaming-ctc-buffered-tokens-hotwords-c-api.c
// c-api-examples/streaming-ctc-buffered-tokens-c-api.c
//
// Copyright (c) 2024 Xiaomi Corporation
// Copyright (c) 2024 Luo Xiao

//
// This file demonstrates how to use streaming Zipformer2 Ctc with sherpa-onnx's
// C API and with tokens and hotwords loaded from buffered strings instead of
// C API and with tokens loaded from buffered strings instead of
// from external files API.
// clang-format off
//
Expand Down Expand Up @@ -65,7 +65,7 @@ int32_t main() {
return -1;
}

// reading tokens and hotwords to buffers
// reading tokens to buffers
const char *tokens_buf;
size_t token_buf_size = ReadFile(tokens_filename, &tokens_buf);
if (token_buf_size < 1) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// c-api-examples/streaming-paraformer-buffered-tokens-hotwords-c-api.c
// c-api-examples/streaming-paraformer-buffered-tokens-c-api.c
//
// Copyright (c) 2024 Xiaomi Corporation
// Copyright (c) 2024 Luo Xiao

//
// This file demonstrates how to use streaming Paraformer with sherpa-onnx's C
// API and with tokens and hotwords loaded from buffered strings instead of from
// API and with tokens loaded from buffered strings instead of from
// external files API.
// clang-format off
//
Expand Down Expand Up @@ -65,7 +65,7 @@ int32_t main() {
return -1;
}

// reading tokens and hotwords to buffers
// reading tokens to buffers
const char *tokens_buf;
size_t token_buf_size = ReadFile(tokens_filename, &tokens_buf);
if (token_buf_size < 1) {
Expand Down

0 comments on commit 0102b58

Please sign in to comment.