MCPcopy Create free account
hub / github.com/evilsocket/cake / run_text_worker

Function run_text_worker

cake-mobile/src/lib.rs:549–630  ·  view source on GitHub ↗
(ctx: &mut Context)

Source from the content-addressed store, hash-verified

547}
548
549async fn run_text_worker(ctx: &mut Context) -> String {
550 log_mobile(&format!("[cake-mobile] text model arch: {:?}", ctx.text_model_arch));
551
552 match ctx.text_model_arch {
553 #[cfg(feature = "qwen3_5")]
554 TextModelArch::Qwen3_5 => {
555 log_mobile("[cake-mobile] creating Qwen3.5 worker...");
556 let mut worker = match Worker::<cake_core::models::qwen3_5::Qwen3_5>::new(ctx).await {
557 Ok(w) => {
558 log_mobile("[cake-mobile] Qwen3.5 worker ready on 0.0.0.0:10128");
559 w
560 }
561 Err(e) => {
562 let msg = format!("Qwen3.5 worker creation failed: {}", e);
563 log_mobile(&format!("[cake-mobile] ERROR: {}", msg));
564 return msg;
565 }
566 };
567 log_mobile("[cake-mobile] Qwen3.5 worker.run() starting...");
568 match worker.run().await {
569 Ok(_) => String::new(),
570 Err(e) => {
571 let msg = format!("worker error: {}", e);
572 log_mobile(&format!("[cake-mobile] ERROR: {}", msg));
573 msg
574 }
575 }
576 }
577 #[cfg(feature = "qwen2")]
578 TextModelArch::Qwen2 => {
579 log_mobile("[cake-mobile] creating Qwen2 worker...");
580 let mut worker = match Worker::<cake_core::models::qwen2::Qwen2>::new(ctx).await {
581 Ok(w) => {
582 log_mobile("[cake-mobile] Qwen2 worker ready on 0.0.0.0:10128");
583 w
584 }
585 Err(e) => {
586 let msg = format!("Qwen2 worker creation failed: {}", e);
587 log_mobile(&format!("[cake-mobile] ERROR: {}", msg));
588 return msg;
589 }
590 };
591 log_mobile("[cake-mobile] Qwen2 worker.run() starting...");
592 match worker.run().await {
593 Ok(_) => String::new(),
594 Err(e) => {
595 let msg = format!("worker error: {}", e);
596 log_mobile(&format!("[cake-mobile] ERROR: {}", msg));
597 msg
598 }
599 }
600 }
601 #[cfg(feature = "llama")]
602 TextModelArch::Llama | TextModelArch::Auto => {
603 log_mobile("[cake-mobile] creating LLaMA worker...");
604 let mut worker = match Worker::<cake_core::models::llama3::LLama>::new(ctx).await {
605 Ok(w) => {
606 log_mobile("[cake-mobile] LLaMA worker ready on 0.0.0.0:10128");

Callers 2

run_zero_config_workerFunction · 0.85
run_direct_workerFunction · 0.85

Calls 2

log_mobileFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected