bunsen-tool 0.43.0

bunsen's models on the command line: speech to text (Parakeet, Qwen3-ASR, Voxtral Realtime, Whisper) and who spoke when (Sortformer), text to speech (ZONOS3, Qwen3-TTS), chat (Qwen3, Qwen3.5, Gemma, nanochat) and typed decisions (Laya). The chat driver is also a library, `bunsen_tool::chat`.
Documentation
//! A checkpoint's generation policy, as a search.
use bunsen::kits::support::{
    decoding::SearchConfig,
    model_config::GenerationPolicy,
};

/// The search `policy` says a reply is generated by: sampling at its
/// temperature, top-k, top-p and min-p when it samples, the argmax
/// otherwise.
pub fn search_config(policy: &GenerationPolicy) -> SearchConfig {
    match &policy.sampling {
        Some(s) => SearchConfig::new()
            .with_temperature(s.temperature)
            .with_top_k(s.top_k)
            .with_top_p(s.top_p)
            .with_min_p(s.min_p),
        None => SearchConfig::new(),
    }
}

#[cfg(test)]
mod tests {
    use bunsen::kits::support::model_config::SamplingPolicy;

    use super::*;

    #[test]
    fn test_search_config() {
        let sampled = GenerationPolicy {
            stop_ids: vec![151645, 151643],
            sampling: Some(SamplingPolicy {
                temperature: 0.6,
                top_k: Some(20),
                top_p: Some(0.95),
                min_p: None,
            }),
            ..Default::default()
        };
        let s = search_config(&sampled);
        assert_eq!(
            (s.temperature, s.top_k, s.top_p, s.min_p),
            (0.6, Some(20), Some(0.95), None)
        );
        assert_eq!(
            search_config(&GenerationPolicy::default()),
            SearchConfig::new()
        );
    }
}