This repository was archived by the owner on Jul 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -190,8 +190,7 @@ void llamaCPP::InferenceImpl(
190190 if (llama.model_type == ModelType::EMBEDDING) {
191191 LOG_WARN << " Not support completion for embedding model" ;
192192 Json::Value jsonResp;
193- jsonResp[" message" ] =
194- " Not support completion for embedding model" ;
193+ jsonResp[" message" ] = " Not support completion for embedding model" ;
195194 auto resp = nitro_utils::nitroHttpJsonResponse (jsonResp);
196195 resp->setStatusCode (drogon::k400BadRequest);
197196 callback (resp);
@@ -420,7 +419,8 @@ void llamaCPP::InferenceImpl(
420419
421420 // Since this is an async task, we will wait for the task to be
422421 // completed
423- while (state->inference_status != FINISHED && retries < 10 ) {
422+ while (state->inference_status != FINISHED && retries < 10 &&
423+ state->instance ->llama .model_loaded_external ) {
424424 // Should wait chunked_content_provider lambda to be called within
425425 // 3s
426426 if (state->inference_status == PENDING) {
@@ -740,9 +740,10 @@ void llamaCPP::StopBackgroundTask() {
740740 if (llama.model_loaded_external ) {
741741 llama.model_loaded_external = false ;
742742 llama.condition_tasks .notify_one ();
743- LOG_INFO << " Background task stopped ! " ;
743+ LOG_INFO << " Stopping background task ! " ;
744744 if (backgroundThread.joinable ()) {
745745 backgroundThread.join ();
746746 }
747+ LOG_INFO << " Background task stopped! " ;
747748 }
748749}
You can’t perform that action at this time.
0 commit comments