offline-speech-denoiser-model-config.cc
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// sherpa-onnx/csrc/offline-speech-denoiser-model-config.cc
//
// Copyright (c) 2025 Xiaomi Corporation
#include "sherpa-onnx/csrc/offline-speech-denoiser-model-config.h"
#include <string>
namespace sherpa_onnx {
void OfflineSpeechDenoiserModelConfig::Register(ParseOptions *po) {
gtcrn.Register(po);
po->Register("num-threads", &num_threads,
"Number of threads to run the neural network");
po->Register("debug", &debug,
"true to print model information while loading it.");
po->Register("provider", &provider,
"Specify a provider to use: cpu, cuda, coreml");
}
bool OfflineSpeechDenoiserModelConfig::Validate() const {
return gtcrn.Validate();
}
std::string OfflineSpeechDenoiserModelConfig::ToString() const {
std::ostringstream os;
os << "OfflineSpeechDenoiserModelConfig(";
os << "gtcrn=" << gtcrn.ToString() << ", ";
os << "num_threads=" << num_threads << ", ";
os << "debug=" << (debug ? "True" : "False") << ", ";
os << "provider=\"" << provider << "\")";
return os.str();
}
} // namespace sherpa_onnx