Code refactoring (#74)
* Don't reset model state and feature extractor on endpointing * support passing decoding_method from commandline * Add modified_beam_search to Python API * fix C API example * Fix style issues
This commit is contained in:
@@ -36,7 +36,7 @@ static void Handler(int32_t sig) {
|
||||
}
|
||||
|
||||
int32_t main(int32_t argc, char *argv[]) {
|
||||
if (argc < 5 || argc > 6) {
|
||||
if (argc < 5 || argc > 7) {
|
||||
const char *usage = R"usage(
|
||||
Usage:
|
||||
./bin/sherpa-onnx-microphone \
|
||||
@@ -44,7 +44,10 @@ Usage:
|
||||
/path/to/encoder.onnx\
|
||||
/path/to/decoder.onnx\
|
||||
/path/to/joiner.onnx\
|
||||
[num_threads]
|
||||
[num_threads [decoding_method]]
|
||||
|
||||
Default value for num_threads is 2.
|
||||
Valid values for decoding_method: greedy_search (default), modified_beam_search.
|
||||
|
||||
Please refer to
|
||||
https://k2-fsa.github.io/sherpa/onnx/pretrained_models/index.html
|
||||
@@ -70,6 +73,11 @@ for a list of pre-trained models to download.
|
||||
config.model_config.num_threads = atoi(argv[5]);
|
||||
}
|
||||
|
||||
if (argc == 7) {
|
||||
config.decoding_method = argv[6];
|
||||
}
|
||||
config.max_active_paths = 4;
|
||||
|
||||
config.enable_endpoint = true;
|
||||
|
||||
config.endpoint_config.rule1.min_trailing_silence = 2.4;
|
||||
|
||||
Reference in New Issue
Block a user