Päivitetty juttuja
This commit is contained in:
@@ -227,6 +227,7 @@ fn build_auth_message(allocated_gb: u32) -> String {
|
||||
"status": "agent_ready",
|
||||
"node_type": "native",
|
||||
"allocated_gb": allocated_gb,
|
||||
"selected_task": "qwen-coder-05b",
|
||||
"system": sys,
|
||||
});
|
||||
|
||||
@@ -318,10 +319,14 @@ async fn main() {
|
||||
if text.contains("llm_prompt") && !busy {
|
||||
if let Ok(task) = serde_json::from_str::<serde_json::Value>(&text) {
|
||||
let prompt = task.get("prompt").and_then(|v| v.as_str()).unwrap_or("");
|
||||
if !prompt.is_empty() {
|
||||
let task_id = task.get("task_id").and_then(|v| v.as_str()).unwrap_or("?");
|
||||
let msg_model = task.get("model").and_then(|v| v.as_str()).unwrap_or("");
|
||||
|
||||
if !prompt.is_empty() && msg_model.starts_with("qwen-coder") {
|
||||
|
||||
if let Some(ref mut engine) = llm {
|
||||
busy = true;
|
||||
tracing::info!("Generoidaan: \"{}\"", prompt);
|
||||
tracing::info!("Generoidaan (task_id: {}): \"{}\"", task_id, prompt);
|
||||
|
||||
match engine.generate(prompt, 64) {
|
||||
Ok(result) => {
|
||||
@@ -336,12 +341,13 @@ async fn main() {
|
||||
let done = json!({
|
||||
"type": "llm_done",
|
||||
"prompt": prompt,
|
||||
"model": "Qwen2.5-0.5B-Instruct (native/GPU)",
|
||||
"model": "Qwen2.5-Coder-0.5B (native/GPU)",
|
||||
"response": result.text,
|
||||
"tokens_generated": result.tokens_generated,
|
||||
"duration_ms": result.duration_ms,
|
||||
"tokens_per_sec": (result.tokens_per_sec * 10.0).round() / 10.0,
|
||||
"load_time_ms": 0,
|
||||
"task_id": task_id,
|
||||
});
|
||||
let _ = write.send(Message::Text(done.to_string())).await;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user