Skip to content

Commit

Permalink
Merge pull request #370 from janhq/364-feat-add-mmlock-option-when-lo…
Browse files Browse the repository at this point in the history
…ad-model

add mlock to load model
  • Loading branch information
tikikun authored Jan 23, 2024
2 parents 0aa422d + 1bda704 commit 8bff906
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion controllers/llamaCPP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ void llamaCPP::chatCompletion(
while (state->instance->single_queue_is_busy) {
LOG_INFO << "Waiting for task to be released status:"
<< state->instance->single_queue_is_busy;
std::this_thread::sleep_for(std::chrono::milliseconds(500)); // Waiting in 500 miliseconds step
std::this_thread::sleep_for(std::chrono::milliseconds(
500)); // Waiting in 500 miliseconds step
}
}
std::string str = "\n\n";
Expand Down Expand Up @@ -476,6 +477,9 @@ bool llamaCPP::loadModelImpl(const Json::Value &jsonBody) {

params.grp_attn_w = jsonBody["grp_attn_w"].asInt();
}
if (!jsonBody["mlock"].isNull()) {
params.use_mlock = jsonBody["mlock"].asBool();
}
params.model = jsonBody["llama_model_path"].asString();
params.n_gpu_layers = jsonBody.get("ngl", 100).asInt();
params.n_ctx = jsonBody.get("ctx_len", 2048).asInt();
Expand Down

0 comments on commit 8bff906

Please sign in to comment.