Skip to content

Commit

Permalink
add top_k to example
Browse files Browse the repository at this point in the history
  • Loading branch information
thewh1teagle committed Oct 18, 2024
1 parent 65c8f97 commit 6c2cda0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/audio_tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ fn main() {
let model = "./sherpa-onnx-zipformer-audio-tagging-2024-04-09/model.int8.onnx";
let labels_path = "./sherpa-onnx-zipformer-audio-tagging-2024-04-09/class_labels_indices.csv";
let wav_path = "./sherpa-onnx-zipformer-audio-tagging-2024-04-09/test_wavs/1.wav";
let top_k = 5;

let reader = hound::WavReader::open(&wav_path).expect("Failed to open WAV file");
let spec = reader.spec();
Expand All @@ -24,7 +25,7 @@ fn main() {
let config = sherpa_rs::audio_tag::AudioTagConfig {
model: model.into(),
labels: labels_path.into(),
top_k: 5,
top_k,
..Default::default()
};
let mut audio_tag = sherpa_rs::audio_tag::AudioTag::new(config).unwrap();
Expand Down

0 comments on commit 6c2cda0

Please sign in to comment.