Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Apr 10, 2024
1 parent 1586191 commit 70284c6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
9 changes: 9 additions & 0 deletions sherpa-onnx/csrc/audio-tagging-model-config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ namespace sherpa_onnx {

void AudioTaggingModelConfig::Register(ParseOptions *po) {
zipformer.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 AudioTaggingModelConfig::Validate() const {
Expand Down
1 change: 1 addition & 0 deletions sherpa-onnx/csrc/audio-tagging.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ std::string AudioTaggingConfig::ToString() const {

os << "AudioTaggingConfig(";
os << "model=" << model.ToString() << ", ";
os << "labels=\"" << labels << "\", ";
os << "top_k=" << top_k << ")";

return os.str();
Expand Down
3 changes: 2 additions & 1 deletion sherpa-onnx/csrc/offline-zipformer-audio-tagging-model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ class OfflineZipformerAudioTaggingModel::Impl {
SHERPA_ONNX_LOGE("%s\n", os.str().c_str());
}

// get vocab size from the output[0].shape, which is (N, num_event_classes)
// get num_event_classes from the output[0].shape,
// which is (N, num_event_classes)
num_event_classes_ =
sess_->GetOutputTypeInfo(0).GetTensorTypeAndShapeInfo().GetShape()[1];
}
Expand Down
4 changes: 2 additions & 2 deletions sherpa-onnx/csrc/offline-zipformer-audio-tagging-model.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace sherpa_onnx {
* from icefall.
*
* See
* https://github.com/k2-fsa/icefall/blob/master/egs/librispeech/ASR/zipformer/export-onnx-ctc.py
* https://github.com/k2-fsa/icefall/blob/master/egs/audioset/AT/zipformer/export-onnx.py
*/
class OfflineZipformerAudioTaggingModel {
public:
Expand All @@ -46,7 +46,7 @@ class OfflineZipformerAudioTaggingModel {
*/
Ort::Value Forward(Ort::Value features, Ort::Value features_length) const;

/** Return the vocabulary size of the model
/** Return the number of event classes of the model
*/
int32_t NumEventClasses() const;

Expand Down

0 comments on commit 70284c6

Please sign in to comment.