broadcastit pois

This commit is contained in:
Jaakko Vanhala
2026-04-11 17:37:16 +03:00
parent a45616046d
commit 4ff626ab88

View File

@@ -222,7 +222,7 @@ fn collect_system_info() -> serde_json::Value {
} }
/// Koko auth-viesti hubille /// Koko auth-viesti hubille
fn build_auth_message(allocated_gb: u32) -> String { fn build_auth_message(allocated_gb: u32, model_name: &str) -> String {
let sys = collect_system_info(); let sys = collect_system_info();
let gpus = collect_all_gpus(); let gpus = collect_all_gpus();
@@ -239,7 +239,7 @@ fn build_auth_message(allocated_gb: u32) -> String {
"status": "agent_ready", "status": "agent_ready",
"node_type": "native", "node_type": "native",
"allocated_gb": allocated_gb, "allocated_gb": allocated_gb,
"selected_task": "qwen2.5-coder:7b", "selected_task": model_name,
"system": sys, "system": sys,
}); });
@@ -321,6 +321,9 @@ async fn main() {
} }
}; };
let active_model = llm.as_ref().map(|e| e.model_name()).unwrap_or_else(|| "unknown".to_string());
tracing::info!("Käytettävä kielimalli konfiguroitu (selected_task): {}", active_model);
// Yhdistetään hubiin // Yhdistetään hubiin
loop { loop {
match connect_async(&hub_url).await { match connect_async(&hub_url).await {
@@ -328,7 +331,7 @@ async fn main() {
tracing::info!("Yhdistetty hubiin!"); tracing::info!("Yhdistetty hubiin!");
let (mut write, mut read) = ws_stream.split(); let (mut write, mut read) = ws_stream.split();
let auth = build_auth_message(allocated_gb); let auth = build_auth_message(allocated_gb, &active_model);
if write.send(Message::Text(auth)).await.is_err() { if write.send(Message::Text(auth)).await.is_err() {
tracing::error!("Auth-viestin lähetys epäonnistui"); tracing::error!("Auth-viestin lähetys epäonnistui");
continue; continue;