From 4bf641cb0db1c7a8f2c738659716f9d7fa146210 Mon Sep 17 00:00:00 2001 From: tikikun Date: Wed, 3 Jan 2024 17:21:24 +0700 Subject: [PATCH] fix high cpu usage --- controllers/llamaCPP.h | 1 + 1 file changed, 1 insertion(+) diff --git a/controllers/llamaCPP.h b/controllers/llamaCPP.h index c1017c757..b7b2b27b0 100644 --- a/controllers/llamaCPP.h +++ b/controllers/llamaCPP.h @@ -1537,6 +1537,7 @@ struct llama_server_context { "cache\n"); kv_cache_clear(); } + std::this_thread::sleep_for(std::chrono::milliseconds(5)); // TODO: Need to implement queueing using CV for better performance // std::unique_lock lock(mutex_tasks); // condition_tasks.wait(lock, [&] { return !queue_tasks.empty(); });