(ctx: Context)
| 327 | |
| 328 | #[cfg(feature = "master")] |
| 329 | async fn run_master_audio(ctx: Context) -> Result<()> { |
| 330 | #[cfg(feature = "vibevoice")] |
| 331 | { |
| 332 | let model_path = utils::hf::ensure_model_downloaded(&ctx.args.model)?; |
| 333 | let config_path = model_path.join("config.json"); |
| 334 | |
| 335 | // Detect model variant from config.json model_type |
| 336 | let config_str = std::fs::read_to_string(&config_path)?; |
| 337 | let model_type: String = serde_json::from_str::<serde_json::Value>(&config_str)? |
| 338 | .get("model_type") |
| 339 | .and_then(|v| v.as_str()) |
| 340 | .unwrap_or("vibevoice_streaming") |
| 341 | .to_string(); |
| 342 | |
| 343 | println!("[VibeVoice] Model type: {model_type}"); |
| 344 | |
| 345 | match model_type.as_str() { |
| 346 | "vibevoice" => { |
| 347 | // VibeVoice-1.5B (non-streaming) |
| 348 | run_vibevoice_1_5b(ctx, &model_path, &config_path).await |
| 349 | } |
| 350 | _ => { |
| 351 | // VibeVoice-Realtime-0.5B (streaming) |
| 352 | run_vibevoice_0_5b(ctx, &model_path, &config_path).await |
| 353 | } |
| 354 | } |
| 355 | } |
| 356 | #[cfg(not(feature = "vibevoice"))] |
| 357 | { |
| 358 | let _ = ctx; |
| 359 | anyhow::bail!("vibevoice feature not enabled") |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | #[cfg(feature = "master")] |
| 364 | #[cfg(feature = "vibevoice")] |
no test coverage detected