summaryrefslogtreecommitdiff
path: root/makima/src/bin/makima.rs
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/bin/makima.rs')
-rw-r--r--makima/src/bin/makima.rs34
1 files changed, 27 insertions, 7 deletions
diff --git a/makima/src/bin/makima.rs b/makima/src/bin/makima.rs
index 338d8f9..a84c581 100644
--- a/makima/src/bin/makima.rs
+++ b/makima/src/bin/makima.rs
@@ -42,13 +42,33 @@ async fn run_server(
eprintln!("=== Makima Server Starting ===");
eprintln!("Port: {}", args.port);
- // Create app state
- let mut app_state = makima::server::state::AppState::new(
- &args.parakeet_model_dir,
- &args.parakeet_eou_dir,
- &args.sortformer_model_path,
- &args.chatterbox_model_dir,
- );
+ // Create app state. ML model paths are optional now — when none of
+ // them are supplied (the slim Dockerfile case) Listen and Speak
+ // websocket endpoints respond with "not configured" and everything
+ // else works normally.
+ let mut app_state = match (
+ args.parakeet_model_dir.as_deref(),
+ args.parakeet_eou_dir.as_deref(),
+ args.sortformer_model_path.as_deref(),
+ args.chatterbox_model_dir.as_deref(),
+ ) {
+ (Some(p), Some(eou), Some(sf), Some(cb)) => {
+ eprintln!("ML models configured (lazy load on first use)");
+ makima::server::state::AppState::new(p, eou, sf, cb)
+ }
+ (None, None, None, None) => {
+ eprintln!("ML models NOT configured — Listen/Speak disabled");
+ makima::server::state::AppState::new_slim()
+ }
+ _ => {
+ eprintln!(
+ "WARNING: only some ML model paths provided. Pass all four \
+ (parakeet/parakeet_eou/sortformer/chatterbox) to enable ML, \
+ or none to run in slim mode. Continuing in slim mode."
+ );
+ makima::server::state::AppState::new_slim()
+ }
+ };
// Connect to database if URL provided
if let Some(ref db_url) = args.database_url {