Skip to content

Commit 6c2cda0

Browse files
committed
add top_k to example
1 parent 65c8f97 commit 6c2cda0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/audio_tag.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ fn main() {
1212
let model = "./sherpa-onnx-zipformer-audio-tagging-2024-04-09/model.int8.onnx";
1313
let labels_path = "./sherpa-onnx-zipformer-audio-tagging-2024-04-09/class_labels_indices.csv";
1414
let wav_path = "./sherpa-onnx-zipformer-audio-tagging-2024-04-09/test_wavs/1.wav";
15+
let top_k = 5;
1516

1617
let reader = hound::WavReader::open(&wav_path).expect("Failed to open WAV file");
1718
let spec = reader.spec();
@@ -24,7 +25,7 @@ fn main() {
2425
let config = sherpa_rs::audio_tag::AudioTagConfig {
2526
model: model.into(),
2627
labels: labels_path.into(),
27-
top_k: 5,
28+
top_k,
2829
..Default::default()
2930
};
3031
let mut audio_tag = sherpa_rs::audio_tag::AudioTag::new(config).unwrap();

0 commit comments

Comments
 (0)