Refactor: Remove unused Whisper variants
This commit removes the `whisper_variant` and `whisper_hotwords_variant` fields from the `run_id` generation and the `print_meta_summary` function. These variants are no longer used as the project is shifting focus to LLM-based generation. The `run_full_case.rs` example has also been updated to reflect this change.
This commit is contained in:
@@ -13,6 +13,8 @@ pub struct Settings {
|
||||
#[serde(default)]
|
||||
pub whisper: WhisperSettings,
|
||||
#[serde(default)]
|
||||
pub canary: CanarySettings,
|
||||
#[serde(default)]
|
||||
pub ollama: OllamaSettings,
|
||||
#[serde(default)]
|
||||
pub llm: LlmSettings,
|
||||
@@ -72,6 +74,36 @@ fn default_whisper_timeout_seconds() -> u64 {
|
||||
120
|
||||
}
|
||||
|
||||
/// Endpoint for the optional NeMo Canary container service. Active only
|
||||
/// when `ASR_BACKEND=canary` is set in `.env`. Both this block and
|
||||
/// `[whisper]` are always loaded; the worker reads only the active one.
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct CanarySettings {
|
||||
#[serde(default = "default_canary_url")]
|
||||
pub url: String,
|
||||
#[serde(default = "default_canary_timeout_seconds")]
|
||||
pub timeout_seconds: u64,
|
||||
}
|
||||
|
||||
impl Default for CanarySettings {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
url: default_canary_url(),
|
||||
timeout_seconds: default_canary_timeout_seconds(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn default_canary_url() -> String {
|
||||
"http://localhost:9002".into()
|
||||
}
|
||||
/// Higher than Whisper's 120s default: Canary's buffered pipeline for
|
||||
/// audio >25s adds chunk-stitching cost (see docs/canary.md §4.1), so
|
||||
/// long dictations need a wider safety margin.
|
||||
fn default_canary_timeout_seconds() -> u64 {
|
||||
180
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct OllamaSettings {
|
||||
#[serde(default = "default_ollama_url")]
|
||||
@@ -180,6 +212,10 @@ mod tests {
|
||||
url = "http://h:1"
|
||||
timeout_seconds = 60
|
||||
|
||||
[canary]
|
||||
url = "http://h:9"
|
||||
timeout_seconds = 240
|
||||
|
||||
[ollama]
|
||||
url = "http://h:2"
|
||||
model = "x"
|
||||
@@ -197,6 +233,8 @@ system_prompt = "p"
|
||||
.unwrap();
|
||||
assert_eq!(s.whisper.url, "http://h:1");
|
||||
assert_eq!(s.whisper.timeout_seconds, 60);
|
||||
assert_eq!(s.canary.url, "http://h:9");
|
||||
assert_eq!(s.canary.timeout_seconds, 240);
|
||||
assert_eq!(s.ollama.keep_alive, 5);
|
||||
assert_eq!(s.llm.api_key, "k");
|
||||
assert_eq!(s.llm.system_prompt, "p");
|
||||
@@ -207,6 +245,8 @@ system_prompt = "p"
|
||||
let s: Settings = toml::from_str("").unwrap();
|
||||
assert_eq!(s.whisper.url, "http://localhost:10300");
|
||||
assert_eq!(s.whisper.timeout_seconds, 120);
|
||||
assert_eq!(s.canary.url, "http://localhost:9002");
|
||||
assert_eq!(s.canary.timeout_seconds, 180);
|
||||
assert_eq!(s.ollama.url, "http://localhost:11434");
|
||||
assert_eq!(s.ollama.model, "gemma3:4b");
|
||||
assert_eq!(s.llm.timeout_seconds, 180);
|
||||
|
||||
Reference in New Issue
Block a user